|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Maps an XML attribute or element to a Java object or primitive value. An Unmarshaller is a proxy that stores data into the underlying object. During unmarshalling, an Unmarshaller is allocated to (roughly) each element and each attribute; the Unmarshaller's concern is to convert one Java object or primitive from some XML data.
An Unmarshaller may be serially re-used (and most that extend
DefaultUnmarshaller are). Also, an Unmarshaller may delay part of its
work until after the processing of subsequent XML. To enable both behaviors,
Unmarshaller users are required to call engage()
and disengage()
to inform the Unmarshaller when it's in use. The Unmarshaller may make itself
available for re-use, if and how it chooses; or it may elect to ignore
engagement, and let itself become garbage when disengaged.
Method Summary | |
void |
addChild(Unmarshaller childUnmarshaller)
Create a reference from this object to the given child object. |
void |
addValue(char[] from,
int start,
int length)
Add characters from XML content (text) to the value of the mapped object. |
void |
disengage()
Un-do a previous engagement. |
java.lang.Object |
endObject()
Conclude the mapping of this object, and return it. |
void |
engage()
Prevent re-using this Unmarshaller until a matching call to disengage() is made. |
java.lang.Class |
getChildClass(XMLThing childSource)
Choose the class of the object to be mapped from a contained XML attribute or element. |
java.lang.Object |
getObject()
|
java.lang.Class |
getObjectClass()
|
Unmarshaller |
getParent()
The set allocated to the XML element that contains this Unmarshaller's XML source. |
XMLThing |
getSource()
The XML element or attribute from which this Unmarshaller is currently mapping data. |
java.lang.String |
getSourceXPath()
|
XMLContext |
getXMLContext()
|
void |
setObject(java.lang.Object object)
|
void |
setObjectClass(java.lang.Class c)
Set the expected class of the object to be mapped from XML. |
void |
setXMLContext(XMLContext context)
Set the functor for resolving an XML namespace prefix to the namespace URI. |
void |
startObject(java.util.Map documentState,
Unmarshaller parent,
XMLThing source)
Begin mapping an object from an XML element or attribute. |
Method Detail |
public void engage()
public void disengage() throws java.lang.Exception
java.lang.Exception
public void setXMLContext(XMLContext context)
public XMLContext getXMLContext()
public void setObjectClass(java.lang.Class c)
public java.lang.Class getObjectClass()
public void startObject(java.util.Map documentState, Unmarshaller parent, XMLThing source) throws java.lang.Exception
java.lang.Exception
public Unmarshaller getParent()
public XMLThing getSource()
public java.lang.String getSourceXPath()
public java.lang.Class getChildClass(XMLThing childSource) throws java.lang.Exception
java.lang.Exception
public void addChild(Unmarshaller childUnmarshaller) throws java.lang.Exception
java.lang.Exception
public void addValue(char[] from, int start, int length) throws java.lang.Exception
java.lang.Exception
public java.lang.Object endObject() throws java.lang.Exception
java.lang.Exception
public java.lang.Object getObject()
public void setObject(java.lang.Object object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |