net.sf.jsefa.common.mapping
Class NodeMapping<D,N extends NodeDescriptor<?>>
java.lang.Object
net.sf.jsefa.common.mapping.NodeMapping<D,N>
- Type Parameters:
D
- the type of the data type nameN
- the type of the node descriptor
- Direct Known Subclasses:
- RbfNodeMapping, XmlNodeMapping
public abstract class NodeMapping<D,N extends NodeDescriptor<?>>
- extends Object
A mapping between a node of the specific format and a java object. This mapping is used for serialization and
deserialization.
A node mapping consists of
1. a data type name: the name of the data type of this node or - if isIndirectMapping()
- of its
virtual parent node
2. an object type: the type of the java object this mapping is for
3. a field descriptor: describes the java object field the node maps to
4. a node descriptor: describes the node the java object maps to
5. a validator: optional
- Author:
- Norman Lahme-Huetig
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NodeMapping
public NodeMapping(D dataTypeName,
N nodeDescriptor,
Class<?> objectType,
FieldDescriptor fieldDescriptor,
Validator validator)
- Constructs a new
NodeMapping
.
- Parameters:
dataTypeName
- the data type namenodeDescriptor
- the node descriptorobjectType
- the object typefieldDescriptor
- the field descriptorvalidator
- the validator; may be null
getDataTypeName
public final D getDataTypeName()
- Returns:
- the data type name
getNodeDescriptor
public final N getNodeDescriptor()
- Returns:
- the node descriptor
getObjectType
public final Class<?> getObjectType()
- Returns:
- the object type
getFieldDescriptor
public final FieldDescriptor getFieldDescriptor()
- Returns:
- the field descriptor
getValidator
public final Validator getValidator()
- Returns:
- the validator
isIndirectMapping
public boolean isIndirectMapping()
- 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.
- Returns:
- true, if this is an indirect mapping; false otherwise.
Copyright © 2014. All rights reserved.