|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.odi.GenericObject
The GenericObject class is an abstract class that PSE/PSE Pro uses to transfer data between a database and a Java application or applet. Normally, you do not need to know anything about the GenericObject class. You only need to know about this class if you choose, under exceptional circumstances, to annotate your classes yourself to allow persistence. It is expected that you will use the Class File Postprocessor to make your classes persistence-capable.
Even if you annotate your classes yourself, you do not define subclasses of GenericObject nor do you create instances of GenericObject. When an application or applet requires a persistent object, PSE/PSE Pro creates an instance of GenericObject to hold a copy of the contents of the persistent object. It then passes this instance to the intializeContents() method defined in the Persistent subclass of the persistent object being accessed. The instance of GenericObject is only briefly in use. Instances of GenericObject do not exist in proportion to the number of persistent objects. In fact, if a program does not use multiple threads then there is never more than one instance of GenericObject allocated at a time.
PSE/PSE Pro calls the initializeContents() method as needed and the result is that your program has access to the desired data. The initializeContents() method must call methods on the GenericObject instance to obtain the field values for the persistent object. If you do not use the Class File Postprocessor and instead you write your own initializeContents() method then you use a field number to reference each field in a GenericObject instance. Field numbers represent the location of a field within the list of all fields defined for the class and its superclasses. The first field has field number 1. When you define the getFields() method in the ClassInfo subclass, you determine the order, and hence the number, of each field. The field numbers must be consecutive; there can be no gaps in the sequence.
To summarize, your application does not create instances of the GenericObject class. But to access persistent data, your application must define methods that call methods on generic objects to access their contents. Normally, the postprocessor defines these methods for you.
ClassInfo
Method Summary | |
abstract Object |
getArrayField(int fieldNumber,
ClassInfo fieldClass)
Extracts an array value from a generic object. |
abstract boolean |
getBooleanField(int fieldNumber,
ClassInfo fieldClass)
Extracts a Boolean value from a generic object. |
abstract byte |
getByteField(int fieldNumber,
ClassInfo fieldClass)
Extracts a byte value from a generic object. |
abstract char |
getCharField(int fieldNumber,
ClassInfo fieldClass)
Extracts a character value from a generic object. |
abstract Object |
getClassField(int fieldNumber,
ClassInfo fieldClass)
Extracts a class reference from a generic object. |
abstract double |
getDoubleField(int fieldNumber,
ClassInfo fieldClass)
Extracts a 64-bit floating-point value from a generic object. |
abstract float |
getFloatField(int fieldNumber,
ClassInfo fieldClass)
Extracts a 32-bit floating-point value from a generic object. |
abstract Class |
getGenericObjectClass()
Obtains the class of the instance whose contents are contained by the generic object. |
abstract Object |
getInterfaceField(int fieldNumber,
ClassInfo fieldClass)
Extracts a interface value from a generic object. |
abstract int |
getIntField(int fieldNumber,
ClassInfo fieldClass)
Extracts a 32-bit integer value from a generic object. |
abstract long |
getLongField(int fieldNumber,
ClassInfo fieldClass)
Extracts a 64-bit integer value from a generic object. |
abstract short |
getShortField(int fieldNumber,
ClassInfo fieldClass)
Extracts a 16-bit integer value from a generic object. |
abstract String |
getStringField(int fieldNumber,
ClassInfo fieldClass)
Extracts a string value from a generic object. |
abstract void |
setArrayField(int fieldNumber,
Object fieldValue,
ClassInfo fieldClass)
Sets an array value in a generic object. |
abstract void |
setBooleanField(int fieldNumber,
boolean fieldValue,
ClassInfo fieldClass)
Sets a Boolean value in a generic object. |
abstract void |
setByteField(int fieldNumber,
byte fieldValue,
ClassInfo fieldClass)
Sets a byte value in a generic object. |
abstract void |
setCharField(int fieldNumber,
char fieldValue,
ClassInfo fieldClass)
Sets a character value in a generic object. |
abstract void |
setClassField(int fieldNumber,
Object fieldValue,
ClassInfo fieldClass)
Sets a class reference value in a generic object. |
abstract void |
setDoubleField(int fieldNumber,
double fieldValue,
ClassInfo fieldClass)
Sets a 64-bit floating-point value in a generic object. |
abstract void |
setFloatField(int fieldNumber,
float fieldValue,
ClassInfo fieldClass)
Sets a 32-bit floating-point value in a generic object. |
abstract void |
setInterfaceField(int fieldNumber,
Object fieldValue,
ClassInfo fieldClass)
Sets an interface value in a generic object. |
abstract void |
setIntField(int fieldNumber,
int fieldValue,
ClassInfo fieldClass)
Sets a 32-bit integer value in a generic object. |
abstract void |
setLongField(int fieldNumber,
long fieldValue,
ClassInfo fieldClass)
Sets a 64-bit integer value in a generic object. |
abstract void |
setShortField(int fieldNumber,
short fieldValue,
ClassInfo fieldClass)
Sets a 16-bit integer value in a generic object. |
abstract void |
setStringField(int fieldNumber,
String fieldValue,
ClassInfo fieldClass)
Sets a string value in a generic object. |
Method Detail |
public abstract Class getGenericObjectClass() throws ClassNotFoundException
ClassNotFoundException
- If the class is not found.public abstract byte getByteField(int fieldNumber, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
public abstract char getCharField(int fieldNumber, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
public abstract short getShortField(int fieldNumber, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
public abstract int getIntField(int fieldNumber, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
public abstract long getLongField(int fieldNumber, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
public abstract float getFloatField(int fieldNumber, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
public abstract double getDoubleField(int fieldNumber, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
public abstract boolean getBooleanField(int fieldNumber, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
public abstract String getStringField(int fieldNumber, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
public abstract Object getClassField(int fieldNumber, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
public abstract Object getArrayField(int fieldNumber, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
public abstract Object getInterfaceField(int fieldNumber, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
public abstract void setByteField(int fieldNumber, byte fieldValue, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldValue
- The value to set the field to.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.public abstract void setCharField(int fieldNumber, char fieldValue, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldValue
- The value to set the field to.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.public abstract void setShortField(int fieldNumber, short fieldValue, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldValue
- The value to set the field to.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.public abstract void setIntField(int fieldNumber, int fieldValue, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldValue
- The value to set the field to.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.public abstract void setLongField(int fieldNumber, long fieldValue, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldValue
- The value to set the field to.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.public abstract void setFloatField(int fieldNumber, float fieldValue, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldValue
- The value to set the field to.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.public abstract void setDoubleField(int fieldNumber, double fieldValue, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldValue
- The value to set the field to.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.public abstract void setBooleanField(int fieldNumber, boolean fieldValue, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldValue
- The value to set the field to.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.public abstract void setStringField(int fieldNumber, String fieldValue, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldValue
- The value to set the field to.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.public abstract void setClassField(int fieldNumber, Object fieldValue, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldValue
- The value to set the field to.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.public abstract void setArrayField(int fieldNumber, Object fieldValue, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldValue
- The value to set the field to.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.public abstract void setInterfaceField(int fieldNumber, Object fieldValue, ClassInfo fieldClass)
fieldNumber
- The field number of
the field within the class.fieldValue
- The value to set the field to.fieldClass
- The instance of the ClassInfo subclass
that is registered for the class that contains the field.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |