ObjectStreamClass
Modifier and Type | Field and Description |
---|---|
private final Field | field
corresponding reflective field object, if any |
private final String | name
field name |
private int | offset
offset of field value in enclosing field group |
private final String | signature
canonical JVM signature of field type, if given |
private final Class | type
field type (Object.class if unknown non-primitive type) |
private String | typeSignature
lazily constructed signature for the type, if no explicit signature |
private final boolean | unshared
whether or not to (de)serialize field values as unshared |
Access | Constructor and Description |
---|---|
public | ObjectStreamField(String
the name of the serializable field name, Class<?> the type)Class object of the serializable fieldCreate a Serializable field with the specified type. |
public | ObjectStreamField(String
field name name, Class<?> field type type, boolean if false, write/read field values in the same manner
as writeObject/readObject; if true, write/read in the same
manner as writeUnshared/readUnshared unshared)Creates an ObjectStreamField representing a serializable field with the given name and type. |
pack-priv | ObjectStreamField(String name, String signature, boolean unshared)
Creates an ObjectStreamField representing a field with the given name, signature and unshared setting. |
pack-priv | ObjectStreamField(Field field, boolean unshared, boolean showType)
Creates an ObjectStreamField representing the given field with the specified unshared setting. |
Modifier and Type | Method and Description |
---|---|
public int | compareTo(Object
the object to be compared. obj)Implements java. Compare this field with another |
pack-priv Field | getField()
Returns field represented by this ObjectStreamField, or null if ObjectStreamField is not associated with an actual field. |
public String | Returns: aString representing the name of the serializable
fieldGet the name of this field. |
public int | |
pack-priv String | getSignature()
Returns JVM type signature of field (similar to getTypeString, except that signature strings are returned for primitive fields as well). |
public Class | Returns: aClass object representing the type of the
serializable fieldGet the type of the field. |
public char | Returns: the typecode of the serializable fieldReturns character encoding of field type. |
public String | |
public boolean | Returns: true if and only if this field corresponds to a primitive typeReturn true if this field has a primitive type. |
public boolean | Returns: true if this field is unsharedReturns boolean value indicating whether or not the serializable field represented by this ObjectStreamField instance is unshared. |
protected void | |
public String |
field | back to summary |
---|---|
private final Field field corresponding reflective field object, if any |
name | back to summary |
---|---|
private final String name field name |
offset | back to summary |
---|---|
private int offset offset of field value in enclosing field group |
signature | back to summary |
---|---|
private final String signature canonical JVM signature of field type, if given |
type | back to summary |
---|---|
private final Class<?> type field type (Object.class if unknown non-primitive type) |
typeSignature | back to summary |
---|---|
private String typeSignature lazily constructed signature for the type, if no explicit signature |
unshared | back to summary |
---|---|
private final boolean unshared whether or not to (de)serialize field values as unshared |
ObjectStreamField | back to summary |
---|---|
public ObjectStreamField(String name, Class<?> type) Create a Serializable field with the specified type. This field should
be documented with a |
ObjectStreamField | back to summary |
---|---|
public ObjectStreamField(String name, Class<?> type, boolean unshared) Creates an ObjectStreamField representing a serializable field with the given name and type. If unshared is false, values of the represented field are serialized and deserialized in the default manner--if the field is non-primitive, object values are serialized and deserialized as if they had been written and read by calls to writeObject and readObject. If unshared is true, values of the represented field are serialized and deserialized as if they had been written and read by calls to writeUnshared and readUnshared. |
ObjectStreamField | back to summary |
---|---|
pack-priv ObjectStreamField(String name, String signature, boolean unshared) Creates an ObjectStreamField representing a field with the given name, signature and unshared setting. |
ObjectStreamField | back to summary |
---|---|
pack-priv ObjectStreamField(Field field, boolean unshared, boolean showType) Creates an ObjectStreamField representing the given field with the specified unshared setting. For compatibility with the behavior of earlier serialization implementations, a "showType" parameter is necessary to govern whether or not a getType() call on this ObjectStreamField (if non-primitive) will return Object.class (as opposed to a more specific reference type). |
compareTo | back to summary |
---|---|
public int compareTo(Object obj) Implements java. Compare this field with another
|
getField | back to summary |
---|---|
pack-priv Field getField() Returns field represented by this ObjectStreamField, or null if ObjectStreamField is not associated with an actual field. |
getName | back to summary |
---|---|
public String getName() Get the name of this field.
|
getOffset | back to summary |
---|---|
public int getOffset() Offset of field within instance data.
|
getSignature | back to summary |
---|---|
pack-priv String getSignature() Returns JVM type signature of field (similar to getTypeString, except that signature strings are returned for primitive fields as well). |
getType | back to summary |
---|---|
public Class Get the type of the field. If the type is non-primitive and this
|
getTypeCode | back to summary |
---|---|
public char getTypeCode() Returns character encoding of field type. The encoding is as follows: B byte C char D double F float I int J long L class or interface S short Z boolean [ array
|
getTypeString | back to summary |
---|---|
public String getTypeString() Return the JVM type signature.
|
isPrimitive | back to summary |
---|---|
public boolean isPrimitive() Return true if this field has a primitive type.
|
isUnshared | back to summary |
---|---|
public boolean isUnshared() Returns boolean value indicating whether or not the serializable field represented by this ObjectStreamField instance is unshared.
|
setOffset | back to summary |
---|---|
protected void setOffset(int offset) Offset within instance data.
|
toString | back to summary |
---|---|
public String toString() Overrides java. Return a string that describes this field.
|