ObjectStreamClass class methods in Java

java.io.ObjectStreamClass

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.

Some methods of ObjectStreamClass class

forClass()This method returns the class to the local VM that this version is mapped to.

getField(String)This method gets the field of this class by name.

getFields()This method returns an array of the fields of this serializable class.

getName()This method returns the name of the class described by this descriptor.

getSerialVersionUID()This method returns the serialVersionUID for this class.

lookup(Class)This method creates an ObjectStreamClass instance if one does not exist yet for the class.

lookupAny(Class)This method returns the descriptor for any class, regardless of whether it implements Serializable.

toString()This method returns a string describing this ObjectStreamClass.

No comments:

Post a Comment