Class ObjectStreamClass
java.lang.Object
com.sun.corba.ee.impl.io.ObjectStreamClass
- All Implemented Interfaces:
Serializable
A ObjectStreamClass describes a class that can be serialized to a stream
or a class that was serialized to a stream. It contains the name
and the serialVersionUID of the class.
The ObjectStreamClass for a specific class loaded in this Java VM can be found using the lookup method.
The ObjectStreamClass for a specific class loaded in this Java VM can be found using the lookup method.
- Since:
- JDK1.1
- Version:
- ObjectStreamClass.java 1.17 99/06/07
- Author:
- Roger Riggs
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final longstatic final intstatic final ObjectStreamField[]Set serialPersistentFields of a Serializable class to this value to denote that the class has no Serializable fields. -
Method Summary
Modifier and TypeMethodDescriptionfinal Class<?> forClass()Return the class in the local VM that this version is mapped to.final longReturn the actual (computed) serialVersionUID for this class.static final longgetActualSerialVersionUID(Class<?> clazz) Return the actual (computed) serialVersionUID for this class.final StringReturn the actual (computed) serialVersionUID for this class.final ObjectStreamFieldGet the field of this class by name.Return an array of the fields of this serializable class.final StringgetName()The name of the class described by this descriptor.final StringThis will return null if there is no writeObject method.final longReturn the serialVersionUID for this class.static final longgetSerialVersionUID(Class<?> clazz) Return the serialVersionUID for this class.final StringReturn the serialVersionUID string for this class.booleanhasField(ValueMember field) readResolve(Object value) final StringtoString()Return a string describing this ObjectStreamClass.static final ObjectStreamField[]translateFields(ObjectStreamField[] fields) writeReplace(Serializable value)
-
Field Details
-
kDefaultUID
public static final long kDefaultUID- See Also:
-
CLASS_MASK
public static final int CLASS_MASK- See Also:
-
FIELD_MASK
public static final int FIELD_MASK- See Also:
-
METHOD_MASK
public static final int METHOD_MASK- See Also:
-
NO_FIELDS
Set serialPersistentFields of a Serializable class to this value to denote that the class has no Serializable fields.
-
-
Method Details
-
getName
The name of the class described by this descriptor.- Returns:
- name of class
-
getSerialVersionUID
Return the serialVersionUID for this class. The serialVersionUID defines a set of classes all with the same name that have evolved from a common root class and agree to be serialized and deserialized using a common format.- Parameters:
clazz- class to get UID of- Returns:
- UID for the class
-
getSerialVersionUID
public final long getSerialVersionUID()Return the serialVersionUID for this class. The serialVersionUID defines a set of classes all with the same name that have evolved from a common root class and agree to be serialized and deserialized using a common format.- Returns:
- SerialVersionUID for this class.
-
getSerialVersionUIDStr
Return the serialVersionUID string for this class. The serialVersionUID defines a set of classes all with the same name that have evolved from a common root class and agree to be serialized and deserialized using a common format.- Returns:
- UID for this class
-
getActualSerialVersionUID
Return the actual (computed) serialVersionUID for this class.- Parameters:
clazz- Class to get UID of- Returns:
- The class UID
-
getActualSerialVersionUID
public final long getActualSerialVersionUID()Return the actual (computed) serialVersionUID for this class.- Returns:
- UID for this class
-
getActualSerialVersionUIDStr
Return the actual (computed) serialVersionUID for this class.- Returns:
- UID for this class
-
forClass
Return the class in the local VM that this version is mapped to. Null is returned if there is no corresponding local class.- Returns:
- Class this is mapped to
-
getFields
Return an array of the fields of this serializable class.- Returns:
- an array containing an element for each persistent field of this class. Returns an array of length zero if there are no fields.
- Since:
- JDK1.2
-
hasField
-
getField
Get the field of this class by name.- Parameters:
name- name of the field to get- Returns:
- The ObjectStreamField object of the named field or null if there is no such named field.
-
writeReplace
-
readResolve
-
toString
-
getRMIIIOPOptionalDataRepId
This will return null if there is no writeObject method.- Returns:
- A Serializable's optional custom data fake repository ID.
-
translateFields
-