Package com.db4o.reflect.jdk
Class JdkClass
- java.lang.Object
-
- com.db4o.reflect.jdk.JdkClass
-
- All Implemented Interfaces:
ConstructorAwareReflectClass
,JavaReflectClass
,ReflectClass
public class JdkClass extends java.lang.Object implements JavaReflectClass
Reflection implementation for Class to map to JDK reflection.
-
-
Field Summary
Fields Modifier and Type Field Description protected Reflector
_reflector
-
Constructor Summary
Constructors Constructor Description JdkClass(Reflector reflector, JdkReflector jdkReflector, java.lang.Class<?> clazz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JdkField
createField(java.lang.reflect.Field field)
boolean
ensureCanBeInstantiated()
Calling this method may change the internal state of the class, even if a usable constructor has been found on earlier invocations.ReflectClass
getComponentType()
ReflectField
getDeclaredField(java.lang.String name)
ReflectField[]
getDeclaredFields()
ReflectClass
getDelegate()
Returns the ReflectClass instance being delegated to.java.lang.Class<?>
getJavaClass()
ReflectMethod
getMethod(java.lang.String methodName, ReflectClass[] paramClasses)
java.lang.String
getName()
ReflectConstructor
getSerializableConstructor()
ReflectClass
getSuperclass()
boolean
isAbstract()
boolean
isArray()
boolean
isAssignableFrom(ReflectClass type)
boolean
isCollection()
boolean
isInstance(java.lang.Object obj)
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()
-
-
-
Field Detail
-
_reflector
protected final Reflector _reflector
-
-
Constructor Detail
-
JdkClass
public JdkClass(Reflector reflector, JdkReflector jdkReflector, java.lang.Class<?> clazz)
-
-
Method Detail
-
getComponentType
public ReflectClass getComponentType()
- Specified by:
getComponentType
in interfaceReflectClass
-
getDeclaredField
public ReflectField getDeclaredField(java.lang.String name)
- Specified by:
getDeclaredField
in interfaceReflectClass
-
createField
protected JdkField createField(java.lang.reflect.Field field)
-
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
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstract
in interfaceReflectClass
-
isArray
public boolean isArray()
- Specified by:
isArray
in interfaceReflectClass
-
isAssignableFrom
public boolean isAssignableFrom(ReflectClass type)
- Specified by:
isAssignableFrom
in interfaceReflectClass
-
isCollection
public boolean isCollection()
- Specified by:
isCollection
in interfaceReflectClass
-
isInstance
public boolean isInstance(java.lang.Object obj)
- 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
-
getJavaClass
public java.lang.Class<?> getJavaClass()
- Specified by:
getJavaClass
in interfaceJavaReflectClass
-
reflector
public Reflector reflector()
- Specified by:
reflector
in interfaceReflectClass
-
getSerializableConstructor
public ReflectConstructor getSerializableConstructor()
- Specified by:
getSerializableConstructor
in interfaceConstructorAwareReflectClass
-
nullValue
public java.lang.Object nullValue()
- Specified by:
nullValue
in interfaceReflectClass
-
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
-
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
-
-