public class JavaObjectMapper extends Object implements JavaTypeMapper
| Modifier and Type | Field and Description |
|---|---|
protected HashSet<String> |
classes |
protected HyperGraph |
graph |
protected HGIndex<String,HGPersistentHandle> |
idx |
protected HGHandle |
superSlot |
| Constructor and Description |
|---|
JavaObjectMapper() |
| Modifier and Type | Method and Description |
|---|---|
void |
addClass(Class<?> c) |
void |
addClass(String classname) |
protected boolean |
checkClass(Class<?> javaClass) |
HGAtomType |
defineHGType(Class<?> javaClass,
HGHandle typeHandle)
Create a new HyperGraphDB type for the given Java class.
|
protected HGIndex<String,HGPersistentHandle> |
getIndex() |
HGAtomType |
getJavaBinding(HGHandle typeHandle,
HGAtomType hgType,
Class<?> javaClass)
Create a type wrapper for a given raw HyperGraphDB type.
|
HGHandle |
getSuperSlot() |
protected void |
initClasses() |
protected boolean |
mapAsSerializableObject(Class<?> javaClass) |
void |
setHyperGraph(HyperGraph graph)
During load time, set the
HyperGraph
instance to which this atom belongs. |
protected HyperGraph graph
protected HGHandle superSlot
protected HGIndex<String,HGPersistentHandle> idx
protected HGIndex<String,HGPersistentHandle> getIndex()
public HGHandle getSuperSlot()
protected void initClasses()
protected boolean checkClass(Class<?> javaClass)
protected boolean mapAsSerializableObject(Class<?> javaClass)
public void setHyperGraph(HyperGraph graph)
HGGraphHolderDuring load time, set the HyperGraph
instance to which this atom belongs.
setHyperGraph in interface HGGraphHolderpublic HGAtomType defineHGType(Class<?> javaClass, HGHandle typeHandle)
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. The method should return null in
case it cannot (or it determines that it should not) create a HGAtomType.
In the case the JavaTypeFactory will move on to try the next of the registered
type mappers.
defineHGType in interface JavaTypeMapperHGAtomType corresponding to the passed in Java
class or null if such a type could not be created.public HGAtomType getJavaBinding(HGHandle typeHandle, HGAtomType hgType, Class<?> javaClass)
JavaTypeMapperCreate 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.
getJavaBinding in interface JavaTypeMappertypeHandle - The handle of the type being wrapped.hgType - The HyperGraphDB type instance to be wrappedjavaClass - The Java class corresponding to this HyperGraphDB type.null ifpublic void addClass(Class<?> c)
public void addClass(String classname)
Copyright © 2015. All rights reserved.