Class FlatXmlUnmarshaller.HandlerImpl
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- net.officefloor.plugin.xml.unmarshall.flat.FlatXmlUnmarshaller.HandlerImpl
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
- Enclosing class:
- FlatXmlUnmarshaller
protected static class FlatXmlUnmarshaller.HandlerImpl extends org.xml.sax.helpers.DefaultHandler
Handler to load XML values onto target object.
-
-
Field Summary
Fields Modifier and Type Field Description protected static char
ATTRIBUTE_SEPARATOR
Separator of the attribute and element name for loading.protected java.lang.String
elementValue
Element value.protected FlatXmlUnmarshallerMetaData
metaData
Meta-data to load the target object.protected java.lang.Object
targetObject
Target object to load XML values on.
-
Constructor Summary
Constructors Constructor Description HandlerImpl(FlatXmlUnmarshallerMetaData metaData)
Initiate with meta-data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
Handles obtain the value for the element.void
endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
Handles loading the value onto the target value.void
setTargetObject(java.lang.Object targetObject)
Sets the target object.void
startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
Handles loading the attribute value on the target value.
-
-
-
Field Detail
-
ATTRIBUTE_SEPARATOR
protected static final char ATTRIBUTE_SEPARATOR
Separator of the attribute and element name for loading.- See Also:
- Constant Field Values
-
metaData
protected final FlatXmlUnmarshallerMetaData metaData
Meta-data to load the target object.
-
targetObject
protected java.lang.Object targetObject
Target object to load XML values on.
-
elementValue
protected java.lang.String elementValue
Element value.
-
-
Constructor Detail
-
HandlerImpl
public HandlerImpl(FlatXmlUnmarshallerMetaData metaData)
Initiate with meta-data.- Parameters:
metaData
- Meta-data for unmarshalling the XML.
-
-
Method Detail
-
setTargetObject
public void setTargetObject(java.lang.Object targetObject)
Sets the target object.- Parameters:
targetObject
- Target object to have values loaded to it.
-
startElement
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
Handles loading the attribute value on the target value.- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
Handles obtain the value for the element.- Specified by:
characters
in interfaceorg.xml.sax.ContentHandler
- Overrides:
characters
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
Handles loading the value onto the target value.- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
-