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 JdkFieldcreateField(java.lang.reflect.Field field)booleanensureCanBeInstantiated()Calling this method may change the internal state of the class, even if a usable constructor has been found on earlier invocations.ReflectClassgetComponentType()ReflectFieldgetDeclaredField(java.lang.String name)ReflectField[]getDeclaredFields()ReflectClassgetDelegate()Returns the ReflectClass instance being delegated to.java.lang.Class<?>getJavaClass()ReflectMethodgetMethod(java.lang.String methodName, ReflectClass[] paramClasses)java.lang.StringgetName()ReflectConstructorgetSerializableConstructor()ReflectClassgetSuperclass()booleanisAbstract()booleanisArray()booleanisAssignableFrom(ReflectClass type)booleanisCollection()booleanisInstance(java.lang.Object obj)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()
-
-
-
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:
getComponentTypein interfaceReflectClass
-
getDeclaredField
public ReflectField getDeclaredField(java.lang.String name)
- Specified by:
getDeclaredFieldin interfaceReflectClass
-
createField
protected JdkField createField(java.lang.reflect.Field field)
-
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
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstractin interfaceReflectClass
-
isArray
public boolean isArray()
- Specified by:
isArrayin interfaceReflectClass
-
isAssignableFrom
public boolean isAssignableFrom(ReflectClass type)
- Specified by:
isAssignableFromin interfaceReflectClass
-
isCollection
public boolean isCollection()
- Specified by:
isCollectionin interfaceReflectClass
-
isInstance
public boolean isInstance(java.lang.Object obj)
- 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
-
getJavaClass
public java.lang.Class<?> getJavaClass()
- Specified by:
getJavaClassin interfaceJavaReflectClass
-
reflector
public Reflector reflector()
- Specified by:
reflectorin interfaceReflectClass
-
getSerializableConstructor
public ReflectConstructor getSerializableConstructor()
- Specified by:
getSerializableConstructorin interfaceConstructorAwareReflectClass
-
nullValue
public java.lang.Object nullValue()
- Specified by:
nullValuein interfaceReflectClass
-
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
-
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
-
-