Class DefaultRulesBinder
java.lang.Object
org.apache.commons.digester3.binder.DefaultRulesBinder
- All Implemented Interfaces:
RulesBinder
The default Digester EDSL implementation.
- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ClassLoader
private final List
<ErrorMessage> Errors that can occur during binding time or rules creation.private final FromBinderRuleSet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Records an error message which will be presented to the user at a later time.void
Records an exception, the full details of which will be logged, and the message of which will be presented to the user at a later time.private void
addError
(ErrorMessage errorMessage) Records an error, the full details of which will be logged, and the message of which will be presented to the user at a later time.(package private) int
forPattern
(String pattern) Allows to associate the given pattern to one or more Digester rules.Returns the contextClassLoader
.(package private) Iterable
<ErrorMessage> (package private) RuleSet
(package private) boolean
hasError()
(package private) void
initialize
(ClassLoader classLoader) void
install
(RulesModule rulesModule) Allows sub-modules inclusion while binding rules.
-
Field Details
-
errors
Errors that can occur during binding time or rules creation. -
fromBinderRuleSet
-
classLoader
-
-
Constructor Details
-
DefaultRulesBinder
DefaultRulesBinder()
-
-
Method Details
-
initialize
- Parameters:
classLoader
-
-
getContextClassLoader
Returns the contextClassLoader
.- Specified by:
getContextClassLoader
in interfaceRulesBinder
- Returns:
- The context
ClassLoader
-
addError
Records an error message which will be presented to the user at a later time. Unlike throwing an exception, this enable us to continue configuring the Digester and discover more errors. UsesString.format(String, Object[])
to insert the arguments into the message.- Specified by:
addError
in interfaceRulesBinder
- Parameters:
messagePattern
- The message string patternarguments
- Arguments referenced by the format specifiers in the format string
-
addError
Records an exception, the full details of which will be logged, and the message of which will be presented to the user at a later time. If your Module calls something that you worry may fail, you should catch the exception and pass it into this.- Specified by:
addError
in interfaceRulesBinder
- Parameters:
t
- The exception has to be recorded.
-
addError
Records an error, the full details of which will be logged, and the message of which will be presented to the user at a later time.- Parameters:
errorMessage
- The error to record.
-
install
Allows sub-modules inclusion while binding rules.- Specified by:
install
in interfaceRulesBinder
- Parameters:
rulesModule
- the sub-module has to be included.
-
forPattern
Allows to associate the given pattern to one or more Digester rules.- Specified by:
forPattern
in interfaceRulesBinder
- Parameters:
pattern
- The pattern that this rule should match- Returns:
- The Digester rules builder
-
hasError
boolean hasError()- Returns:
-
errorsSize
int errorsSize()- Returns:
-
getErrors
Iterable<ErrorMessage> getErrors()- Returns:
-
getFromBinderRuleSet
RuleSet getFromBinderRuleSet()- Returns:
-