Annotation Interface Implementation
Indicates that the annotated class is a custom implementation that should replace the default implementation.
A class annotated with Implementation
will be automatically searched for with help of the ClassFinder
s
and instantiated by guice. Following types are candidates for automatic registration.
Middleware
Validator
TypeAdapter
PermissionsProvider
GuildScopeProvider
ErrorMessageFactory
Descriptor
Example
@Implementation(priority = Priority.NORMAL)
public class CustomMiddleware implements Middleware {
private static final Logger log = LoggerFactory.getLogger(FirstMiddleware.class);
@Override
public void accept(InvocationContext<?> context) {
log.info("run custom middleware");
}
}
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass
<? extends Annotation> Gets the annotation theValidator
should be mapped to.Class
<?> Gets theClass
to register aTypeAdapter
with.Gets thePriority
to register theMiddleware
with.
-
Element Details
-
priority
Priority priorityGets thePriority
to register theMiddleware
with. If this implementation is not a subtype ofMiddleware
, this field can be ignored.- Returns:
- the
Priority
- Default:
NORMAL
-
annotation
Class<? extends Annotation> annotationGets the annotation theValidator
should be mapped to. If this class is not a subtype ofValidator
, this field can be ignored.- Returns:
- the annotation the
Validator
should be mapped to
- Default:
com.github.kaktushose.jda.commands.annotations.constraints.Constraint.class
-
clazz
Class<?> clazzGets theClass
to register aTypeAdapter
with. If this implementation is not a subtype ofTypeAdapter
, this field can be ignored.- Returns:
- the class the
TypeAdapter
should be mapped to
- Default:
java.lang.Object.class
-