org.hypergraphdb.type
Class DefaultJavaTypeMapper

java.lang.Object
  extended by org.hypergraphdb.type.DefaultJavaTypeMapper
All Implemented Interfaces:
HGGraphHolder, JavaTypeMapper

public class DefaultJavaTypeMapper
extends java.lang.Object
implements JavaTypeMapper


Constructor Summary
DefaultJavaTypeMapper()
           
 
Method Summary
 HGAtomType defineHGType(java.lang.Class<?> javaClass, HGHandle typeHandle)
           Create a new HyperGraphDB type for the given Java class.
 HGAtomType getJavaBinding(HGHandle typeHandle, HGAtomType hgType, java.lang.Class<?> javaClass)
           Create a type wrapper for a given raw HyperGraphDB type.
 void setHyperGraph(HyperGraph graph)
          During load time, set the HyperGraph instance to which this atom belongs.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultJavaTypeMapper

public DefaultJavaTypeMapper()
Method Detail

defineHGType

public HGAtomType defineHGType(java.lang.Class<?> javaClass,
                               HGHandle typeHandle)
Description copied from interface: JavaTypeMapper

Create a new HyperGraphDB type for the given Java class. The HGHandle of the type pre-created and provided as a parameter.

This method should return a brand new HGAtomType that will subsequently be saved as a type atom with handle typeHandle and associated with the javaClass class.

Specified by:
defineHGType in interface JavaTypeMapper
Returns:

getJavaBinding

public HGAtomType getJavaBinding(HGHandle typeHandle,
                                 HGAtomType hgType,
                                 java.lang.Class<?> javaClass)
Description copied from interface: JavaTypeMapper

Create a type wrapper for a given raw HyperGraphDB type. The type wrapper should work with the regular Java runtime instance of an atom and use the underlying HG type for actual storage and retrieval.

Specified by:
getJavaBinding in interface JavaTypeMapper
Returns:

setHyperGraph

public void setHyperGraph(HyperGraph graph)
Description copied from interface: HGGraphHolder

During load time, set the HyperGraph instance to which this atom belongs.

Specified by:
setHyperGraph in interface HGGraphHolder