Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
@Target([FIELD]) @ManagedAttribute@AutoPopulate(defaultValue="bar")
@Target([GETTER]) @ManagedAttribute(currencyTimeLimit=15)
@Target([SETTER]) @ManagedAttribute(persistPolicy="OnUpdate")
int base = 10

As an alternative, we could come up with some other syntax to achieve the same result, e.g. here might be another way some other ways to write the above:

Code Block
@[FIELD]ManagedAttributeAutoPopulate(defaultValue="bar")
@[GETTER]ManagedAttribute(currencyTimeLimit=15)
@[SETTER]ManagedAttribute(persistPolicy="OnUpdate")
int base = 10

Or this:

Code Block

@AutoPopulate[FIELD](defaultValue="bar")
@ManagedAttribute[GETTER](currencyTimeLimit=15)
@ManagedAttribute[SETTER](persistPolicy="OnUpdate")
int base = 10

Or this (using a synthetic annotation parameter):

Code Block

@AutoPopulate(groovyTarget='field', defaultValue="bar")
@ManagedAttribute(groovyTarget='getter', currencyTimeLimit=15)
@ManagedAttribute(groovyTarget='setter', persistPolicy="OnUpdate")
int base = 10