Class DigesterLoader
- java.lang.Object
-
- org.apache.commons.digester.annotations.DigesterLoader
-
public final class DigesterLoader extends Object
This class manages the creation of Digester instances analyzing target classes annotated with digester annotations.- Since:
- 2.1
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DigesterLoader(AnnotationRuleProviderFactory annotationRuleProviderFactory, DigesterLoaderHandlerFactory digesterLoaderHandlerFactory)
Creates a newDigesterLoader
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRules(Class<?> target, Digester digester)
Add rules to an already created Digester instance, analyzing the digester annotations in the target class.void
addRulesTo(Class<?> target, FromAnnotationsRuleSet ruleSet)
Analyzes the target class and adds theAnnotationRuleProvider
s to the existingFromAnnotationsRuleSet
.Digester
createDigester(Class<?> target)
Creates a new digester which rules are defined by analyzing the digester annotations in the target class.protected AnnotationRuleProviderFactory
getAnnotationRuleProviderFactory()
protected DigesterLoaderHandlerFactory
getDigesterLoaderHandlerFactory()
RuleSet
getRuleSet(Class<?> target)
Builds a newRuleSet
analyzing the digester annotations in the target class.
-
-
-
Constructor Detail
-
DigesterLoader
protected DigesterLoader(AnnotationRuleProviderFactory annotationRuleProviderFactory, DigesterLoaderHandlerFactory digesterLoaderHandlerFactory)
Creates a newDigesterLoader
instance.- Parameters:
annotationRuleProviderFactory
-digesterLoaderHandlerFactory
-
-
-
Method Detail
-
getAnnotationRuleProviderFactory
protected AnnotationRuleProviderFactory getAnnotationRuleProviderFactory()
-
getDigesterLoaderHandlerFactory
protected DigesterLoaderHandlerFactory getDigesterLoaderHandlerFactory()
-
createDigester
public Digester createDigester(Class<?> target)
Creates a new digester which rules are defined by analyzing the digester annotations in the target class.- Parameters:
target
- the class has to be analyzed.- Returns:
- a new Digester instance.
-
addRules
public void addRules(Class<?> target, Digester digester)
Add rules to an already created Digester instance, analyzing the digester annotations in the target class.- Parameters:
target
- the class has to be analyzed.digester
- the Digester instance reference.
-
getRuleSet
public RuleSet getRuleSet(Class<?> target)
Builds a newRuleSet
analyzing the digester annotations in the target class. It avoids iterate the annotations analysis for already analyzed classes, using an in-memory LRU cache.- Parameters:
target
- the class has to be analyzed.- Returns:
- a new
RuleSet
.
-
addRulesTo
public void addRulesTo(Class<?> target, FromAnnotationsRuleSet ruleSet)
Analyzes the target class and adds theAnnotationRuleProvider
s to the existingFromAnnotationsRuleSet
.- Parameters:
target
- the class has to be analyzed.ruleSet
- the RuleSet where adding the providers.
-
-