com.odi
Class Field

java.lang.Object
  extended bycom.odi.Field

public abstract class Field
extends Object

The Field class represents a Java field in a persistent object. Normally, you do not need to be concerned with this class. When you run the Class File Postprocessor after you compile your source files, the postprocessor annotates your class files to allow persistent storage. These annotations include references to the Field class.

Under exceptional circumstances, you might annotate your classes yourself. If you do then you must be familiar with the Field class.

The ClassField and ArrayField subtypes represent the reference and array composite types. The Field class provides a create method for each Java data type. There are separate create methods for singleton and array fields of each primitive type.

You should not create subclasses of the Field class.

Additional information about fields is in Chapter 9 of the API User Guide.


Method Summary
static Field createBoolean(String fieldName)
          Creates a Field object that can hold a single Boolean value.
static Field createBooleanArray(String fieldName, int dimensions)
          Creates a Field object that can hold an array of Boolean values.
static Field createByte(String fieldName)
          Creates a Field object that can hold a single byte.
static Field createByteArray(String fieldName, int dimensions)
          Creates a Field object that can hold an array of bytes.
static Field createChar(String fieldName)
          Creates a Field object that can hold a single character.
static Field createCharArray(String fieldName, int dimensions)
          Creates a Field object that can hold an array of characters.
static Field createClass(String fieldName, String className)
          Creates a Field object that can hold a reference to a class.
static Field createClassArray(String fieldName, String className, int dimensions)
          Creates a Field object that can hold an array of references to a class.
static Field createDouble(String fieldName)
          Creates a Field object that can hold a single 64-bit floating-point value.
static Field createDoubleArray(String fieldName, int dimensions)
          Creates a Field object that can hold an array of 64-bit floating-point values.
static Field createEmbeddedString(String fieldName, int maxSize)
          Creates a Field object that can hold an embedded string value.
static Field createFloat(String fieldName)
          Creates a Field object that can hold a single 32-bit floating-point value.
static Field createFloatArray(String fieldName, int dimensions)
          Creates a Field object that can hold an array of 32-bit floating point values.
static Field createInt(String fieldName)
          Creates a Field object that can hold a 32-bit integer.
static Field createIntArray(String fieldName, int dimensions)
          Creates a Field object that can hold an array of 32-bit integers.
static Field createInterface(String fieldName, String interfaceName)
          Creates a Field object that can hold a reference to an interface.
static Field createInterfaceArray(String fieldName, String interfaceName, int dimensions)
          Creates a Field object that can hold an array of references to an interface.
static Field createLong(String fieldName)
          Creates a Field object that can hold a single 64-bit integer.
static Field createLongArray(String fieldName, int dimensions)
          Creates a Field object that can hold an array of 64-bit integers.
static Field createShort(String fieldName)
          Creates a Field object that can hold a 16-bit integer.
static Field createShortArray(String fieldName, int dimensions)
          Creates a Field object that can hold an array of 16-bit integers.
static Field createString(String fieldName)
          Creates a Field object that can hold a single string value.
static Field createStringArray(String fieldName, int dimensions)
          Creates a Field object that can hold an array of string values.
 

Method Detail

createByte

public static Field createByte(String fieldName)
Creates a Field object that can hold a single byte.

Parameters:
fieldName - The name of the field.

Returns:
The byte field object.

Throws:
NullPointerException - If the fieldName argument is null.

createChar

public static Field createChar(String fieldName)
Creates a Field object that can hold a single character.

Parameters:
fieldName - The name of the field.

Returns:
The character field object.

Throws:
NullPointerException - If the fieldName argument is null.

createShort

public static Field createShort(String fieldName)
Creates a Field object that can hold a 16-bit integer.

Parameters:
fieldName - The name of the field.

Returns:
The short integer field object.

Throws:
NullPointerException - If the fieldName argument is null.

createInt

public static Field createInt(String fieldName)
Creates a Field object that can hold a 32-bit integer.

Parameters:
fieldName - The name of the field.

Returns:
The integer field object.

Throws:
NullPointerException - If the fieldName argument is null.

createLong

public static Field createLong(String fieldName)
Creates a Field object that can hold a single 64-bit integer.

Parameters:
fieldName - The name of the field.

Returns:
The long integer field object.

Throws:
NullPointerException - If the fieldName argument is null.

createFloat

public static Field createFloat(String fieldName)
Creates a Field object that can hold a single 32-bit floating-point value.

Parameters:
fieldName - The name of the field.

Returns:
The floating-point field object.

Throws:
NullPointerException - If the fieldName argument is null.

createDouble

public static Field createDouble(String fieldName)
Creates a Field object that can hold a single 64-bit floating-point value.

Parameters:
fieldName - The name of the field.

Returns:
The double floating-point field object.

Throws:
NullPointerException - If the fieldName argument is null.

createBoolean

public static Field createBoolean(String fieldName)
Creates a Field object that can hold a single Boolean value.

Parameters:
fieldName - The name of the field.

Returns:
The Boolean field object.

Throws:
NullPointerException - If the fieldName argument is null.

createString

public static Field createString(String fieldName)
Creates a Field object that can hold a single string value.

Parameters:
fieldName - The name of the field.

Returns:
The string field object.

Throws:
NullPointerException - If the fieldName argument is null.

createEmbeddedString

public static Field createEmbeddedString(String fieldName,
                                         int maxSize)
Creates a Field object that can hold an embedded string value.

Parameters:
fieldName - The name of the field.

maxSize - The maximum length string that can be stored in the field.
Returns:
The string field object.

Throws:
NullPointerException - If the fieldName argument is null.

createClass

public static Field createClass(String fieldName,
                                String className)
Creates a Field object that can hold a reference to a class.

Parameters:
fieldName - The name of the field.

className - The fully qualified name of the class, including the package, that is referenced.

Returns:
The class reference field object.

Throws:
NullPointerException - If the fieldName argument or the className argument is null.

createInterface

public static Field createInterface(String fieldName,
                                    String interfaceName)
Creates a Field object that can hold a reference to an interface.

Parameters:
fieldName - The name of the field.

interfaceName - The fully qualified name of the interface, including the package, that is referenced.

Returns:
The interface reference field object.

Throws:
NullPointerException - If the fieldName argument or the interfaceName argument is null.

createByteArray

public static Field createByteArray(String fieldName,
                                    int dimensions)
Creates a Field object that can hold an array of bytes.

Parameters:
fieldName - The name of the field.

dimensions - The number of array dimensions.

Returns:
The byte array field object.

Throws:
NullPointerException - If the fieldName argument is null.

createCharArray

public static Field createCharArray(String fieldName,
                                    int dimensions)
Creates a Field object that can hold an array of characters.

Parameters:
fieldName - The name of the field.

dimensions - The number of array dimensions.

Returns:
The character array field object.

Throws:
NullPointerException - If the fieldName argument is null.

createShortArray

public static Field createShortArray(String fieldName,
                                     int dimensions)
Creates a Field object that can hold an array of 16-bit integers.

Parameters:
fieldName - The name of the field.

dimensions - The number of array dimensions.

Returns:
The short integer array field object.

Throws:
NullPointerException - If the fieldName argument is null.

createIntArray

public static Field createIntArray(String fieldName,
                                   int dimensions)
Creates a Field object that can hold an array of 32-bit integers.

Parameters:
fieldName - The name of the field.

dimensions - The number of array dimensions.

Returns:
The integer array field object.

Throws:
NullPointerException - If the fieldName argument is null.

createLongArray

public static Field createLongArray(String fieldName,
                                    int dimensions)
Creates a Field object that can hold an array of 64-bit integers.

Parameters:
fieldName - The name of the field.

dimensions - The number of array dimensions.

Returns:
The long integer array field object.

Throws:
NullPointerException - If the fieldName argument is null.

createFloatArray

public static Field createFloatArray(String fieldName,
                                     int dimensions)
Creates a Field object that can hold an array of 32-bit floating point values.

Parameters:
fieldName - The name of the field.

dimensions - The number of array dimensions.

Returns:
The floating-point array field object.

Throws:
NullPointerException - If the fieldName argument is null.

createDoubleArray

public static Field createDoubleArray(String fieldName,
                                      int dimensions)
Creates a Field object that can hold an array of 64-bit floating-point values.

Parameters:
fieldName - The name of the field.

dimensions - The number of array dimensions.

Returns:
The double array field object.

Throws:
NullPointerException - If the fieldName argument is null.

createBooleanArray

public static Field createBooleanArray(String fieldName,
                                       int dimensions)
Creates a Field object that can hold an array of Boolean values.

Parameters:
fieldName - The name of the field.

dimensions - The number of array dimensions.

Returns:
The Boolean array field object.

Throws:
NullPointerException - If the fieldName argument is null.

createStringArray

public static Field createStringArray(String fieldName,
                                      int dimensions)
Creates a Field object that can hold an array of string values.

Parameters:
fieldName - The name of the field.

dimensions - The number of array dimensions.

Returns:
The string array field object.

Throws:
NullPointerException - If the fieldName argument is null.

createClassArray

public static Field createClassArray(String fieldName,
                                     String className,
                                     int dimensions)
Creates a Field object that can hold an array of references to a class.

Parameters:
fieldName - The name of the field.

className - The fully qualified name of the class, including the package, that is being referenced.

dimensions - The number of array dimensions.

Returns:
The class references array field object.

Throws:
NullPointerException - If the fieldName argument or the className argument is null.

createInterfaceArray

public static Field createInterfaceArray(String fieldName,
                                         String interfaceName,
                                         int dimensions)
Creates a Field object that can hold an array of references to an interface.

Parameters:
fieldName - The name of the field.

interfaceName - The fully qualified name of the interface, including the package, that is being referenced.

dimensions - The number of array dimensions.

Returns:
The interface references array field object.

Throws:
NullPointerException - If the fieldName argument or the interfaceName argument is null.


Copyright 2005 Progress Software Corporation. All rights reserved.