Package org.jibx.extras
Class Dom4JMapperBase
- java.lang.Object
-
- org.jibx.extras.DocumentModelMapperBase
-
- org.jibx.extras.Dom4JMapperBase
-
- Direct Known Subclasses:
Dom4JElementMapper,Dom4JListMapper
public class Dom4JMapperBase extends DocumentModelMapperBase
Base implementation for custom marshaller/unmarshallers to dom4j representation. This provides the basic code used for both single element and content list handling.
- Version:
- 1.0
- 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).-
Fields inherited from class org.jibx.extras.DocumentModelMapperBase
m_unmarshalContext, m_xmlWriter, XML_NAMESPACE, XMLNS_NAMESPACE
-
-
Constructor Summary
Constructors Constructor Description Dom4JMapperBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidmarshalContent(List content)Marshal content list.protected voidmarshalElement(org.dom4j.Element element)Marshal element with all attributes and content.protected voidunmarshalContent(List content)Unmarshal element content.protected org.dom4j.ElementunmarshalElement()Unmarshal element with all attributes and content.-
Methods inherited from class org.jibx.extras.DocumentModelMapperBase
accumulateText, getNamespaceUri, getNextNamespaceIndex, isWhitespace
-
-
-
-
Field Detail
-
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
-
marshalContent
protected void marshalContent(List content) throws org.jibx.runtime.JiBXException, IOException
Marshal content list.- Parameters:
content- list of content items to marshal- Throws:
org.jibx.runtime.JiBXException- on error in marshallingIOException- on error writing to output
-
marshalElement
protected void marshalElement(org.dom4j.Element element) throws org.jibx.runtime.JiBXException, IOExceptionMarshal 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
-
unmarshalContent
protected void unmarshalContent(List content) throws org.jibx.runtime.JiBXException, IOException
Unmarshal element 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:
content- list for unmarshalled content- Throws:
org.jibx.runtime.JiBXException- on error in unmarshallingIOException- on error reading input
-
unmarshalElement
protected org.dom4j.Element unmarshalElement() throws org.jibx.runtime.JiBXException, IOExceptionUnmarshal 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
-
-