GrainContext Annotations
Java only
These annotations can assist you in writing and maintaining your handlers more effectively.
1. @GrainiteLogger
@GrainiteLogger
This annotation is used to inject the logger into an annotated field. This is equivalent to getting the logger using GrainContext#getLogger()
.
The field type for this annotation must be java.util.logging.Logger
.
2. @InjectGrainContext
@InjectGrainContext
This annotation is used to inject the GrainContext into the annotated field. With this, you don't need to include the GrainContext
parameter in your handler methods.
The field type for this annotation must be com.grainite.api.context.GrainContext
.
3. @ActionHandlerConfig
@ActionHandlerConfig
This annotation is used to inject the Action Handler's config into the annotated field. This is equivalent to getting the config using GrainContext#getConfig()
.
The field type for this annotation must be java.util.Map
.
Last updated