|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neodatis.odb.impl.core.layers.layer1.introspector.AbstractClassIntrospector
public abstract class AbstractClassIntrospector
The ClassIntrospector is used to introspect classes. It uses Reflection to extract class information. It transforms a native Class into a ClassInfo (a meta representation of the class) that contains all informations about the class.
Constructor Summary | |
---|---|
AbstractClassIntrospector()
|
Method Summary | |
---|---|
protected void |
addConstructor(java.lang.String className,
java.lang.reflect.Constructor constructor)
|
void |
addFullInstanciationHelper(java.lang.Class clazz,
FullInstantiationHelper helper)
|
void |
addFullInstantiationHelper(java.lang.String clazz,
FullInstantiationHelper helper)
|
void |
addInstanciationHelper(java.lang.Class clazz,
InstantiationHelper helper)
|
void |
addInstantiationHelper(java.lang.String clazz,
InstantiationHelper helper)
|
void |
addParameterHelper(java.lang.Class clazz,
ParameterHelper helper)
|
void |
addParameterHelper(java.lang.String clazz,
ParameterHelper helper)
|
IOdbList<java.lang.reflect.Field> |
getAllFields(java.lang.String fullClassName)
|
byte |
getClassCategory(java.lang.String fullClassName)
|
ClassInfo |
getClassInfo(java.lang.String fullClassName,
ClassInfo existingClassInfo)
Builds a class info from a class and an existing class info |
java.lang.reflect.Constructor |
getConstructorOf(java.lang.String fullClassName)
|
java.lang.reflect.Field |
getField(java.lang.Class clazz,
java.lang.String fieldName)
|
java.util.List<java.lang.Class> |
getSuperClasses(java.lang.String fullClassName,
boolean includingThis)
|
void |
init2()
Two phase init method |
java.util.Map<java.lang.String,ClassInfo> |
instrospect(IOdbList<ClassInfo> classInfos)
introspect a list of classes This method return the current meta model based on the classes that currently exist in the execution classpath. |
ClassInfoList |
introspect(java.lang.Class clazz,
boolean recursive)
|
ClassInfoList |
introspect(java.lang.String fullClassName,
boolean recursive)
|
boolean |
isSystemClass(java.lang.String fullClassName)
|
java.lang.Object |
newFullInstanceOf(java.lang.Class clazz,
NonNativeObjectInfo nnoi)
|
java.lang.Object |
newInstanceOf(java.lang.Class clazz)
|
void |
persistFieldOfClass(java.lang.String className,
java.lang.String fieldName,
boolean yesNo)
To force persisting a field or to avoid a field from being persiste |
void |
removeFullInstantiationHelper(java.lang.Class clazz)
|
void |
removeFullInstantiationHelper(java.lang.String canonicalName)
|
void |
removeInstantiationHelper(java.lang.Class clazz)
|
void |
removeInstantiationHelper(java.lang.String canonicalName)
|
void |
removeParameterHelper(java.lang.Class clazz)
|
void |
removeParameterHelper(java.lang.String canonicalName)
|
IOdbList<java.lang.reflect.Field> |
removeUnnecessaryFields(java.lang.String className,
IOdbList<java.lang.reflect.Field> fields)
|
void |
reset()
|
protected abstract boolean |
tryToCreateAnEmptyConstructor(java.lang.Class clazz)
Tries to create a default constructor (with no parameter) for the class and stores it the constructor cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractClassIntrospector()
Method Detail |
---|
public void reset()
reset
in interface IClassIntrospector
public void init2()
init2
in interface ITwoPhaseInit
public void addInstanciationHelper(java.lang.Class clazz, InstantiationHelper helper)
addInstanciationHelper
in interface IClassIntrospector
public void addParameterHelper(java.lang.Class clazz, ParameterHelper helper)
addParameterHelper
in interface IClassIntrospector
public void addFullInstanciationHelper(java.lang.Class clazz, FullInstantiationHelper helper)
addFullInstanciationHelper
in interface IClassIntrospector
public void addInstantiationHelper(java.lang.String clazz, InstantiationHelper helper)
addInstantiationHelper
in interface IClassIntrospector
public void addParameterHelper(java.lang.String clazz, ParameterHelper helper)
addParameterHelper
in interface IClassIntrospector
public void addFullInstantiationHelper(java.lang.String clazz, FullInstantiationHelper helper)
addFullInstantiationHelper
in interface IClassIntrospector
public void removeInstantiationHelper(java.lang.Class clazz)
removeInstantiationHelper
in interface IClassIntrospector
public void removeInstantiationHelper(java.lang.String canonicalName)
removeInstantiationHelper
in interface IClassIntrospector
public void removeParameterHelper(java.lang.Class clazz)
removeParameterHelper
in interface IClassIntrospector
public void removeParameterHelper(java.lang.String canonicalName)
removeParameterHelper
in interface IClassIntrospector
public void removeFullInstantiationHelper(java.lang.Class clazz)
removeFullInstantiationHelper
in interface IClassIntrospector
public void removeFullInstantiationHelper(java.lang.String canonicalName)
removeFullInstantiationHelper
in interface IClassIntrospector
public ClassInfoList introspect(java.lang.Class clazz, boolean recursive)
introspect
in interface IClassIntrospector
clazz
- The class to instrospectrecursive
- If true, goes does the hierarchy to try to analyse all classes
public java.util.Map<java.lang.String,ClassInfo> instrospect(IOdbList<ClassInfo> classInfos)
instrospect
in interface IClassIntrospector
classInfos,
- the classinfo currently existng in the meta model
public ClassInfo getClassInfo(java.lang.String fullClassName, ClassInfo existingClassInfo)
IClassIntrospector
The existing class info is used to make sure that fields with the same name will have the same id
getClassInfo
in interface IClassIntrospector
fullClassName
- The name of the class to get info
public java.util.List<java.lang.Class> getSuperClasses(java.lang.String fullClassName, boolean includingThis)
getSuperClasses
in interface IClassIntrospector
public java.lang.reflect.Field getField(java.lang.Class clazz, java.lang.String fieldName)
getField
in interface IClassIntrospector
public IOdbList<java.lang.reflect.Field> getAllFields(java.lang.String fullClassName)
getAllFields
in interface IClassIntrospector
public IOdbList<java.lang.reflect.Field> removeUnnecessaryFields(java.lang.String className, IOdbList<java.lang.reflect.Field> fields)
removeUnnecessaryFields
in interface IClassIntrospector
public ClassInfoList introspect(java.lang.String fullClassName, boolean recursive)
introspect
in interface IClassIntrospector
public java.lang.reflect.Constructor getConstructorOf(java.lang.String fullClassName)
getConstructorOf
in interface IClassIntrospector
public java.lang.Object newFullInstanceOf(java.lang.Class clazz, NonNativeObjectInfo nnoi)
newFullInstanceOf
in interface IClassIntrospector
public java.lang.Object newInstanceOf(java.lang.Class clazz)
newInstanceOf
in interface IClassIntrospector
protected abstract boolean tryToCreateAnEmptyConstructor(java.lang.Class clazz)
clazz
-
public boolean isSystemClass(java.lang.String fullClassName)
isSystemClass
in interface IClassIntrospector
public byte getClassCategory(java.lang.String fullClassName)
getClassCategory
in interface IClassIntrospector
protected void addConstructor(java.lang.String className, java.lang.reflect.Constructor constructor)
public void persistFieldOfClass(java.lang.String className, java.lang.String fieldName, boolean yesNo)
IClassIntrospector
persistFieldOfClass
in interface IClassIntrospector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |