gh-pages / com.nextfaze.devfun / DeveloperAnnotation / <init>
<init>
DeveloperAnnotation(developerFunction:
Boolean
= false, developerCategory:
Boolean
= false, developerReference:
Boolean
= false)
Annotation used to by DevFun to “tag” references to other DevFun/developer -related annotations.
Behaviour
By default this annotation will do nothing - you must set one of the flags to true
to take effect.
This is a somewhat experimental annotation - though DevFun uses it directly now (@DeveloperFunction
is annotated @DeveloperAnnotation(developerFunction = true)
).Having said that, attempts have been made for it to be quite versatile but it is still quite a recent aspect.
developerFunction
When true
the compiler will treat it as if it was an @DeveloperFunction annotation. In this state the compiler will check for the
same fields of @DeveloperFunction
, falling back to the standard defaults if they are absent.
If you have different defaults defined compared to DeveloperFunction then these values will be written as if you had used
@DeveloperFunction(field = value)
at the declaration site - this behaviour is somewhat experimental. Please report any issues you encounter.
An example of this can be seen with @DeveloperProperty.
developerCategory
When true
the compiler will treat it as if it was an @DeveloperCategory annotation. In this state the compiler will check for the
same fields of @DeveloperCategory
, falling back to the standard defaults if they are absent.
An example of this can be seen with @ContextCategory.
developerReference
When true
the compiler will treat it as if it was an @DeveloperReference annotation.
An example of this can be seen with @Dagger2Component.
Custom Properties
Properties named the same as the DevFun properties have the same meaning/behaviour. Other properties will be “serialized” and are available on the associated definition - DevFun will generate a “properties” object for annotations (e.g. DeveloperLogger -> DeveloperLoggerProperties)
Use helper functions withProperties or getProperties to get an instance of the properties object. Unset values will return their default values as defined in the annotation.
Parameters
developerFunction
- Set to true
to have the compiler treat the annotation as a @DeveloperFunction. (experimental)
developerCategory
- Set to true
to have the compiler treat the annotation as a @DeveloperCategory. (experimental)
developerReference
- Set to true
to have the compiler treat the annotation as a @DeveloperReference. (experimental)
See Also