|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.ObjectStreamClass
public class ObjectStreamClass
Instances of ObjectStreamClass are used to describe classes of objects used by serialization. When objects are saved, information about all its superclasses is also saved by the use of descriptors, instances of ObjectStreamClass. These descriptors carry information about the class they represent, such as - The name of the class - SUID of the class - Field names and types
ObjectOutputStream,
ObjectInputStream,
Class,
Serialized Form| Field Summary | |
|---|---|
(package private) static Class<?> |
ARRAY_OF_FIELDS
|
(package private) static Class<?> |
CLASSCLASS
|
(package private) static Class<?>[] |
EMPTY_CONSTRUCTOR_PARAM_TYPES
|
static ObjectStreamField[] |
NO_FIELDS
A value that indicates the class has no Serializable fields |
(package private) static Class<ObjectStreamClass> |
OBJECTSTREAMCLASSCLASS
|
(package private) static Class<String> |
STRINGCLASS
|
(package private) static Class<?>[] |
UNSHARED_PARAM_TYPES
|
| Constructor Summary | |
|---|---|
ObjectStreamClass()
Constructs a new instance of this class. |
|
| Method Summary | |
|---|---|
(package private) void |
buildFieldDescriptors(Field[] declaredFields)
Builds the collection of field descriptors for the receiver |
(package private) ObjectStreamField[] |
fields()
Returns the collection of field descriptors for the fields of the corresponding class |
(package private) static Field |
fieldSerialPersistentFields(Class<?> cl)
Return the java.lang.reflect.Field serialPersistentFields
if class cl implements it. |
Class<?> |
forClass()
Return the class (java.lang.Class) that the receiver represents |
(package private) static String |
getConstructorSignature(Constructor<?> c)
Return a String representing the signature for a Constructor c. |
ObjectStreamField |
getField(String name)
Returns a given field by name. |
ObjectStreamField[] |
getFields()
Returns the collection of field descriptors for the fields of the corresponding class |
(package private) byte |
getFlags()
Returns the flags for this descriptor, where possible combined values are ObjectStreamConstants.SC_WRITE_METHOD ObjectStreamConstants.SC_SERIALIZABLE ObjectStreamConstants.SC_EXTERNALIZABLE |
(package private) ObjectStreamField[] |
getLoadFields()
Returns the collection of field descriptors for the input fields of the corresponding class |
(package private) static String |
getMethodSignature(Method m)
Return a String representing the signature for a method m. |
String |
getName()
Returns the name of the class represented by the receiver |
(package private) static Method |
getPrivateReadObjectMethod(Class<?> cl)
Return true if the given class cl implements private
method readObject(). |
(package private) static Method |
getPrivateReadObjectNoDataMethod(Class<?> cl)
Return true if the given class cl implements private
method readObject(). |
(package private) static Method |
getPrivateWriteObjectMethod(Class<?> cl)
Return true if the given class cl implements private
method writeObject(). |
long |
getSerialVersionUID()
Returns the Serial Version User ID of the class represented by the receiver |
(package private) ObjectStreamClass |
getSuperclass()
Returns the descriptor (ObjectStreamClass) of the superclass of the class represented by the receiver. |
(package private) static boolean |
isExternalizable(Class<?> cl)
Return true if instances of class cl are Externalizable,
false otherwise. |
(package private) static boolean |
isPrimitiveType(char typecode)
Return true if the type code typecode |
(package private) static boolean |
isSerializable(Class<?> cl)
Return true if instances of class cl are Serializable,
false otherwise. |
static ObjectStreamClass |
lookup(Class<?> cl)
Return the descriptor (ObjectStreamClass) corresponding to the class cl. |
(package private) static ObjectStreamClass |
lookupStreamClass(Class<?> cl)
Return the descriptor (ObjectStreamClass) corresponding to the class cl. |
(package private) static Method |
methodReadResolve(Class<?> cl)
Return the java.lang.reflect.Method readResolve if class
cl implements it. |
(package private) static Method |
methodWriteReplace(Class<?> cl)
Return the java.lang.reflect.Method writeReplace if class
cl implements it. |
(package private) void |
setClass(Class<?> c)
Set the class (java.lang.Class) that the receiver represents |
(package private) void |
setFields(ObjectStreamField[] f)
Set the collection of field descriptors for the fields of the corresponding class |
(package private) void |
setFlags(byte b)
Set the flags for this descriptor, where possible combined values are ObjectStreamConstants.SC_WRITE_METHOD ObjectStreamConstants.SC_SERIALIZABLE ObjectStreamConstants.SC_EXTERNALIZABLE |
(package private) void |
setLoadFields(ObjectStreamField[] f)
Set the collection of field descriptors for the input fields of the corresponding class |
(package private) void |
setName(String newName)
Set the name of the class represented by the receiver |
(package private) void |
setSerialVersionUID(long l)
Set the Serial Version User ID of the class represented by the receiver |
(package private) void |
setSuperclass(ObjectStreamClass c)
Set the descriptor for the superclass of the class described by the receiver |
String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final Class<?>[] EMPTY_CONSTRUCTOR_PARAM_TYPES
static final Class<?>[] UNSHARED_PARAM_TYPES
public static final ObjectStreamField[] NO_FIELDS
static final Class<?> ARRAY_OF_FIELDS
static final Class<String> STRINGCLASS
static final Class<?> CLASSCLASS
static final Class<ObjectStreamClass> OBJECTSTREAMCLASSCLASS
| Constructor Detail |
|---|
ObjectStreamClass()
| Method Detail |
|---|
void buildFieldDescriptors(Field[] declaredFields)
declaredFields - collection of java.lang.reflect.Field for which to compute
field descriptorsstatic Field fieldSerialPersistentFields(Class<?> cl)
serialPersistentFields
if class cl implements it. Return null otherwise.
cl - a java.lang.Class which to test
java.lang.reflect.Field if the class has
serialPersistentFields null if the class does not
have serialPersistentFieldspublic Class<?> forClass()
null if there is no corresponding class for the
receiver Class The loaded class corresponding to
the receiverstatic String getConstructorSignature(Constructor<?> c)
c.
c - a java.lang.reflect.Constructor for which to compute the
signature
public ObjectStreamField getField(String name)
name - name of the desired field.
ObjectStreamField[] fields()
public ObjectStreamField[] getFields()
ObjectStreamField[] getLoadFields()
byte getFlags()
static String getMethodSignature(Method m)
m.
m - a java.lang.reflect.Method for which to compute the signature
public String getName()
public long getSerialVersionUID()
ObjectStreamClass getSuperclass()
static Method getPrivateReadObjectMethod(Class<?> cl)
cl implements private
method readObject().
cl - a java.lang.Class which to test
true if the class implements readObject
false if the class does not implement readObjectstatic Method getPrivateReadObjectNoDataMethod(Class<?> cl)
cl implements private
method readObject().
cl - a java.lang.Class which to test
true if the class implements readObject
false if the class does not implement readObjectstatic Method getPrivateWriteObjectMethod(Class<?> cl)
cl implements private
method writeObject().
cl - a java.lang.Class which to test
true if the class implements writeObject
false if the class does not implement writeObjectstatic boolean isExternalizable(Class<?> cl)
cl are Externalizable,
false otherwise.
cl - a java.lang.Class which to test
true if instances of the class are Externalizable
false if instances of the class are not
ExternalizableObject.hashCode()static boolean isPrimitiveType(char typecode)
typecode describes a primitive type
- Parameters:
typecode - a char describing the typecode
- Returns:
true if the typecode represents a primitive type
false if the typecode represents an Object type (including arrays)- See Also:
Object.hashCode()
static boolean isSerializable(Class<?> cl)
cl are Serializable,
false otherwise.
cl - a java.lang.Class which to test
true if instances of the class are Serializable
false if instances of the class are not
SerializableObject.hashCode()public static ObjectStreamClass lookup(Class<?> cl)
cl. If the class is not Serializable or Externalizable,
null is returned.
cl - a java.langClass for which to obtain the corresponding
descriptor
null if instances of the class cl
are not Serializable or Externalizable
ObjectStreamClass The corresponding descriptor if
the class cl is Serializable or Externalizablestatic ObjectStreamClass lookupStreamClass(Class<?> cl)
cl. Returns an ObjectStreamClass even if instances of the
class cannot be serialized
cl - a java.langClass for which to obtain the corresponding
descriptor
static Method methodReadResolve(Class<?> cl)
readResolve if class
cl implements it. Return null otherwise.
cl - a java.lang.Class which to test
java.lang.reflect.Method if the class implements
readResolve null if the class does not implement
readResolvestatic Method methodWriteReplace(Class<?> cl)
writeReplace if class
cl implements it. Return null otherwise.
cl - a java.lang.Class which to test
java.lang.reflect.Method if the class implements
writeReplace null if the class does not implement
writeReplacevoid setClass(Class<?> c)
c - aClass, the new class that the receiver describesvoid setFields(ObjectStreamField[] f)
f - ObjectStreamField[], the receiver's new collection of declared
fields for the class it representsvoid setLoadFields(ObjectStreamField[] f)
f - ObjectStreamField[], the receiver's new collection of input
fields for the class it representsvoid setFlags(byte b)
b - byte, the receiver's new flags for the class it representsvoid setName(String newName)
newName - a String, the new fully qualified name of the class the
receiver representsvoid setSerialVersionUID(long l)
l - a long, the new SUID for the class represented by the receivervoid setSuperclass(ObjectStreamClass c)
c - an ObjectStreamClass, the new ObjectStreamClass for the
superclass of the class represented by the receiverpublic String toString()
toString in class Object
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||