public class BaseReflectionJavaField extends AbstractJavaField
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
Modifier and Type | Field and Description |
---|---|
protected JavaType |
type
The type of the field.
|
Modifier | Constructor and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
equals, getDeclaringClass, getJDOField, getName, hashCode, toString
protected JavaType type
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.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()
Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.