API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.io. ObjectStreamClass View Source
Author(s)
Mike Warres
Roger Riggs
Since
JDK1.1
Version
1.152, 04/21/06
Serial
Hierarchy
 Object
      ObjectStreamClass
Implements
 Serializable
Subclasses
Description
public class ObjectStreamClass
  Serialization's descriptor for classes.
Constructors
pack-private ObjectStreamClass ()
Creates blank class descriptor which should be initialized via a subsequent call to initProxy(), initNonProxy() or readNonProxy().
private ObjectStreamClass (Class cl)
Creates local class descriptor representing given class.
Methods
Hide/Show inherited methods
pack-private void checkDefaultSerialize () throws InvalidClassException
  Throws an InvalidClassException if objects whose class is represented by this descriptor should not be permitted to use default serialization (e.g., if the class declares serializable fields that do not correspond to actual fields, and hence must use the GetField API).
pack-private void checkDeserialize () throws InvalidClassException
  Throws an InvalidClassException if object instances referencing this class descriptor should not be allowed to deserialize.
pack-private void checkSerialize () throws InvalidClassException
  Throws an InvalidClassException if objects whose class is represented by this descriptor should not be allowed to serialize.
public Class<Object> forClass ()
  Return the class in the local VM that this version is mapped to.
pack-private ClassDataSlot getClassDataLayout () throws InvalidClassException
  Returns array of ClassDataSlot instances representing the data layout (including superclass data) for serialized objects described by this class descriptor.
pack-privatestatic String getClassSignature (Class cl)
Returns JVM type signature for given class.
public ObjectStreamField getField (String name)
  Get the field of this class by name.
pack-private ObjectStreamField getField (String name, Class type)
  Looks up a serializable field of the represented class by name and type.
public ObjectStreamField getFields ()
  Return an array of the fields of this serializable class.
pack-private ObjectStreamField getFields (boolean copy)
  Returns arrays of ObjectStreamFields representing the serializable fields of the represented class.
pack-private ObjectStreamClass getLocalDesc ()
Returns the "local" class descriptor for the class associated with this class descriptor (i.e., the result of ObjectStreamClass.lookup(this.forClass())) or null if there is no class associated with this descriptor.
public String getName ()
  Returns the name of the class described by this descriptor.
pack-private int getNumObjFields ()
Returns number of non-primitive serializable fields of represented class.
pack-private void getObjFieldValues (Object obj, Object vals)
  Fetches the serializable object field values of object obj and stores them in array vals starting at offset 0.
pack-private int getPrimDataSize ()
Returns aggregate size (in bytes) of marshalled primitive field values for represented class.
pack-private void getPrimFieldValues (Object obj, byte[] buf)
  Fetches the serializable primitive field values of object obj and marshals them into byte array buf starting at offset 0.
pack-private ClassNotFoundException getResolveException ()
Returns ClassNotFoundException (if any) thrown while attempting to resolve local class corresponding to this class descriptor.
public long getSerialVersionUID ()
  Return the serialVersionUID for this class.
pack-private ObjectStreamClass getSuperDesc ()
  Returns superclass descriptor.
pack-private boolean hasBlockExternalData ()
Returns true if class descriptor represents externalizable class that has written its data in 1.2 (block data) format, false otherwise.
pack-private boolean hasReadObjectMethod ()
  Returns true if represented class is serializable (but not externalizable) and defines a conformant readObject method.
pack-private boolean hasReadObjectNoDataMethod ()
  Returns true if represented class is serializable (but not externalizable) and defines a conformant readObjectNoData method.
pack-private boolean hasReadResolveMethod ()
  Returns true if represented class is serializable or externalizable and defines a conformant readResolve method.
pack-private boolean hasWriteObjectData ()
Returns true if class descriptor represents serializable (but not externalizable) class which has written its data via a custom writeObject() method, false otherwise.
pack-private boolean hasWriteObjectMethod ()
  Returns true if represented class is serializable (but not externalizable) and defines a conformant writeObject method.
pack-private boolean hasWriteReplaceMethod ()
  Returns true if represented class is serializable or externalizable and defines a conformant writeReplace method.
pack-private void initNonProxy (ObjectStreamClass model, Class cl, ClassNotFoundException resolveEx, ObjectStreamClass superDesc) throws InvalidClassException
Initializes class descriptor representing a non-proxy class.
pack-private void initProxy (Class cl, ClassNotFoundException resolveEx, ObjectStreamClass superDesc) throws InvalidClassException
Initializes class descriptor representing a proxy class.
pack-private void invokeReadObject (Object obj, ObjectInputStream in) throws ClassNotFoundException IOException UnsupportedOperationException
  Invokes the readObject method of the represented serializable class.
pack-private void invokeReadObjectNoData (Object obj) throws IOException UnsupportedOperationException
  Invokes the readObjectNoData method of the represented serializable class.
pack-private Object invokeReadResolve (Object obj) throws IOException UnsupportedOperationException
  Invokes the readResolve method of the represented serializable class and returns the result.
pack-private void invokeWriteObject (Object obj, ObjectOutputStream out) throws IOException UnsupportedOperationException
  Invokes the writeObject method of the represented serializable class.
pack-private Object invokeWriteReplace (Object obj) throws IOException UnsupportedOperationException
  Invokes the writeReplace method of the represented serializable class and returns the result.
pack-private boolean isEnum ()
Returns true if class descriptor represents an enum type, false otherwise.
pack-private boolean isExternalizable ()
Returns true if represented class implements Externalizable, false otherwise.
pack-private boolean isInstantiable ()
  Returns true if represented class is serializable/externalizable and can be instantiated by the serialization runtime--i.e., if it is externalizable and defines a public no-arg constructor, or if it is non-externalizable and its first non-serializable superclass defines an accessible no-arg constructor.
pack-private boolean isProxy ()
Returns true if class descriptor represents a dynamic proxy class, false otherwise.
pack-private boolean isSerializable ()
Returns true if represented class implements Serializable, false otherwise.
publicstatic ObjectStreamClass lookup (Class<Object> cl)
  Find the descriptor for a class that can be serialized.
pack-privatestatic ObjectStreamClass lookup (Class cl, boolean all)
  Looks up and returns class descriptor for given class, or null if class is non-serializable and "all" is set to false.
publicstatic ObjectStreamClass lookupAny (Class<Object> cl)
  Returns the descriptor for any class, regardless of whether it implements Serializable.
pack-private Object newInstance () throws InstantiationException InvocationTargetException UnsupportedOperationException
  Creates a new instance of the represented class.
pack-privatestatic void processQueue (ReferenceQueue<Class<Object>> queue, ConcurrentMap<WeakReference, Object> map)
Removes from the specified map any keys that have been enqueued on the specified reference queue.
pack-private void readNonProxy (ObjectInputStream in) throws IOException ClassNotFoundException
  Reads non-proxy class descriptor information from given input stream.
pack-private void setObjFieldValues (Object obj, Object vals)
  Sets the serializable object fields of object obj using values from array vals starting at offset 0.
pack-private void setPrimFieldValues (Object obj, byte[] buf)
  Sets the serializable primitive fields of object obj using values unmarshalled from byte array buf starting at offset 0.
public String toString ()
Return a string describing this ObjectStreamClass.
pack-private void writeNonProxy (ObjectOutputStream out) throws IOException
Writes non-proxy class descriptor information to given output stream.
Fields
Hide/Show inherited fields
publicfinalstatic ObjectStreamField NO_FIELDS
serialPersistentFields value indicating no serializable fields
Nested Classes
  ObjectStreamClass.ClassDataSlot
Class representing the portion of an object's serialized form allotted to data described by a given class descriptor.
  ObjectStreamClass.WeakClassKey
Weak key for Class objects.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar