|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.chain.config.ConfigParser
public class ConfigParser
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.
Field Summary | |
---|---|
private org.apache.commons.digester.Digester |
digester
The Digester to be used for parsing. |
private org.apache.commons.digester.RuleSet |
ruleSet
The RuleSet to be used for configuring our Digester
parsing rules. |
private boolean |
useContextClassLoader
Should Digester use the context class loader? |
Constructor Summary | |
---|---|
ConfigParser()
|
Method Summary | |
---|---|
org.apache.commons.digester.Digester |
getDigester()
Return the Digester instance to be used for
parsing, creating one if necessary. |
org.apache.commons.digester.RuleSet |
getRuleSet()
Return the RuleSet to be used for configuring
our Digester parsing rules, creating one if necessary. |
boolean |
getUseContextClassLoader()
Return the "use context class loader" flag. |
void |
parse(Catalog catalog,
java.net.URL url)
Deprecated. Use parse(URL) on a configuration resource with "factory" element(s) embedded |
void |
parse(java.net.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. |
void |
setRuleSet(org.apache.commons.digester.RuleSet ruleSet)
Set the RuleSet to be used for configuring
our Digester parsing rules. |
void |
setUseContextClassLoader(boolean useContextClassLoader)
Set the "use context class loader" flag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private org.apache.commons.digester.Digester digester
The Digester
to be used for parsing.
private org.apache.commons.digester.RuleSet ruleSet
The RuleSet
to be used for configuring our Digester
parsing rules.
private boolean useContextClassLoader
Should Digester use the context class loader?
Constructor Detail |
---|
public ConfigParser()
Method Detail |
---|
public org.apache.commons.digester.Digester getDigester()
Return the Digester
instance to be used for
parsing, creating one if necessary.
public org.apache.commons.digester.RuleSet getRuleSet()
Return the RuleSet
to be used for configuring
our Digester
parsing rules, creating one if necessary.
public void setRuleSet(org.apache.commons.digester.RuleSet ruleSet)
Set the RuleSet
to be used for configuring
our Digester
parsing rules.
ruleSet
- The new RuleSet to usepublic boolean getUseContextClassLoader()
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.public void setUseContextClassLoader(boolean useContextClassLoader)
Set the "use context class loader" flag.
useContextClassLoader
- The new flag valuepublic void parse(Catalog catalog, java.net.URL url) throws java.lang.Exception
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.
catalog
- Catalog
into which configured chains are
to be registeredurl
- URL
of the XML document to be parsed
java.lang.Exception
- if a parsing error occurspublic void parse(java.net.URL url) throws java.lang.Exception
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.
url
- URL
of the XML document to be parsed
java.lang.Exception
- if a parsing error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |