Class FromAnnotationsRuleModule
java.lang.Object
org.apache.commons.digester3.binder.AbstractRulesModule
org.apache.commons.digester3.annotations.FromAnnotationsRuleModule
- All Implemented Interfaces:
RulesModule
RulesModule
implementation that allows loading rules from
annotated classes.- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AnnotationHandlerFactory
private static final AnnotationHandlerFactory
private static final String
private WithMemoryRulesBinder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
bindRulesFrom
(Class<?> type) Scan the input Class, looking for Digester rules expressed via annotations, and binds them.protected final void
Configures aRulesBinder
via the exposed methods.protected abstract void
Configures aRulesBinder
via the exposed methods.private <A extends Annotation,
E extends AnnotatedElement, R extends Rule>
voidhandle
(A annotation, E element) Handles the current visited element and related annotation, invoking the right handler putting the rule provider in the rule set.protected final void
useAnnotationHandlerFactory
(AnnotationHandlerFactory annotationHandlerFactory) Allows users plug a differentAnnotationHandlerFactory
to createAnnotationHandler
instances.protected final void
Allows users to switch back to the defaultAnnotationHandlerFactory
implementation.private void
visitElements
(AnnotatedElement... annotatedElements) private <AE extends AnnotatedElement>
voidvisitElements
(PrivilegedAction<AE[]> action) Methods inherited from class org.apache.commons.digester3.binder.AbstractRulesModule
addError, addError, configure, forPattern, install, rulesBinder
-
Field Details
-
JAVA_PACKAGE
- See Also:
-
DEFAULT_HANDLER_FACTORY
-
annotationHandlerFactory
-
rulesBinder
-
-
Constructor Details
-
FromAnnotationsRuleModule
public FromAnnotationsRuleModule()
-
-
Method Details
-
configure
protected final void configure()Configures aRulesBinder
via the exposed methods.- Specified by:
configure
in classAbstractRulesModule
-
configureRules
protected abstract void configureRules()Configures aRulesBinder
via the exposed methods. -
useAnnotationHandlerFactory
Allows users plug a differentAnnotationHandlerFactory
to createAnnotationHandler
instances.- Parameters:
annotationHandlerFactory
- A customAnnotationHandlerFactory
to createAnnotationHandler
instances
-
useDefaultAnnotationHandlerFactory
protected final void useDefaultAnnotationHandlerFactory()Allows users to switch back to the defaultAnnotationHandlerFactory
implementation. -
bindRulesFrom
Scan the input Class, looking for Digester rules expressed via annotations, and binds them.- Parameters:
type
- the type has to be analyzed- See Also:
-
visitElements
- Type Parameters:
AE
-- Parameters:
action
-
-
visitElements
- Parameters:
annotatedElements
-
-
handle
private <A extends Annotation,E extends AnnotatedElement, void handleR extends Rule> (A annotation, E element) Handles the current visited element and related annotation, invoking the right handler putting the rule provider in the rule set.- Parameters:
annotation
- the current visited annotation.element
- the current visited element.
-