|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.model.java.AbstractJavaField
org.apache.jdo.impl.model.java.BaseReflectionJavaField
public class BaseReflectionJavaField
This class provides a basic JavaField implementation using a reflection
Field instance. The implementation supports lazy initialization of the
wrapped reflection field instance (see
BaseReflectionJavaField(String fieldName, JavaType declaringClass)
.
Note, this implementation is not connected to a JavaModelFactory, thus it can only support predefined types as field types.
PredefinedType
Field Summary | |
---|---|
protected JavaType |
type
The type of the field. |
Constructor Summary | |
---|---|
protected |
BaseReflectionJavaField(java.lang.reflect.Field field,
JavaType declaringClass)
Constructor taking a reflection field representation. |
protected |
BaseReflectionJavaField(java.lang.String fieldName,
JavaType declaringClass)
Constructor taking the field name. |
Method Summary | |
---|---|
protected void |
ensureInitializedField()
This method makes sure the reflection field is set. |
static java.lang.reflect.Field |
getDeclaredFieldPrivileged(java.lang.Class clazz,
java.lang.String fieldName)
Helper method to retrieve the java.lang.reflect.Field for this JavaField. |
protected java.lang.reflect.Field |
getField()
Returns the java.lang.reflect.Field that is wrapped by this JavaField. |
int |
getModifiers()
Returns the Java language modifiers for the field represented by this JavaField, as an integer. |
JavaType |
getType()
Returns the JavaType representation of the field type. |
Methods inherited from class org.apache.jdo.impl.model.java.AbstractJavaField |
---|
equals, getDeclaringClass, getJDOField, getName, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected JavaType type
Constructor Detail |
---|
protected BaseReflectionJavaField(java.lang.reflect.Field field, JavaType declaringClass)
null
.
field
- the java.lang.reflect.Field instancedeclaringClass
- the JavaType of the declaring class or interface.protected BaseReflectionJavaField(java.lang.String fieldName, JavaType declaringClass)
fieldName
- the name of the field.declaringClass
- the JavaType of the declaring class or interface.Method Detail |
---|
public int getModifiers()
getModifiers
in interface JavaField
getModifiers
in class AbstractJavaField
Modifier
public JavaType getType()
getType
in interface JavaField
getType
in class AbstractJavaField
protected java.lang.reflect.Field getField()
public static java.lang.reflect.Field getDeclaredFieldPrivileged(java.lang.Class clazz, java.lang.String fieldName)
clazz
- the Class instance of the declaring class or interfacefieldName
- the field nameprotected void ensureInitializedField()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |