|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.apache.commons.digester.Digester
org.apache.commons.betwixt.io.BeanReader
BeanReader
reads a tree of beans from an XML document.
Field Summary | |
private XMLIntrospector |
introspector
Introspector used |
private Log |
log
Log used for logging (Doh!) |
private boolean |
matchIDs
Should the reader use ID 's to match |
private Set |
registeredClasses
The registered classes |
Fields inherited from class org.apache.commons.digester.Digester |
bodyText, bodyTexts, classLoader, configured, entityResolver, entityValidator, errorHandler, factory, JAXP_SCHEMA_LANGUAGE, locator, match, namespaceAware, namespaces, params, parser, publicId, reader, root, rules, saxLog, schemaLanguage, schemaLocation, stack, useContextClassLoader, validating, W3C_XML_SCHEMA |
Constructor Summary | |
BeanReader()
Construct a new BeanReader with default properties. |
|
BeanReader(SAXParser parser)
Construct a new BeanReader, allowing a SAXParser to be passed in. |
|
BeanReader(XMLReader reader)
Construct a new BeanReader, allowing an XMLReader to be passed in. |
Method Summary | |
protected void |
addBeanCreateRule(String path,
ElementDescriptor elementDescriptor,
Class beanClass)
Adds a new bean create rule for the specified path |
Log |
getLog()
Get the current level for logging. |
boolean |
getMatchIDs()
Should the reader use ID attributes to match beans. |
XMLIntrospector |
getXMLIntrospector()
Get the introspector used. |
void |
registerBeanClass(Class beanClass)
Registers a bean class which is used by the reader to deduce the digester rules. |
void |
registerBeanClass(String path,
Class beanClass)
Registers a bean class at the given path expression which is used by the reader to deduce the digester rules. |
void |
setLog(Log log)
Set the current logging level. |
void |
setMatchIDs(boolean matchIDs)
Set whether the read should use ID attributes to match beans. |
void |
setXMLIntrospector(XMLIntrospector introspector)
Set the introspector to be used. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private XMLIntrospector introspector
private Log log
private Set registeredClasses
private boolean matchIDs
ID
's to match
Constructor Detail |
public BeanReader()
public BeanReader(SAXParser parser)
parser
- use this SAXParser
public BeanReader(XMLReader reader)
reader
- use this XMLReader
as source for SAX eventsMethod Detail |
public void registerBeanClass(Class beanClass) throws IntrospectionException
beanClass
- the Class
to be registered
IntrospectionException
- if the bean introspection failspublic void registerBeanClass(String path, Class beanClass) throws IntrospectionException
path
- the xml path expression where the class is to registered.
This should be in digester path notationbeanClass
- the Class
to be registered
IntrospectionException
- if the bean introspection failspublic XMLIntrospector getXMLIntrospector()
Get the introspector used.
The XMLBeanInfo
used to map each bean is
created by the XMLIntrospector
.
One way in which the mapping can be customized is by
altering the XMLIntrospector
.
XMLIntrospector
used for the introspectionpublic void setXMLIntrospector(XMLIntrospector introspector)
Set the introspector to be used.
The XMLBeanInfo
used to map each bean is
created by the XMLIntrospector
.
One way in which the mapping can be customized is by
altering the XMLIntrospector
.
introspector
- use this introspectorpublic Log getLog()
Get the current level for logging.
Log
implementation this class logs topublic void setLog(Log log)
Set the current logging level.
log
- the Log
implementation to use for loggingpublic boolean getMatchIDs()
ID
attributes to match beans.
ID
and IDREF
attributes should be used to match instancespublic void setMatchIDs(boolean matchIDs)
ID
attributes to match beans.
matchIDs
- pass true if ID
's should be matchedprotected void addBeanCreateRule(String path, ElementDescriptor elementDescriptor, Class beanClass)
path
- the digester path at which this rule should be addedelementDescriptor
- the ElementDescriptor
describes the expected elementbeanClass
- the Class
of the bean created by this rule
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |