Showing content from http://java.sun.com/j2se/1.5/docs/api/java/io/../../java/io/../../java/io/ObjectStreamClass.html below:
ObjectStreamClass (Java 2 Platform SE 5.0)
java.io
Class ObjectStreamClass
java.lang.Object
java.io.ObjectStreamClass
-
All Implemented Interfaces:
-
Serializable
-
public class ObjectStreamClass
- extends Object
- implements Serializable
Serialization's descriptor for classes. It contains the name and serialVersionUID of the class. The ObjectStreamClass for a specific class loaded in this Java VM can be found/created using the lookup method.
The algorithm to compute the SerialVersionUID is described in Object Serialization Specification, Section 4.4, Stream Unique Identifiers.
-
Since:
-
JDK1.1
-
See Also:
-
ObjectStreamField
, Object Serialization Specification, Section 4, Class Descriptors, Serialized Form
NO_FIELDS
public static final ObjectStreamField[] NO_FIELDS
-
serialPersistentFields value indicating no serializable fields
lookup
public static ObjectStreamClass lookup(Class<?> cl)
-
Find the descriptor for a class that can be serialized. Creates an ObjectStreamClass instance if one does not exist yet for class. Null is returned if the specified class does not implement java.io.Serializable or java.io.Externalizable.
-
-
-
Parameters:
-
cl
- class for which to get the descriptor
-
Returns:
-
the class descriptor for the specified class
getName
public String getName()
-
The name of the class described by this descriptor.
-
-
-
Returns:
-
a
String
representing the fully qualified name of the class
getSerialVersionUID
public 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. NonSerializable classes have a serialVersionUID of 0L.
-
-
-
Returns:
-
the SUID of the class described by this descriptor
forClass
public 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:
-
the
Class
instance that this descriptor represents
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:
-
1.2
getField
public ObjectStreamField getField(String name)
-
Get the field of this class by name.
-
-
-
Parameters:
-
name
- the name of the data field to look for
-
Returns:
-
The ObjectStreamField object of the named field or null if there is no such named field.
toString
public String toString()
-
Return a string describing this ObjectStreamClass.
-
-
Overrides:
-
toString
in class Object
-
-
Returns:
-
a string representation of the object.
Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4