Uploaded image for project: 'Log Tool'
  1. Log Tool
  2. LOGTOOL-56

Introduce parameter positions and "repeat" annotations

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Optional
    • None
    • None
    • None

    Description

      Introduce a {{@Pos(

      {n, n, n}

      )}} annotation that allows repeating and positional adjustment of a parameter This would allow for things like this:

      @LogMessage(level = DEBUG)
      @Message(value = "Got a %d (%x)")
      void gotNumber(@Pos({1, 2}) int value);
      

      Unqualified parameters start counting from the position of the previous parameter. If two parameters end up in the same position it's an error; if a position has no parameter that's an error as well.

      Positional parameters should allow for multiple transformations too:

      @LogMessage(level = DEBUG)
      @Message(value = "Got a %s with a type of %s which has a hash code of %x")
      void gotThing(@Pos(value = {1, 2, 3}, transform = {{}, {GET_CLASS}, {GET_CLASS, HASH_CODE}) Object thing);
      

      Attachments

        Activity

          People

            dlloyd@redhat.com David Lloyd
            dlloyd@redhat.com David Lloyd
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: