net.sf.jsefa.xml.mapping
Class ElementMapping
java.lang.Object
net.sf.jsefa.common.mapping.NodeMapping<QName,T>
net.sf.jsefa.xml.mapping.XmlNodeMapping<ElementDescriptor>
net.sf.jsefa.xml.mapping.ElementMapping
public final class ElementMapping
- extends XmlNodeMapping<ElementDescriptor>
A mapping between an XML element node and a java object. This mapping is used for serialization and
deserialization.
Instances of this class are immutable and thread safe.
- Author:
- Norman Lahme-Huetig, Matthias Derer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ElementMapping
public ElementMapping(QName dataTypeName,
ElementDescriptor elementDescriptor,
Class<?> objectType,
FieldDescriptor fieldDescriptor,
Validator validator,
boolean elementNameIsAmbiguous,
TextMode textMode)
- Constructs a new
ElementMapping
.
- Parameters:
dataTypeName
- the name of the data type. This may be the data type name of the element node itself or
of its implicit parent node.elementDescriptor
- the descriptor of the elementobjectType
- the type of the object. May be different from the object type contained in the field
descriptor.fieldDescriptor
- the descriptor of the fieldvalidator
- the validator; may be nullelementNameIsAmbiguous
- true, if the name of the element in its given context (position in the xml
document) is ambiguous, i. e. there is sibling element with the same name; false otherwise.textMode
- defines the text mode in case of an element with text content (simple or not); may be
null
.
elementNameIsAmbiguous
public boolean elementNameIsAmbiguous()
- Returns:
- true, if the name of the element in its given context (position in the xml document) is ambiguous,
i. e. there is sibling element with the same name; false otherwise.
getTextMode
public TextMode getTextMode()
- Returns:
- the text mode if this element allows for text content or null.
isIndirectMapping
public boolean isIndirectMapping()
- Description copied from class:
NodeMapping
- Signals if this is an indirect mapping. This is the case if the data type name is not the one of this node
but of its virtual parent node instead.
- Overrides:
isIndirectMapping
in class NodeMapping<QName,ElementDescriptor>
- Returns:
- true, if the data type name is not the same as the one of the element descriptor; false otherwise.
Copyright © 2014. All rights reserved.