加载中...
The Wayback Machine - https://sup1a9wrlpyh5li9ro.vcoronado.top/web/20090321131741/http://developer.android.com:80/reference/java/io/ObjectStreamClass.html
public class

ObjectStreamClass

extends Object
implements Serializable
java.lang.Object
   ↳ java.io.ObjectStreamClass

Class Overview

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
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)
Returns a given field by name.
ObjectStreamField[] getFields()
Returns the collection of field descriptors for the fields of the corresponding class
String getName()
Returns the name of the class represented by the receiver
long getSerialVersionUID()
Returns 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()
Returns a string containing a concise, human-readable description of the receiver.
[Expand]
Inherited Methods
From class java.lang.Object

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)

Returns a given field by name.

Parameters
name name of the desired field.
Returns
  • a given field by name.

public ObjectStreamField[] getFields ()

Returns 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 ()

Returns the name of the class represented by the receiver

Returns
  • fully qualified name of the class the receiver represents

public long getSerialVersionUID ()

Returns 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 ()

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

Returns
  • a printable representation for the receiver.