📜  Java.io.ObjectStreamClass类

📅  最后修改于: 2020-11-15 02:47:21             🧑  作者: Mango


介绍

Java.io.ObjectStreamClass类是类的序列化描述符。它包含该类的名称和serialVersionUID。可以使用查找方法找到/创建此Java VM中加载的特定类的ObjectStreamClass。

类声明

以下是Java.io.ObjectStreamClass类的声明-

public class ObjectStreamClass
   extends Object
      implements Serializable

领域

以下是Java.io.ObjectStreamClass类的字段-

  • 静态ObjectStreamField [] NO_FIELDS-这是serialPersistentFields值,指示没有可序列化的字段。

类方法

Sr.No. Method & Description
1 Class forClass()

This method returns the class in the local VM that this version is mapped to.

2 ObjectStreamField getField(String name)

This method gets the field of this class by name.

3 ObjectStreamField[] getFields()

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

4 String getName()

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

5 long getSerialVersionUID()

This method returns the serialVersionUID for this class.

6 static ObjectStreamClass lookup(Class cl)

This method finds the descriptor for a class that can be serialized.

7 static ObjectStreamClass lookupAny(Class cl)

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

8 String toString()

This method returns a string describing this ObjectStreamClass.

方法继承

此类从以下类继承方法-

  • Java对象