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 AnnotationHandlerFactoryprivate static final AnnotationHandlerFactoryprivate static final Stringprivate WithMemoryRulesBinder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidbindRulesFrom(Class<?> type) Scan the input Class, looking for Digester rules expressed via annotations, and binds them.protected final voidConfigures aRulesBindervia the exposed methods.protected abstract voidConfigures aRulesBindervia 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 voiduseAnnotationHandlerFactory(AnnotationHandlerFactory annotationHandlerFactory) Allows users plug a differentAnnotationHandlerFactoryto createAnnotationHandlerinstances.protected final voidAllows users to switch back to the defaultAnnotationHandlerFactoryimplementation.private voidvisitElements(AnnotatedElement... annotatedElements) private <AE extends AnnotatedElement>
voidvisitElements(PrivilegedAction<AE[]> action) Methods inherited from class 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 aRulesBindervia the exposed methods.- Specified by:
configurein classAbstractRulesModule
-
configureRules
protected abstract void configureRules()Configures aRulesBindervia the exposed methods. -
useAnnotationHandlerFactory
Allows users plug a differentAnnotationHandlerFactoryto createAnnotationHandlerinstances.- Parameters:
annotationHandlerFactory- A customAnnotationHandlerFactoryto createAnnotationHandlerinstances
-
useDefaultAnnotationHandlerFactory
protected final void useDefaultAnnotationHandlerFactory()Allows users to switch back to the defaultAnnotationHandlerFactoryimplementation. -
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, R extends Rule> void handle(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.
-