English | Site Directory

Android - An Open Handset Alliance Project

java.io
public class

java.io.ObjectStreamClass

java.lang.Object
java.io.ObjectStreamClass Serializable

Instances of ObjectStreamClass are used to describe classes of objects used by serialization. When objects are saved, information about all its superclasses is also saved by the use of descriptors, instances of ObjectStreamClass. These descriptors carry information about the class they represent, such as - The name of the class - SUID of the class - Field names and types

Summary

Constants

      Value  
ObjectStreamField[]  NO_FIELDS  A value that indicates the class has no Serializable fields      

Public Methods

        Class  forClass()
Return the class (java.lang.Class) that the receiver represents
        ObjectStreamField  getField(String name)
Answers a given field by name.
        ObjectStreamField[]  getFields()
Answers the collection of field descriptors for the fields of the corresponding class
        String  getName()
Answers the name of the class represented by the receiver
        long  getSerialVersionUID()
Answers the Serial Version User ID of the class represented by the receiver
      static  ObjectStreamClass  lookup(Class cl)
Return the descriptor (ObjectStreamClass) corresponding to the class cl.
        String  toString()
Answers a string containing a concise, human-readable description of the receiver.
Methods inherited from class java.lang.Object

Details

Constants

public static final ObjectStreamField[] NO_FIELDS

A value that indicates the class has no Serializable fields

Public Methods

public Class forClass()

Return the class (java.lang.Class) that the receiver represents

Returns

  • null if there is no corresponding class for the receiver Class The loaded class corresponding to the receiver

public ObjectStreamField getField(String name)

Answers a given field by name.

Parameters

name name of the desired field.

Returns

  • a given field by name.

public ObjectStreamField[] getFields()

Answers the collection of field descriptors for the fields of the corresponding class

Returns

  • the receiver's collection of declared fields for the class it represents

public String getName()

Answers the name of the class represented by the receiver

Returns

  • fully qualified name of the class the receiver represents

public long getSerialVersionUID()

Answers the Serial Version User ID of the class represented by the receiver

Returns

  • SUID for the class represented by the receiver

public static ObjectStreamClass lookup(Class cl)

Return the descriptor (ObjectStreamClass) corresponding to the class cl. If the class is not Serializable or Externalizable, null is returned.

Parameters

cl a java.langClass for which to obtain the corresponding descriptor

Returns

  • null if instances of the class cl are not Serializable or Externalizable ObjectStreamClass The corresponding descriptor if the class cl is Serializable or Externalizable

public String toString()

Answers a string containing a concise, human-readable description of the receiver.

Returns

  • a printable representation for the receiver.
Build m5-rc15g - 14 May 2008 12:50