java.lang.Object | |||
↳ | org.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.
Call registerBeanClass(Class)
or registerBeanClass(String, Class)
to add rules to map a bean class.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.commons.digester.Digester
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.commons.digester.Digester
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct a new BeanReader with default properties.
| |||||||||||
Construct a new BeanReader, allowing a SAXParser to be passed in.
| |||||||||||
Construct a new BeanReader, allowing an XMLReader to be passed in.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Remove the given class from the register. | |||||||||||
Flush all registered bean classes. | |||||||||||
Gets the dynamic configuration setting to be used for bean reading.
| |||||||||||
Get the current level for logging. | |||||||||||
This method is deprecated.
0.5 use
getMapIDs()
| |||||||||||
Gets read specific configuration details.
| |||||||||||
Get the introspector used. | |||||||||||
Registers a class with a custom mapping. | |||||||||||
Registers a bean class and add mapping rules for this bean class at the given path expression. | |||||||||||
Register a bean class and add mapping rules for this bean class. | |||||||||||
Registers a class with a multi-mapping. | |||||||||||
Sets the dynamic configuration setting to be used for bean reading.
| |||||||||||
Set the current logging level. | |||||||||||
This method is deprecated.
0.5 use
setMapIDs(boolean)
| |||||||||||
Sets the read specific configuration details.
| |||||||||||
Set the introspector to be used. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new bean create rule for the specified path
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.commons.digester.Digester
| |||||||||||
From class
org.xml.sax.helpers.DefaultHandler
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.xml.sax.ContentHandler
| |||||||||||
From interface
org.xml.sax.DTDHandler
| |||||||||||
From interface
org.xml.sax.EntityResolver
| |||||||||||
From interface
org.xml.sax.ErrorHandler
|
Construct a new BeanReader with default properties.
Construct a new BeanReader, allowing a SAXParser to be passed in. This allows BeanReader to be used in environments which are unfriendly to JAXP1.1 (such as WebLogic 6.0). Thanks for the request to change go to James House (james@interobjective.com). This may help in places where you are able to load JAXP 1.1 classes yourself.
parser | use this SAXParser
|
---|
Construct a new BeanReader, allowing an XMLReader to be passed in. This allows BeanReader to be used in environments which are unfriendly to JAXP1.1 (such as WebLogic 6.0). Note that if you use this option you have to configure namespace and validation support yourself, as these properties only affect the SAXParser and emtpy constructor.
reader | use this XMLReader as source for SAX events
|
---|
Remove the given class from the register.
Calling this method will allow the bean class to be re-registered
by a subsequent call to registerBeanClass
.
This allows (for example) a bean to be reintrospected after a change
to the introspection settings.
Note that deregistering a bean does not remove the Digester rules associated with that bean.
beanClass | the Class to remove from the set of registered bean classes |
---|
Flush all registered bean classes.
This allows all bean classes to be re-registered
by a subsequent calls to registerBeanClass
.
Note that deregistering a bean does not remove the Digester rules associated with that bean.
Gets the dynamic configuration setting to be used for bean reading.
Get the current level for logging.
Log
implementation this class logs to
This method is deprecated.
0.5 use getMapIDs()
Should the reader use ID
attributes to match beans.
ID
and IDREF
attributes should be used to match instancesGets read specific configuration details.
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 introspection
Registers a class with a custom mapping.
This mapping is specified by the standard dot betwixt document
contained in the given InputSource
.
Note: the custom mapping will be registered with
the introspector. This must remain so for the reading to work correctly
It is recommended that use of the pre-registeration process provided
by register(Class, InputSource)
be considered as an alternative to this method.
mapping | InputSource giving the dot betwixt document specifying
the mapping |
---|---|
beanClass | Class that should be register |
IntrospectionException | |
SAXException | |
IOException | |
IntrospectionException | |
SAXException |
Registers a bean class and add mapping rules for this bean class at the given path expression.
A bean class is introspected when it is registered.
It will not be introspected again even if the introspection
settings are changed.
If re-introspection is required, then deregisterBeanClass(Class)
must be called
and the bean re-registered.
A bean class can only be registered once.
If the same class is registered a second time, this registration will be ignored.
In order to change a registration, call deregisterBeanClass(Class)
before calling this method.
All the rules required to digest this bean are added when this method is called. Other rules that you want to execute before these should be added before this method is called. Those that should be executed afterwards, should be added afterwards.
path | the xml path expression where the class is to registered. This should be in digester path notation |
---|---|
beanClass | the Class to be registered |
IntrospectionException | if the bean introspection fails |
---|
Register a bean class and add mapping rules for this bean class.
A bean class is introspected when it is registered.
It will not be introspected again even if the introspection
settings are changed.
If re-introspection is required, then deregisterBeanClass(Class)
must be called
and the bean re-registered.
A bean class can only be registered once.
If the same class is registered a second time, this registration will be ignored.
In order to change a registration, call deregisterBeanClass(Class)
before calling this method.
All the rules required to digest this bean are added when this method is called. Other rules that you want to execute before these should be added before this method is called. Those that should be executed afterwards, should be added afterwards.
beanClass | the Class to be registered |
---|
IntrospectionException | if the bean introspection fails |
---|
Registers a class with a multi-mapping.
This mapping is specified by the multi-mapping document
contained in the given InputSource
.
Note: the custom mappings will be registered with
the introspector. This must remain so for the reading to work correctly
It is recommended that use of the pre-registeration process provided
by register(Class, InputSource)
be considered as an alternative to this method.
mapping | InputSource giving the multi-mapping document specifying
the mapping |
---|
IntrospectionException | |
SAXException | |
IOException | |
IntrospectionException | |
SAXException |
Sets the dynamic configuration setting to be used for bean reading.
bindingConfiguration | the BindingConfiguration settings, not null |
---|
Set the current logging level.
log | the Log implementation to use for logging
|
---|
This method is deprecated.
0.5 use setMapIDs(boolean)
Set whether the read should use ID
attributes to match beans.
matchIDs | pass true if ID 's should be matched |
---|
Sets the read specific configuration details.
readConfiguration | not null |
---|
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 introspector |
---|
Adds a new bean create rule for the specified path
path | the digester path at which this rule should be added |
---|---|
elementDescriptor | the ElementDescriptor describes the expected element |
beanClass | the Class of the bean created by this rule
|