javax.sql.rowset.serial
Class SerialJavaObject

java.lang.Object
  extended byjavax.sql.rowset.serial.SerialJavaObject
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class SerialJavaObject
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

A serializable mapping in the Java programming language of an SQL JAVA_OBJECT value. Assuming the Java object implements the Serializable interface, this class simply wraps the serialization process.

If however, the serialization is not possible because the Java object is not immediately serializable, this class will attempt to serialize all non-static members to permit the object state to be serialized. Static or transient fields cannot be serialized; an attempt to serialize them will result in a SerialException object being thrown.

Version:
0.1
Author:
Jonathan Bruce
See Also:
Serialized Form

Constructor Summary
SerialJavaObject(java.lang.Object obj)
          Constructor for SerialJavaObject helper class.
 
Method Summary
 java.lang.reflect.Field[] getFields()
          Returns an array of Field objects that contains each field of the object that this helper class is serializing.
 java.lang.Object getObject()
          Returns an Object that is a copy of this SerialJavaObject object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerialJavaObject

public SerialJavaObject(java.lang.Object obj)
                 throws SerialException
Constructor for SerialJavaObject helper class.

Parameters:
obj - the Java Object to be serialized
Throws:
SerialException - if the object is found to be unserializable
Method Detail

getObject

public java.lang.Object getObject()
                           throws SerialException
Returns an Object that is a copy of this SerialJavaObject object.

Returns:
a copy of this SerialJavaObject object as an Object in the Java programming language
Throws:
SerialException - if the instance is corrupt

getFields

public java.lang.reflect.Field[] getFields()
                                    throws SerialException
Returns an array of Field objects that contains each field of the object that this helper class is serializing.

Returns:
an array of Field objects
Throws:
SerialException - if an error is encountered accessing the serialized object