Package com.db4o.reflect.generic
Class GenericClass
- java.lang.Object
-
- com.db4o.reflect.generic.GenericClass
-
- All Implemented Interfaces:
DeepClone,ReflectClass
- Direct Known Subclasses:
GenericArrayClass
public class GenericClass extends java.lang.Object implements ReflectClass, DeepClone
-
-
Field Summary
Fields Modifier and Type Field Description protected GenericConverter_converter
-
Constructor Summary
Constructors Constructor Description GenericClass(GenericReflector reflector, ReflectClass delegateClass, java.lang.String name, GenericClass superclass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenericClassarrayClass()java.lang.ObjectdeepClone(java.lang.Object obj)The parameter allows passing one new object so parent references can be corrected on children.booleanensureCanBeInstantiated()Calling this method may change the internal state of the class, even if a usable constructor has been found on earlier invocations.booleanequals(java.lang.Object obj)ReflectClassgetComponentType()ReflectFieldgetDeclaredField(java.lang.String name)ReflectField[]getDeclaredFields()ReflectClassgetDelegate()Returns the ReflectClass instance being delegated to.ReflectMethodgetMethod(java.lang.String methodName, ReflectClass[] paramClasses)java.lang.StringgetName()ReflectClassgetSuperclass()inthashCode()voidinitFields(GenericField[] fields)booleanisAbstract()booleanisArray()booleanisAssignableFrom(ReflectClass subclassCandidate)booleanisCollection()booleanisInstance(java.lang.Object candidate)booleanisInterface()booleanisPrimitive()booleanisSimple()We need this for replication, to find out if a class needs to be traversed or if it simply can be copied across.java.lang.ObjectnewInstance()java.lang.ObjectnullValue()Reflectorreflector()java.lang.StringtoString()java.lang.StringtoString(java.lang.Object obj)
-
-
-
Field Detail
-
_converter
protected GenericConverter _converter
-
-
Constructor Detail
-
GenericClass
public GenericClass(GenericReflector reflector, ReflectClass delegateClass, java.lang.String name, GenericClass superclass)
-
-
Method Detail
-
arrayClass
public GenericClass arrayClass()
-
deepClone
public java.lang.Object deepClone(java.lang.Object obj)
Description copied from interface:DeepCloneThe parameter allows passing one new object so parent references can be corrected on children.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getComponentType
public ReflectClass getComponentType()
- Specified by:
getComponentTypein interfaceReflectClass
-
getDeclaredField
public ReflectField getDeclaredField(java.lang.String name)
- Specified by:
getDeclaredFieldin interfaceReflectClass
-
getDeclaredFields
public ReflectField[] getDeclaredFields()
- Specified by:
getDeclaredFieldsin interfaceReflectClass
-
getDelegate
public ReflectClass getDelegate()
Description copied from interface:ReflectClassReturns the ReflectClass instance being delegated to. If there's no delegation it should return this.- Specified by:
getDelegatein interfaceReflectClass- Returns:
- delegate or this
-
getMethod
public ReflectMethod getMethod(java.lang.String methodName, ReflectClass[] paramClasses)
- Specified by:
getMethodin interfaceReflectClass
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceReflectClass
-
getSuperclass
public ReflectClass getSuperclass()
- Specified by:
getSuperclassin interfaceReflectClass
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
initFields
public void initFields(GenericField[] fields)
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstractin interfaceReflectClass
-
isArray
public boolean isArray()
- Specified by:
isArrayin interfaceReflectClass
-
isAssignableFrom
public boolean isAssignableFrom(ReflectClass subclassCandidate)
- Specified by:
isAssignableFromin interfaceReflectClass
-
isCollection
public boolean isCollection()
- Specified by:
isCollectionin interfaceReflectClass
-
isInstance
public boolean isInstance(java.lang.Object candidate)
- Specified by:
isInstancein interfaceReflectClass
-
isInterface
public boolean isInterface()
- Specified by:
isInterfacein interfaceReflectClass
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitivein interfaceReflectClass
-
newInstance
public java.lang.Object newInstance()
- Specified by:
newInstancein interfaceReflectClass
-
reflector
public Reflector reflector()
- Specified by:
reflectorin interfaceReflectClass
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toString
public java.lang.String toString(java.lang.Object obj)
-
ensureCanBeInstantiated
public boolean ensureCanBeInstantiated()
Description copied from interface:ReflectClassCalling this method may change the internal state of the class, even if a usable constructor has been found on earlier invocations.- Specified by:
ensureCanBeInstantiatedin interfaceReflectClass- Returns:
- true, if instances of this class can be created, false otherwise
-
nullValue
public java.lang.Object nullValue()
- Specified by:
nullValuein interfaceReflectClass
-
isSimple
public boolean isSimple()
Description copied from interface:ReflectClassWe need this for replication, to find out if a class needs to be traversed or if it simply can be copied across. For now we will simply return the classes that areReflectClass.isPrimitive()andPlatform4.isSimple(Class)We can think about letting users add an Immutable annotation.- Specified by:
isSimplein interfaceReflectClass
-
-