|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.doolin.util.xml.DigesterUtils
public class DigesterUtils
Utilities for dealing with a Jakarta Commons Digester.
| Constructor Summary | |
|---|---|
protected |
DigesterUtils()
Protected constructor, used internally |
| Method Summary | |
|---|---|
static DigesterUtils |
createNonValidatingDigester()
Creates a non validating digester |
static DigesterUtils |
createValidatingDigester(URL schemaURL)
Creates a digester that validates against a schema. |
org.apache.commons.digester.Digester |
getDigester()
Access to the underlying digester. |
SAXParser |
getParser()
Returns the associated SAX parser |
void |
parse(File file,
Object initialValue)
Parses a file |
void |
parse(InputSource inputSource,
Object initialValue)
Parses an input source. |
void |
parse(String xml,
Object initialValue)
Parses an XML stream. |
void |
parse(URL url,
Object initialValue)
Parses an URL. |
void |
ruleObject(String node,
Class<?> clazz,
String method)
Creates a simple rule in the digester to create a new class for a node, setting its properties and calling a method on it after creation. |
void |
ruleProperties(String node)
Creates a simple rule in the digester to setup an item from for a node, setting its properties. |
void |
ruleProperty(String node,
String propertySetMethod)
Creates a rule for creating a property from a leaf node, using the node's content as a value. |
void |
ruleProperty(String node,
String propertySetMethod,
Class<?> type)
Creates a rule for creating a typed property from a leaf node, using the node's content as a value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected DigesterUtils()
| Method Detail |
|---|
public static DigesterUtils createNonValidatingDigester()
public static DigesterUtils createValidatingDigester(URL schemaURL)
schemaURL - URL to the schema.
public org.apache.commons.digester.Digester getDigester()
public SAXParser getParser()
public void parse(File file,
Object initialValue)
file - File to parseinitialValue - Initial value for the digester
public void parse(InputSource inputSource,
Object initialValue)
inputSource - Source to parseinitialValue - Initial value for the digester
public void parse(String xml,
Object initialValue)
xml - XML string to parseinitialValue - Initial value for the digester
public void parse(URL url,
Object initialValue)
url - URL to the XML documentinitialValue - Initial value for the digester
public void ruleObject(String node,
Class<?> clazz,
String method)
node - Name (or path) of the XML node. Note that a
*/ will be prepended.clazz - Class of the object to be created for this node.method - Method to call after the node creation. This method is called
on the next object of the digester's stack. If
null, no call is performed.public void ruleProperties(String node)
node - Name (or path) of the XML node. Note that a
*/ will be prepended.
public void ruleProperty(String node,
String propertySetMethod)
node - Name (or path) of the XML node. Note that a
*/ will be prepended.propertySetMethod - Method name to call to set the property
public void ruleProperty(String node,
String propertySetMethod,
Class<?> type)
node - Name (or path) of the XML node. Note that a
*/ will be prepended.propertySetMethod - Method name to call to set the propertytype - Type of the property
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||