| java.lang.Object org.apache.commons.chain.config.ConfigParser
ConfigParser | public class ConfigParser (Code) | | Class to parse the contents of an XML configuration file (using
Commons Digester) that defines and configures commands and command chains
to be registered in a
Catalog . Advanced users can configure the
detailed parsing behavior by configuring the properties of an instance
of this class prior to calling the parse() method. It
is legal to call the parse() method more than once, in order
to parse more than one configuration document.
author: Craig R. McClanahan version: $Revision: 410386 $ $Date: 2006-05-30 22:48:31 +0100 (Tue, 30 May 2006) $ |
Method Summary | |
public Digester | getDigester() | public RuleSet | getRuleSet() | public boolean | getUseContextClassLoader() Return the "use context class loader" flag. | public void | parse(Catalog catalog, URL url) Parse the XML document at the specified URL, using the configured
RuleSet , registering top level commands into the specified
Catalog . | public void | parse(URL url) Parse the XML document at the specified URL using the configured
RuleSet , registering catalogs with nested chains and
commands as they are encountered. | public void | setRuleSet(RuleSet ruleSet) | public void | setUseContextClassLoader(boolean useContextClassLoader) |
getDigester | public Digester getDigester()(Code) | | Return the Digester instance to be used for
parsing, creating one if necessary.
A Digester instance. |
getRuleSet | public RuleSet getRuleSet()(Code) | | Return the RuleSet to be used for configuring
our Digester parsing rules, creating one if necessary.
The RuleSet for configuring a Digester instance. |
getUseContextClassLoader | public boolean getUseContextClassLoader()(Code) | | Return the "use context class loader" flag. If set to
true , Digester will attempt to instantiate new
command and chain instances from the context class loader.
true if Digester should use the context class loader. |
parse | public void parse(Catalog catalog, URL url) throws Exception(Code) | | Parse the XML document at the specified URL, using the configured
RuleSet , registering top level commands into the specified
Catalog . Use this method only if you have
NOT included any factory element in your
configuration resource, and wish to supply the catalog explictly.
Parameters: catalog - Catalog into which configured chains areto be registered Parameters: url - URL of the XML document to be parsed exception: Exception - if a parsing error occurs |
parse | public void parse(URL url) throws Exception(Code) | | Parse the XML document at the specified URL using the configured
RuleSet , registering catalogs with nested chains and
commands as they are encountered. Use this method only
if you have included one or more factory elements in your
configuration resource.
Parameters: url - URL of the XML document to be parsed exception: Exception - if a parsing error occurs |
setRuleSet | public void setRuleSet(RuleSet ruleSet)(Code) | | Set the RuleSet to be used for configuring
our Digester parsing rules.
Parameters: ruleSet - The new RuleSet to use |
setUseContextClassLoader | public void setUseContextClassLoader(boolean useContextClassLoader)(Code) | | Set the "use context class loader" flag.
Parameters: useContextClassLoader - The new flag value |
|
|