public class ObjectStreamClass extends Object implements Serializable
ObjectOutputStream,
ObjectInputStream,
Class,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static ObjectStreamField[] |
NO_FIELDS
Constant indicating that the class has no Serializable fields.
|
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
checkAndGetTcEnumClass()
Checks the local class to make sure it is valid for
ObjectStreamConstants.TC_ENUM
deserialization. |
Class<?> |
checkAndGetTcObjectClass()
Checks the local class to make sure it is valid for
ObjectStreamConstants.TC_OBJECT
deserialization. |
Class<?> |
forClass()
Returns the class (java.lang.Class) for this descriptor.
|
ObjectStreamField |
getField(String name)
Gets a field descriptor of the class represented by this class
descriptor.
|
ObjectStreamField[] |
getFields()
Returns a collection of field descriptors for the serialized fields of
the class represented by this class descriptor.
|
String |
getName()
Returns the name of the class represented by this descriptor.
|
long |
getSerialVersionUID()
Returns the Serial Version User ID of the class represented by this
descriptor.
|
static ObjectStreamClass |
lookup(Class<?> cl)
Returns the descriptor for a serializable class.
|
static ObjectStreamClass |
lookupAny(Class<?> cl)
Returns the descriptor for any class, whether or not the class
implements Serializable or Externalizable.
|
String |
toString()
Returns a string containing a concise, human-readable description of this
descriptor.
|
public static final ObjectStreamField[] NO_FIELDS
public Class<?> forClass()
null if there is no corresponding class.public ObjectStreamField getField(String name)
name - the name of the desired field.name or null if there is
no such field.public ObjectStreamField[] getFields()
public String getName()
public long getSerialVersionUID()
public static ObjectStreamClass lookup(Class<?> cl)
Serializable or Externalizable.cl - a java.lang.Class for which to obtain the corresponding
descriptorpublic static ObjectStreamClass lookupAny(Class<?> cl)
cl - a java.lang.Class for which to obtain the corresponding
descriptorpublic String toString()
public Class<?> checkAndGetTcObjectClass() throws InvalidClassException
ObjectStreamConstants.TC_OBJECT
deserialization. Also performs some sanity checks of the stream data. This method is used
during deserialization to confirm the local class is likely to be compatible with the coming
stream data, but before an instance is instantiated.InvalidClassExceptionpublic Class<?> checkAndGetTcEnumClass() throws InvalidClassException
ObjectStreamConstants.TC_ENUM
deserialization. This method is used during deserialization to confirm the local class is
likely to be compatible with the coming stream data, but before an instance is instantiated.InvalidClassException