net.sf.jsefa.common.mapping
Class HierarchicalTypeMappingRegistry<T>

java.lang.Object
  extended by net.sf.jsefa.common.mapping.TypeMappingRegistry<T>
      extended by net.sf.jsefa.common.mapping.HierarchicalTypeMappingRegistry<T>
Type Parameters:
T - the type of the data type name
Direct Known Subclasses:
XmlTypeMappingRegistry

public abstract class HierarchicalTypeMappingRegistry<T>
extends TypeMappingRegistry<T>

A registry for TypeMappings with support for hierarchical relations between the data types.

Instances of this class are thread-safe. This must be true for all subclasses, too.

Author:
Norman Lahme-Huetig

Constructor Summary
  HierarchicalTypeMappingRegistry()
          Constructs a new HierarchicalTypeMappingRegistry.
protected HierarchicalTypeMappingRegistry(HierarchicalTypeMappingRegistry<T> other)
          Constructs a new HierarchicalTypeMappingRegistry as a copy of the given one.
 
Method Summary
 Collection<T> getDataTypeNameTreeElements(T rootDataTypeName)
          Returns a collection of all data type names which denote direct or indirect sub data types of the one denoted by rootDataTypeName.
 void registerSubtypeRelation(T superDataTypeName, T subDataTypeName)
          Registers a subtype relation between the data types denoted by the given names.
 
Methods inherited from class net.sf.jsefa.common.mapping.TypeMappingRegistry
createCopy, get, register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchicalTypeMappingRegistry

public HierarchicalTypeMappingRegistry()
Constructs a new HierarchicalTypeMappingRegistry.


HierarchicalTypeMappingRegistry

protected HierarchicalTypeMappingRegistry(HierarchicalTypeMappingRegistry<T> other)
Constructs a new HierarchicalTypeMappingRegistry as a copy of the given one.

Parameters:
other - the registry that serves as a model for creating a new one
Method Detail

registerSubtypeRelation

public final void registerSubtypeRelation(T superDataTypeName,
                                          T subDataTypeName)
Registers a subtype relation between the data types denoted by the given names.

Parameters:
superDataTypeName - the name of the super data type
subDataTypeName - the name of the sub data type

getDataTypeNameTreeElements

public final Collection<T> getDataTypeNameTreeElements(T rootDataTypeName)
Returns a collection of all data type names which denote direct or indirect sub data types of the one denoted by rootDataTypeName. The given root data type name is also included.

Parameters:
rootDataTypeName - the data type name denotig the root of the type hierarchy to retrieve.
Returns:
a collection of data type names including the root data type name


Copyright © 2014. All rights reserved.