Package org.jibx.extras
Class Dom4JMapperBase
java.lang.Object
org.jibx.extras.DocumentModelMapperBase
org.jibx.extras.Dom4JMapperBase
- Direct Known Subclasses:
Dom4JElementMapper,Dom4JListMapper
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
FieldsModifier and TypeFieldDescriptionprotected intCurrent default namespace index.protected StringCurrent default namespace URI (nullif not determined).private static DocumentFactorydom4j component construction factory.Fields inherited from class org.jibx.extras.DocumentModelMapperBase
m_unmarshalContext, m_xmlWriter, XML_NAMESPACE, XMLNS_NAMESPACE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intfindNamespaceIndex(Namespace ns) Get index number for declared namespace.protected voidmarshalContent(List content) Marshal content list.protected voidmarshalElement(Element element) Marshal element with all attributes and content.protected voidunmarshalContent(List content) Unmarshal element content.protected ElementUnmarshal element with all attributes and content.Methods inherited from class org.jibx.extras.DocumentModelMapperBase
accumulateText, getNamespaceUri, getNextNamespaceIndex, isWhitespace
-
Field Details
-
s_factory
private static DocumentFactory s_factorydom4j component construction factory. -
m_defaultNamespaceURI
Current default namespace URI (nullif not determined). -
m_defaultNamespaceIndex
protected int m_defaultNamespaceIndexCurrent default namespace index.
-
-
Constructor Details
-
Dom4JMapperBase
public Dom4JMapperBase()
-
-
Method Details
-
findNamespaceIndex
private int findNamespaceIndex(Namespace ns) Get index number for declared namespace.- Parameters:
ns- namespace of interest- Returns:
- namespace index number, or
-1if not declared or masked
-
marshalContent
Marshal content list.- Parameters:
content- list of content items to marshal- Throws:
JiBXException- on error in marshallingIOException- on error writing to output
-
marshalElement
Marshal element with all attributes and content.- Parameters:
element- element to be marshalled- Throws:
JiBXException- on error in marshallingIOException- on error writing to output
-
unmarshalContent
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:
JiBXException- on error in unmarshallingIOException- on error reading input
-
unmarshalElement
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:
JiBXException- on error in unmarshallingIOException- on error reading input
-