|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.ObjectStreamField
public class ObjectStreamField
This class intends to describe the field of a class for the serialization subsystem. Serializable fields in a serializable class can be explicitly exported using an array of ObjectStreamFields.
Constructor Summary | |
---|---|
ObjectStreamField(String name,
Class<?> type)
This constructor creates an ObjectStreamField instance which represents a field named name and is
of the type type . |
|
ObjectStreamField(String name,
Class<?> type,
boolean unshared)
This constructor creates an ObjectStreamField instance which represents a field named name and is
of the type type . |
Method Summary | |
---|---|
int |
compareTo(Object obj)
Compares this object to the given object. |
String |
getName()
This method returns the name of the field represented by the ObjectStreamField instance. |
int |
getOffset()
This method returns the current offset of the field in the serialization stream relatively to the other fields. |
Class<?> |
getType()
This method returns the class representing the type of the field which is represented by this instance of ObjectStreamField. |
char |
getTypeCode()
This method returns the char encoded type of the field which is represented by this instance of ObjectStreamField. |
String |
getTypeString()
This method returns a more explicit type name than getTypeCode() in the case the type is a real
class (and not a primitive). |
boolean |
isPrimitive()
This method returns true if the type of the field represented by this instance is a primitive. |
boolean |
isUnshared()
This method returns whether the field represented by this object is unshared or not. |
protected void |
setOffset(int off)
This method sets the current offset of the field. |
String |
toString()
Returns a string representing this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ObjectStreamField(String name, Class<?> type)
name
and is
of the type type
.
name
- Name of the field to export.type
- Type of the field in the concerned class.public ObjectStreamField(String name, Class<?> type, boolean unshared)
name
and is
of the type type
.
name
- Name of the field to export.type
- Type of the field in the concerned class.unshared
- true if field will be unshared, false otherwise.Method Detail |
---|
public String getName()
public Class<?> getType()
public char getTypeCode()
public String getTypeString()
getTypeCode()
in the case the type is a real
class (and not a primitive).
public int getOffset()
setOffset(int)
protected void setOffset(int off)
off
- The offset of the field in bytes.getOffset()
public boolean isUnshared()
public boolean isPrimitive()
public int compareTo(Object obj)
compareTo
in interface Comparable<Object>
obj
- the object to compare to.
public String toString()
toString
in class Object
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |