net.sf.jsefa.common.mapping
Class NodeMapping<D,N extends NodeDescriptor<?>>

java.lang.Object
  extended by net.sf.jsefa.common.mapping.NodeMapping<D,N>
Type Parameters:
D - the type of the data type name
N - 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

Constructor Summary
NodeMapping(D dataTypeName, N nodeDescriptor, Class<?> objectType, FieldDescriptor fieldDescriptor, Validator validator)
          Constructs a new NodeMapping.
 
Method Summary
 D getDataTypeName()
           
 FieldDescriptor getFieldDescriptor()
           
 N getNodeDescriptor()
           
 Class<?> getObjectType()
           
 Validator getValidator()
           
 boolean isIndirectMapping()
          Signals if this is an indirect mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeMapping

public NodeMapping(D dataTypeName,
                   N nodeDescriptor,
                   Class<?> objectType,
                   FieldDescriptor fieldDescriptor,
                   Validator validator)
Constructs a new NodeMapping.

Parameters:
dataTypeName - the data type name
nodeDescriptor - the node descriptor
objectType - the object type
fieldDescriptor - the field descriptor
validator - the validator; may be null
Method Detail

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.