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 GenericClass
arrayClass()
java.lang.Object
deepClone(java.lang.Object obj)
The parameter allows passing one new object so parent references can be corrected on children.boolean
ensureCanBeInstantiated()
Calling this method may change the internal state of the class, even if a usable constructor has been found on earlier invocations.boolean
equals(java.lang.Object obj)
ReflectClass
getComponentType()
ReflectField
getDeclaredField(java.lang.String name)
ReflectField[]
getDeclaredFields()
ReflectClass
getDelegate()
Returns the ReflectClass instance being delegated to.ReflectMethod
getMethod(java.lang.String methodName, ReflectClass[] paramClasses)
java.lang.String
getName()
ReflectClass
getSuperclass()
int
hashCode()
void
initFields(GenericField[] fields)
boolean
isAbstract()
boolean
isArray()
boolean
isAssignableFrom(ReflectClass subclassCandidate)
boolean
isCollection()
boolean
isInstance(java.lang.Object candidate)
boolean
isInterface()
boolean
isPrimitive()
boolean
isSimple()
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.Object
newInstance()
java.lang.Object
nullValue()
Reflector
reflector()
java.lang.String
toString()
java.lang.String
toString(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:DeepClone
The parameter allows passing one new object so parent references can be corrected on children.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getComponentType
public ReflectClass getComponentType()
- Specified by:
getComponentType
in interfaceReflectClass
-
getDeclaredField
public ReflectField getDeclaredField(java.lang.String name)
- Specified by:
getDeclaredField
in interfaceReflectClass
-
getDeclaredFields
public ReflectField[] getDeclaredFields()
- Specified by:
getDeclaredFields
in interfaceReflectClass
-
getDelegate
public ReflectClass getDelegate()
Description copied from interface:ReflectClass
Returns the ReflectClass instance being delegated to. If there's no delegation it should return this.- Specified by:
getDelegate
in interfaceReflectClass
- Returns:
- delegate or this
-
getMethod
public ReflectMethod getMethod(java.lang.String methodName, ReflectClass[] paramClasses)
- Specified by:
getMethod
in interfaceReflectClass
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceReflectClass
-
getSuperclass
public ReflectClass getSuperclass()
- Specified by:
getSuperclass
in interfaceReflectClass
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
initFields
public void initFields(GenericField[] fields)
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstract
in interfaceReflectClass
-
isArray
public boolean isArray()
- Specified by:
isArray
in interfaceReflectClass
-
isAssignableFrom
public boolean isAssignableFrom(ReflectClass subclassCandidate)
- Specified by:
isAssignableFrom
in interfaceReflectClass
-
isCollection
public boolean isCollection()
- Specified by:
isCollection
in interfaceReflectClass
-
isInstance
public boolean isInstance(java.lang.Object candidate)
- Specified by:
isInstance
in interfaceReflectClass
-
isInterface
public boolean isInterface()
- Specified by:
isInterface
in interfaceReflectClass
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitive
in interfaceReflectClass
-
newInstance
public java.lang.Object newInstance()
- Specified by:
newInstance
in interfaceReflectClass
-
reflector
public Reflector reflector()
- Specified by:
reflector
in interfaceReflectClass
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toString
public java.lang.String toString(java.lang.Object obj)
-
ensureCanBeInstantiated
public boolean ensureCanBeInstantiated()
Description copied from interface:ReflectClass
Calling this method may change the internal state of the class, even if a usable constructor has been found on earlier invocations.- Specified by:
ensureCanBeInstantiated
in interfaceReflectClass
- Returns:
- true, if instances of this class can be created, false otherwise
-
nullValue
public java.lang.Object nullValue()
- Specified by:
nullValue
in interfaceReflectClass
-
isSimple
public boolean isSimple()
Description copied from interface:ReflectClass
We 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:
isSimple
in interfaceReflectClass
-
-