org.apache.commons.configuration
private static class ConfigurationFactory.CallOptionalMethodRule extends CallMethodRule
CallMethodRule
that
is internally used for calling a file configuration's load()
method. This class difers from its ancestor that it catches all occuring
exceptions when the specified method is called. It then checks whether
for the corresponding configuration the optional attribute is set. If
this is the case, the exception will simply be ignored.
Since: 1.4
Field Summary | |
---|---|
boolean | optional A flag whether the optional attribute is set for this node. |
Constructor Summary | |
---|---|
CallOptionalMethodRule(String methodName)
Creates a new instance of CallOptionalMethodRule and
sets the name of the method to invoke.
|
Method Summary | |
---|---|
void | begin(Attributes attrs)
Checks if the optional attribute is set.
|
void | end()
Calls the method. |
CallOptionalMethodRule
and
sets the name of the method to invoke.
Parameters: methodName the name of the method
Parameters: attrs the attributes
Throws: Exception if an error occurs
Throws: Exception if an error occurs