org.apache.jdo.model.java
Interface JavaField

All Known Implementing Classes:
AbstractJavaField, BaseReflectionJavaField, ReflectionJavaField

public interface JavaField

A JavaField instance represents a field declared by a class. It allows to get detailed information about the field such as name, modifiers, type, declaring class and the JDO meta data for the field (if available).

Different environments (runtime, enhancer, development) will have different JavaType implementations to provide answers to the various methods.

Since:
JDO 1.0.1
Author:
Michael Bouschen

Method Summary
 JavaType getDeclaringClass()
          Returns the JavaType instance representing the class or interface that declares the field represented by this JavaField instance.
 JDOField getJDOField()
          Returns the corresponding JDOField instance, if the JDOModel provides any JDO metadata for the field represented by this JavaField.
 int getModifiers()
          Returns the Java language modifiers for the field represented by this JavaField, as an integer.
 java.lang.String getName()
          Returns the name of the field.
 JavaType getType()
          Returns the JavaType representation of the field type.
 

Method Detail

getName

java.lang.String getName()
Returns the name of the field.

Returns:
field name

getModifiers

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.

Returns:
the Java language modifiers for this JavaField
See Also:
Modifier

getType

JavaType getType()
Returns the JavaType representation of the field type.

Returns:
field type

getDeclaringClass

JavaType getDeclaringClass()
Returns the JavaType instance representing the class or interface that declares the field represented by this JavaField instance.

Returns:
the JavaType instance of the declaring class.

getJDOField

JDOField getJDOField()
Returns the corresponding JDOField instance, if the JDOModel provides any JDO metadata for the field represented by this JavaField. If there is no corresponding JDOField representation, the method returns null.

A null result means the declaring class is not persistence capable or the field represented by this JavaField is not managed. Note, a non-null result does not necessarily mean the field is managed. The JDO metadata might define the persistence-modifier of this field as none. Then the JDOModel provides a JDOField instance which is returned by this method. You can call method JDOField.isManaged() on a non-null result to verify that this JavaField represents a managed field.

Returns:
the corresponding JDOField instance (if available); null otherwise.


Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.