Name
ObjectStreamField
Synopsis
This class represents a named
field of a specified type (i.e., a
specified Class). When a class serializes itself
by writing a set of fields that are different from the fields it uses
in its own implementation, it defines the set of fields to be written
with an array of ObjectStreamField objects. This
array should be the value of a private static field named
serialPersistentFields. The methods of this class
are used internally by the serialization mechanism and are not
typically used elsewhere. See also
ObjectOutputStream.PutField and
ObjectInputStream.GetField.
Figure 9-41. java.io.ObjectStreamField
public class ObjectStreamField implements Comparable<Object> { // Public Constructors public ObjectStreamField(String name, Class<?> type); 1.4 public ObjectStreamField(String name, Class<?> type, boolean unshared); // Public Instance Methods public String getName( ); public int getOffset( ); public Class<?> getType( ); public char getTypeCode( ); public String getTypeString( ); public boolean isPrimitive( ); 1.4 public boolean isUnshared( ); // Methods Implementing Comparable public int compareTo(Object obj); // Public Methods Overriding Object public String toString( ); // Protected Instance Methods protected void setOffset(int offset); }
Returned By
ObjectStreamClass.{getField( ),
getFields( )}
Type Of
ObjectStreamClass.NO_FIELDS
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access