Class ObjectStreamClass

java.lang.Object
com.sun.corba.ee.impl.io.ObjectStreamClass
All Implemented Interfaces:
Serializable

public class ObjectStreamClass extends Object implements 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.
Since:
JDK1.1
Version:
ObjectStreamClass.java 1.17 99/06/07
Author:
Roger Riggs
See Also:
  • 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

      public static final ObjectStreamField[] NO_FIELDS
      Set serialPersistentFields of a Serializable class to this value to denote that the class has no Serializable fields.
  • Method Details

    • getName

      public final String getName()
      The name of the class described by this descriptor.
      Returns:
      name of class
    • getSerialVersionUID

      public static final long getSerialVersionUID(Class<?> clazz)
      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

      public final String 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

      public static final long getActualSerialVersionUID(Class<?> clazz)
      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

      public final String getActualSerialVersionUIDStr()
      Return the actual (computed) serialVersionUID for this class.
      Returns:
      UID for this class
    • forClass

      public final 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

      public ObjectStreamField[] 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

      public boolean hasField(ValueMember field)
    • getField

      public final ObjectStreamField getField(String name)
      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

      public Serializable writeReplace(Serializable value)
    • readResolve

      public Object readResolve(Object value)
    • toString

      public final String toString()
      Return a string describing this ObjectStreamClass.
      Overrides:
      toString in class Object
    • getRMIIIOPOptionalDataRepId

      public final String getRMIIIOPOptionalDataRepId()
      This will return null if there is no writeObject method.
      Returns:
      A Serializable's optional custom data fake repository ID.
    • translateFields

      public static final ObjectStreamField[] translateFields(ObjectStreamField[] fields)