|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.openharbor.beck.unmarshal.DefaultUnmarshaller
Shared code, inherited by most kinds of Unmarshaller. Recycles itself (to improve performance) when disengaged.
Field Summary | |
protected java.lang.StringBuffer |
data
|
protected java.util.Map |
documentState
|
protected org.apache.commons.logging.Log |
log
|
Constructor Summary | |
DefaultUnmarshaller()
|
Method Summary | |
void |
addChild(Unmarshaller child)
Create a reference from this object to the given child object. |
protected void |
addToParent()
Create references to this.getObject() from its parent and other Java objects. |
void |
addValue(char[] from,
int start,
int length)
Add characters from XML content (text) to the value of the mapped object. |
protected void |
afterEndObject()
|
void |
disengage()
Un-do a previous engagement. |
protected void |
disengaged()
The last engagement on this will soon be disengaged. |
protected void |
endElement()
The source element's closing tag has just been processed (but disengage() has not yet been called). |
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. |
protected java.util.Map |
getMap(java.util.Map map,
java.lang.Object key)
|
MapFromXML |
getMapFromXML()
|
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()
|
protected java.lang.String |
getXName(XMLThing from,
Prefixer prefixer)
|
protected java.lang.String |
getXPath(Unmarshaller parent,
XMLThing source)
|
protected boolean |
isEngaged()
Whether this object is currently engaged. |
protected java.lang.Object |
newObject()
|
protected void |
processAttributes(java.util.Map attributes)
|
protected void |
referToThis()
Create Java references to this.getObject() if this.getSource() is the referent of an XML cross-reference. |
protected void |
reset()
Release all resources, and subsequently behave as though newly constructed. |
static void |
rethrow(java.lang.Throwable t)
Throw an exception that contains the most diagnostic information available from the given Throwable. |
void |
setMapFromXML(MapFromXML mapper)
|
void |
setObject(java.lang.Object object)
|
void |
setObjectClass(java.lang.Class objectClass)
Set the expected class of the object to be mapped from XML. |
protected void |
setParentAndSource(Unmarshaller parent,
XMLThing source)
|
protected void |
setValue(java.lang.StringBuffer data)
Convert the text and store the resulting data into the object. |
void |
setXMLContext(XMLContext context)
Set the functor for resolving an XML namespace prefix to the namespace URI. |
protected void |
startElement(Unmarshaller parent,
XMLThing source)
|
void |
startObject(java.util.Map documentState,
Unmarshaller parent,
XMLThing source)
Begin mapping an object from an XML element or attribute. |
protected java.lang.String |
toString(XMLThing from)
|
protected void |
trim(java.lang.StringBuffer data)
Trim whitespace from XML data. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final org.apache.commons.logging.Log log
protected java.util.Map documentState
protected java.lang.StringBuffer data
Constructor Detail |
public DefaultUnmarshaller()
Method Detail |
public void setMapFromXML(MapFromXML mapper)
setMapFromXML
in interface MapFromXML.Aware
public MapFromXML getMapFromXML()
getMapFromXML
in interface MapFromXML.Aware
public void setXMLContext(XMLContext context)
Unmarshaller
setXMLContext
in interface Unmarshaller
public XMLContext getXMLContext()
getXMLContext
in interface Unmarshaller
public Unmarshaller getParent()
Unmarshaller
getParent
in interface Unmarshaller
public XMLThing getSource()
Unmarshaller
getSource
in interface Unmarshaller
public java.lang.String getSourceXPath()
getSourceXPath
in interface Unmarshaller
public java.lang.Object getObject()
getObject
in interface Unmarshaller
public void setObject(java.lang.Object object)
setObject
in interface Unmarshaller
public void setObjectClass(java.lang.Class objectClass)
Unmarshaller
setObjectClass
in interface Unmarshaller
public java.lang.Class getObjectClass()
getObjectClass
in interface Unmarshaller
protected void setParentAndSource(Unmarshaller parent, XMLThing source)
public void engage()
Unmarshaller
engage
in interface Unmarshaller
public void disengage() throws java.lang.Exception
Unmarshaller
disengage
in interface Unmarshaller
java.lang.Exception
protected boolean isEngaged()
protected void disengaged() throws java.lang.Exception
java.lang.Exception
protected void addToParent() throws java.lang.Exception
java.lang.Exception
protected void referToThis() throws java.lang.Exception
java.lang.Exception
public void startObject(java.util.Map documentState, Unmarshaller parent, XMLThing source) throws java.lang.Exception
Unmarshaller
startObject
in interface Unmarshaller
java.lang.Exception
protected void startElement(Unmarshaller parent, XMLThing source) throws java.lang.Exception
java.lang.Exception
protected void endElement() throws java.lang.Exception
java.lang.Exception
protected void processAttributes(java.util.Map attributes) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object newObject() throws java.lang.Exception
java.lang.Exception
protected java.lang.String getXPath(Unmarshaller parent, XMLThing source)
protected java.lang.String getXName(XMLThing from, Prefixer prefixer)
protected java.lang.String toString(XMLThing from)
public java.lang.Class getChildClass(XMLThing childSource) throws java.lang.Exception
Unmarshaller
getChildClass
in interface Unmarshaller
java.lang.Exception
public void addChild(Unmarshaller child) throws java.lang.Exception
Unmarshaller
addChild
in interface Unmarshaller
java.lang.Exception
public void addValue(char[] from, int start, int length)
Unmarshaller
addValue
in interface Unmarshaller
protected void trim(java.lang.StringBuffer data)
protected void setValue(java.lang.StringBuffer data) throws java.lang.Exception
java.lang.Exception
public java.lang.Object endObject() throws java.lang.Exception
Unmarshaller
endObject
in interface Unmarshaller
java.lang.Exception
protected void afterEndObject() throws java.lang.Exception
java.lang.Exception
protected void reset()
protected java.util.Map getMap(java.util.Map map, java.lang.Object key)
public static void rethrow(java.lang.Throwable t) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |