Package org.jibx.extras
Class DomMapperBase
- java.lang.Object
-
- org.jibx.extras.DocumentModelMapperBase
-
- org.jibx.extras.DomMapperBase
-
- Direct Known Subclasses:
DomElementMapper,DomFragmentMapper,DomListMapper
public class DomMapperBase extends DocumentModelMapperBase
Base implementation for custom marshaller/unmarshallers to DOM representation. This provides the basic code used for both single element and content list handling.
- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_defaultNamespaceIndexCurrent default namespace index.protected Stringm_defaultNamespaceURICurrent default namespace URI (nullif not determined).protected Documentm_documentActual document instance (required by DOM).-
Fields inherited from class org.jibx.extras.DocumentModelMapperBase
m_unmarshalContext, m_xmlWriter, XML_NAMESPACE, XMLNS_NAMESPACE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDomMapperBase()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidmarshalContent(NodeList content)Marshal node list.protected voidmarshalElement(Element element)Marshal element with all attributes and content.protected voidmarshalNode(Node node)Marshal node.protected voidunmarshalContent(Node parent)Unmarshal node content.protected ElementunmarshalElement()Unmarshal element with all attributes and content.protected NodeunmarshalNode()Unmarshal single node.-
Methods inherited from class org.jibx.extras.DocumentModelMapperBase
accumulateText, getNamespaceUri, getNextNamespaceIndex, isWhitespace
-
-
-
-
Field Detail
-
m_document
protected Document m_document
Actual document instance (required by DOM).
-
m_defaultNamespaceURI
protected String m_defaultNamespaceURI
Current default namespace URI (nullif not determined).
-
m_defaultNamespaceIndex
protected int m_defaultNamespaceIndex
Current default namespace index.
-
-
Method Detail
-
marshalNode
protected void marshalNode(Node node) throws org.jibx.runtime.JiBXException, IOException
Marshal node.- Parameters:
node- node to be marshalled- Throws:
org.jibx.runtime.JiBXException- on error in marshallingIOException- on error writing to output
-
marshalContent
protected void marshalContent(NodeList content) throws org.jibx.runtime.JiBXException, IOException
Marshal node list.- Parameters:
content- list of nodes to marshal- Throws:
org.jibx.runtime.JiBXException- on error in marshallingIOException- on error writing to output
-
marshalElement
protected void marshalElement(Element element) throws org.jibx.runtime.JiBXException, IOException
Marshal element with all attributes and content.- Parameters:
element- element to be marshalled- Throws:
org.jibx.runtime.JiBXException- on error in marshallingIOException- on error writing to output
-
unmarshalNode
protected Node unmarshalNode() throws org.jibx.runtime.JiBXException, IOException
Unmarshal single node. This unmarshals the next node from the input stream, up to the close tag of the containing element.- Returns:
- unmarshalled node
- Throws:
org.jibx.runtime.JiBXException- on error in unmarshallingIOException- on error reading input
-
unmarshalContent
protected void unmarshalContent(Node parent) throws org.jibx.runtime.JiBXException, IOException
Unmarshal node content. This unmarshals everything up to the containing element close tag, adding each component to the content list supplied. On return, the parse position will always be at an END_TAG.- Parameters:
parent- node to which children are to be added- Throws:
org.jibx.runtime.JiBXException- on error in unmarshallingIOException- on error reading input
-
unmarshalElement
protected Element unmarshalElement() throws org.jibx.runtime.JiBXException, IOException
Unmarshal element with all attributes and content. This must be called with the unmarshalling context positioned at a START_TAG event.- Returns:
- unmarshalled element
- Throws:
org.jibx.runtime.JiBXException- on error in unmarshallingIOException- on error reading input
-
-