Save This Page
Home » jdo2-model-2.3-ea-src » org.apache.jdo.impl.model.java » [javadoc | source]
org.apache.jdo.impl.model.java
public class: BaseReflectionJavaField [javadoc | source]
java.lang.Object
   org.apache.jdo.impl.model.java.AbstractJavaMember
      org.apache.jdo.impl.model.java.BaseReflectionJavaField

All Implemented Interfaces:
    JavaField, JavaMember

Direct Known Subclasses:
    ReflectionJavaField

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.

Field Summary
protected  JavaType type    The type of the field. 
Constructor:
 protected BaseReflectionJavaField(Field field,
    JavaType declaringClass) 
    Constructor taking a reflection field representation. The specifie field must not be null.
    Parameters:
    field - the java.lang.reflect.Field instance
    declaringClass - the JavaType of the declaring class or interface.
 protected BaseReflectionJavaField(String fieldName,
    JavaType declaringClass) 
    Constructor taking the field name. This constructor allows lazy initialization of the field reference.
    Parameters:
    fieldName - the name of the field.
    declaringClass - the JavaType of the declaring class or interface.
Method from org.apache.jdo.impl.model.java.BaseReflectionJavaField Summary:
ensureInitializedField,   getDeclaredFieldPrivileged,   getDeclaredFieldsPrivileged,   getField,   getModifiers,   getType,   getUnderlyingObject
Methods from org.apache.jdo.impl.model.java.AbstractJavaMember:
equals,   getComponentType,   getDeclaringClass,   getModifiers,   getName,   getType,   hashCode,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jdo.impl.model.java.BaseReflectionJavaField Detail:
 protected  void ensureInitializedField() 
    This method makes sure the reflection field is set.
 public static Field getDeclaredFieldPrivileged(Class clazz,
    String fieldName) 
    Helper method to retrieve the java.lang.reflect.Field for the specified field name.
 public static Field[] getDeclaredFieldsPrivileged(Class clazz) 
    Helper method to retrieve the declared java.lang.reflect.Field instances for the specified class.
 protected Field getField() 
    Returns the java.lang.reflect.Field that is wrapped by this JavaField.
 public int getModifiers() 
    Returns the Java language modifiers for the field represented by this JavaField, as an integer. The java.lang.reflect.Modifier class should be used to decode the modifiers.
 public JavaType getType() 
    Returns the JavaType representation of the field type.
 public Object getUnderlyingObject() 
    Returns the environment specific instance wrapped by this JavaModel element. This implementation returns the java.lang.reflect.Field instance for this JavaField.