org.neodatis.odb.impl.core.layers.layer1.introspector
Class LocalObjectIntrospector

java.lang.Object
  extended by org.neodatis.odb.impl.core.layers.layer1.introspector.LocalObjectIntrospector
All Implemented Interfaces:
IObjectIntrospector
Direct Known Subclasses:
ClientObjectIntrospector, ServerObjectIntrospector

public class LocalObjectIntrospector
extends java.lang.Object
implements IObjectIntrospector

The local implementation of the Object Instrospector.

Author:
osmadja

Field Summary
protected  IClassIntrospector classIntrospector
           
protected  IStorageEngine storageEngine
           
 
Constructor Summary
LocalObjectIntrospector(IStorageEngine storageEngine)
           
 
Method Summary
 NonNativeObjectInfo buildNnoi(java.lang.Object object, ClassInfo classInfo, AbstractObjectInfo[] values, long[] attributesIdentification, int[] attributeIds, java.util.Map<java.lang.Object,NonNativeObjectInfo> alreadyReadObjects)
           
 void clear()
           
 IClassIntrospector getClassIntrospector()
           
 AbstractObjectInfo getMetaRepresentation(java.lang.Object object, ClassInfo ci, boolean recursive, java.util.Map<java.lang.Object,NonNativeObjectInfo> alreadyReadObjects, IIntrospectionCallback callback)
          retrieve object data
protected  AbstractObjectInfo getNativeObjectInfoInternal(ODBType type, java.lang.Object object, boolean recursive, java.util.Map<java.lang.Object,NonNativeObjectInfo> alreadyReadObjects, IIntrospectionCallback callback)
           
protected  AbstractObjectInfo getObjectInfo(java.lang.Object object, ClassInfo ci, boolean recursive, java.util.Map<java.lang.Object,NonNativeObjectInfo> alreadyReadObjects, IIntrospectionCallback callback)
          retrieve object data
protected  AbstractObjectInfo getObjectInfoInternal(AbstractObjectInfo nnoi, java.lang.Object object, ClassInfo ci, boolean recursive, java.util.Map<java.lang.Object,NonNativeObjectInfo> alreadyReadObjects, IIntrospectionCallback callback)
          Build a meta representation of an object
 boolean objectHasChanged(java.lang.Object object)
          Used when byte code instrumentation is to check if an object has changed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

storageEngine

protected IStorageEngine storageEngine

classIntrospector

protected IClassIntrospector classIntrospector
Constructor Detail

LocalObjectIntrospector

public LocalObjectIntrospector(IStorageEngine storageEngine)
Method Detail

getMetaRepresentation

public AbstractObjectInfo getMetaRepresentation(java.lang.Object object,
                                                ClassInfo ci,
                                                boolean recursive,
                                                java.util.Map<java.lang.Object,NonNativeObjectInfo> alreadyReadObjects,
                                                IIntrospectionCallback callback)
Description copied from interface: IObjectIntrospector
retrieve object data

Specified by:
getMetaRepresentation in interface IObjectIntrospector
Parameters:
object - The object to get meta representation
ci - The ClassInfo
recursive - To indicate that introspection must be recursive
alreadyReadObjects - A map with already read object, to avoid cyclic reference problem
Returns:
The object info

getObjectInfo

protected AbstractObjectInfo getObjectInfo(java.lang.Object object,
                                           ClassInfo ci,
                                           boolean recursive,
                                           java.util.Map<java.lang.Object,NonNativeObjectInfo> alreadyReadObjects,
                                           IIntrospectionCallback callback)
retrieve object data

Parameters:
object -
ci -
recursive -
Returns:
The object info

getNativeObjectInfoInternal

protected AbstractObjectInfo getNativeObjectInfoInternal(ODBType type,
                                                         java.lang.Object object,
                                                         boolean recursive,
                                                         java.util.Map<java.lang.Object,NonNativeObjectInfo> alreadyReadObjects,
                                                         IIntrospectionCallback callback)

getObjectInfoInternal

protected AbstractObjectInfo getObjectInfoInternal(AbstractObjectInfo nnoi,
                                                   java.lang.Object object,
                                                   ClassInfo ci,
                                                   boolean recursive,
                                                   java.util.Map<java.lang.Object,NonNativeObjectInfo> alreadyReadObjects,
                                                   IIntrospectionCallback callback)
Build a meta representation of an object
 warning: When an object has two fields with the same name (a private field with the same name in a parent class, the deeper field (of the parent) is ignored!)
 

Parameters:
object -
ci -
recursive -
Returns:
The ObjectInfo

buildNnoi

public NonNativeObjectInfo buildNnoi(java.lang.Object object,
                                     ClassInfo classInfo,
                                     AbstractObjectInfo[] values,
                                     long[] attributesIdentification,
                                     int[] attributeIds,
                                     java.util.Map<java.lang.Object,NonNativeObjectInfo> alreadyReadObjects)
Specified by:
buildNnoi in interface IObjectIntrospector

objectHasChanged

public boolean objectHasChanged(java.lang.Object object)
Used when byte code instrumentation is to check if an object has changed

Parameters:
object -
Returns:

clear

public void clear()
Specified by:
clear in interface IObjectIntrospector

getClassIntrospector

public IClassIntrospector getClassIntrospector()
Specified by:
getClassIntrospector in interface IObjectIntrospector