This class manages the creation of Digester instances from XML digester
rules files.
| Method from org.apache.commons.digester.xmlrules.DigesterLoader Detail: |
public static Digester createDigester(InputSource rulesSource) {
RuleSet ruleSet = new FromXmlRuleSet(rulesSource);
Digester digester = new Digester();
digester.addRuleSet(ruleSet);
return digester;
}
Creates a new digester and initializes it from the specified InputSource |
public static Digester createDigester(URL rulesXml) {
RuleSet ruleSet = new FromXmlRuleSet(rulesXml);
Digester digester = new Digester();
digester.addRuleSet(ruleSet);
return digester;
}
Creates a new digester and initializes it from the specified XML file |
public static Digester createDigester(InputSource rulesSource,
Digester rulesDigester) {
RuleSet ruleSet = new FromXmlRuleSet(rulesSource, rulesDigester);
Digester digester = new Digester();
digester.addRuleSet(ruleSet);
return digester;
}
Creates a new digester and initializes it from the specified InputSource.
This constructor allows the digester to be used to load the rules to be specified.
This allows properties to be configured on the Digester instance before it is used. |
public static Digester createDigester(URL rulesXml,
Digester rulesDigester) {
RuleSet ruleSet = new FromXmlRuleSet(rulesXml, rulesDigester);
Digester digester = new Digester();
digester.addRuleSet(ruleSet);
return digester;
}
Creates a new digester and initializes it from the specified XML file.
This constructor allows specifing a rulesDigester to do the XML file
loading; thus no matter the XML files is packed into a jar, a war, or a
ear, the rulesDigester can always find the XML files with properly set
ClassLoader. |
public static Object load(URL digesterRules,
ClassLoader classLoader,
URL fileURL) throws DigesterLoadingException, IOException, SAXException {
return load(digesterRules, classLoader, fileURL.openStream());
}
Given the digester rules XML file, a class loader, and an XML input file,
this method parses the input file into Java objects. The class loader
is used by the digester to create the Java objects. |
public static Object load(URL digesterRules,
ClassLoader classLoader,
InputStream input) throws DigesterLoadingException, IOException, SAXException {
Digester digester = createDigester(digesterRules);
digester.setClassLoader(classLoader);
try {
return digester.parse(input);
} catch (XmlLoadException ex) {
// This is a runtime exception that can be thrown by
// FromXmlRuleSet#addRuleInstances, which is called by the Digester
// before it parses the file.
throw new DigesterLoadingException(ex.getMessage(), ex);
}
}
Given the digester rules XML file, a class loader, and an input stream,
this method parses the input into Java objects. The class loader
is used by the digester to create the Java objects. |
public static Object load(URL digesterRules,
ClassLoader classLoader,
Reader reader) throws DigesterLoadingException, IOException, SAXException {
Digester digester = createDigester(digesterRules);
digester.setClassLoader(classLoader);
try {
return digester.parse(reader);
} catch (XmlLoadException ex) {
// This is a runtime exception that can be thrown by
// FromXmlRuleSet#addRuleInstances, which is called by the Digester
// before it parses the file.
throw new DigesterLoadingException(ex.getMessage(), ex);
}
}
Given the digester rules XML file, a class loader, and an input stream,
this method parses the input into Java objects. The class loader
is used by the digester to create the Java objects. |
public static Object load(URL digesterRules,
ClassLoader classLoader,
URL fileURL,
Object rootObject) throws DigesterLoadingException, IOException, SAXException {
return load(digesterRules, classLoader, fileURL.openStream(), rootObject);
}
Given the digester rules XML file, a class loader, and an XML input file,
this method parses the input file into Java objects. The class loader
is used by the digester to create the Java objects. |
public static Object load(URL digesterRules,
ClassLoader classLoader,
InputStream input,
Object rootObject) throws DigesterLoadingException, IOException, SAXException {
Digester digester = createDigester(digesterRules);
digester.setClassLoader(classLoader);
digester.push(rootObject);
try {
return digester.parse(input);
} catch (XmlLoadException ex) {
// This is a runtime exception that can be thrown by
// FromXmlRuleSet#addRuleInstances, which is called by the Digester
// before it parses the file.
throw new DigesterLoadingException(ex.getMessage(), ex);
}
}
Given the digester rules XML file, a class loader, and an input stream,
this method parses the input into Java objects. The class loader
is used by the digester to create the Java objects. |
public static Object load(URL digesterRules,
ClassLoader classLoader,
Reader input,
Object rootObject) throws DigesterLoadingException, IOException, SAXException {
Digester digester = createDigester(digesterRules);
digester.setClassLoader(classLoader);
digester.push(rootObject);
try {
return digester.parse(input);
} catch (XmlLoadException ex) {
// This is a runtime exception that can be thrown by
// FromXmlRuleSet#addRuleInstances, which is called by the Digester
// before it parses the file.
throw new DigesterLoadingException(ex.getMessage(), ex);
}
}
Given the digester rules XML file, a class loader, and an input stream,
this method parses the input into Java objects. The class loader
is used by the digester to create the Java objects. |