java.lang.Object
javax.sql.rowset.serial.SerialJavaObject
- All Implemented Interfaces:
- Serializable,- Cloneable
public class SerialJavaObject extends Object implements Serializable, 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.
 
Thread safety
A SerialJavaObject is not safe for use by multiple concurrent threads. If a SerialJavaObject is to be used by more than one thread then access to the SerialJavaObject should be controlled by appropriate synchronization.- Since:
- 1.5
- See Also:
- Serialized Form
- 
Constructor SummaryConstructors Constructor Description SerialJavaObject(Object obj)Constructor forSerialJavaObjecthelper class.
- 
Method SummaryModifier and Type Method Description Objectclone()Returns a clone of thisSerialJavaObject.booleanequals(Object o)Compares this SerialJavaObject to the specified object.Field[]getFields()Returns an array ofFieldobjects that contains each field of the object that this helper class is serializing.ObjectgetObject()Returns anObjectthat is a copy of thisSerialJavaObjectobject.inthashCode()Returns a hash code for this SerialJavaObject.
- 
Constructor Details- 
SerialJavaObjectConstructor forSerialJavaObjecthelper class.- Parameters:
- obj- the Java- Objectto be serialized
- Throws:
- SerialException- if the object is found not to be serializable
 
 
- 
- 
Method Details- 
getObjectReturns anObjectthat is a copy of thisSerialJavaObjectobject.- Returns:
- a copy of this SerialJavaObjectobject as anObjectin the Java programming language
- Throws:
- SerialException- if the instance is corrupt
 
- 
getFieldsReturns an array ofFieldobjects that contains each field of the object that this helper class is serializing.- Returns:
- an array of Fieldobjects
- Throws:
- SerialException- if an error is encountered accessing the serialized object
- SecurityException- If a security manager, s, is present and the caller's class loader is not the same as or an ancestor of the class loader for the class of the object being serialized and invocation of- s.checkPackageAccess()denies access to the package of that class.
- See Also:
- Class.getFields()
 
- 
equalsCompares this SerialJavaObject to the specified object. The result istrueif and only if the argument is notnulland is aSerialJavaObjectobject that is identical to this object- Overrides:
- equalsin class- Object
- Parameters:
- o- The object to compare this- SerialJavaObjectagainst
- Returns:
- trueif the given object represents a- SerialJavaObjectequivalent to this SerialJavaObject,- falseotherwise
- See Also:
- Object.hashCode(),- HashMap
 
- 
hashCodepublic int hashCode()Returns a hash code for this SerialJavaObject. The hash code for aSerialJavaObjectobject is taken as the hash code of theObjectit stores- Overrides:
- hashCodein class- Object
- Returns:
- a hash code value for this object.
- See Also:
- Object.equals(java.lang.Object),- System.identityHashCode(java.lang.Object)
 
- 
cloneReturns a clone of thisSerialJavaObject.
 
-