Package com.sun.corba.ee.impl.io
Class ObjectStreamClass
java.lang.Object
com.sun.corba.ee.impl.io.ObjectStreamClass
- All Implemented Interfaces:
Serializable
A ObjectStreamClass describes a class that can be serialized to a stream
or a class that was serialized to a stream. It contains the name
and the serialVersionUID of the class.
The ObjectStreamClass for a specific class loaded in this Java VM can be found using the lookup method.
The ObjectStreamClass for a specific class loaded in this Java VM can be found using the lookup method.
- Since:
- JDK1.1
- Version:
- ObjectStreamClass.java 1.17 99/06/07
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
private static class
private static class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long
private String
private static final org.glassfish.pfl.basic.reflection.Bridge
static final int
private static Comparator
<Class<?>> private static Comparator
<Member> private static final Comparator
<ObjectStreamField> Comparator for ObjectStreamFields by nameprivate Constructor
<?> private static final boolean
private static final org.glassfish.pfl.basic.concurrent.SoftCache
<Class<?>, ObjectStreamClass> private boolean
static final int
private ObjectStreamField[]
(package private) boolean
private boolean
private boolean
Flag indicating whether or not this instance has successfully completed initialization.private boolean
static final long
private final Object
static final int
private String
static final ObjectStreamField[]
Set serialPersistentFields of a Serializable class to this value to denote that the class has no Serializable fields.(package private) int
private Class
<?> private static final ObjectStreamClass.PersistentFieldsValue
(package private) int
private MethodHandle
private MethodHandle
private String
Beginning in Java to IDL ptc/02-01-12, RMI-IIOP has a stream format version 2 which puts a fake valuetype around a Serializable's optional custom data.private boolean
private static final long
use serialVersionUID from JDK 1.1.private long
private String
private ObjectStreamClass
private MethodHandle
private MethodHandle
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ObjectStreamClass
(Class<?> cl, ObjectStreamClass superdesc, boolean serial, boolean extern) (package private)
ObjectStreamClass
(String n, long s) -
Method Summary
Modifier and TypeMethodDescriptionprivate static long
_computeSerialVersionUID
(Class<?> cl) (package private) static boolean
compareClassNames
(String streamName, String localName, char pkgSeparator) private void
private String
Java to IDL ptc-02-01-12 1.5.1 "The rep_id string passed to the start_value method must be 'RMI:org.omg.custom.class:hashcode:suid' where class is the fully-qualified name of the class whose writeObject method is being invoked and hashcode and suid are the class's hashcode and SUID."private static long
computeStructuralUID
(ObjectStreamClass osc, Class<?> cl) final Class
<?> forClass()
Return the class in the local VM that this version is mapped to.final long
Return the actual (computed) serialVersionUID for this class.static final long
getActualSerialVersionUID
(Class<?> clazz) Return the actual (computed) serialVersionUID for this class.final String
Return the actual (computed) serialVersionUID for this class.final ObjectStreamField
Get the field of this class by name.Return an array of the fields of this serializable class.(package private) final ObjectStreamField[]
final String
getName()
The name of the class described by this descriptor.(package private) MethodHandle
final String
This will return null if there is no writeObject method.final long
Return the serialVersionUID for this class.static final long
getSerialVersionUID
(Class<?> clazz) Return the serialVersionUID for this class.final String
Return the serialVersionUID string for this class.(package private) static String
getSignature
(Class<?> clazz) Compute the JVM signature for the class.(package private) static String
getSignature
(Constructor<?> cons) (package private) static String
getSignature
(Method meth) (package private) final ObjectStreamClass
(package private) MethodHandle
(package private) boolean
boolean
hasField
(ValueMember field) (package private) final boolean
Return whether the class has a readObject method(package private) final boolean
private void
init()
(package private) final boolean
Returns when or not this class should be custom marshaled (use chunking).(package private) boolean
(package private) boolean
(package private) boolean
(package private) static final ObjectStreamClass
Find the descriptor for a class that can be serialized.(package private) static ObjectStreamClass
lookupInternal
(Class<?> cl) private static void
(package private) Object
Creates a new instance of the represented class.readResolve
(Object value) (package private) final void
final String
toString()
Return a string describing this ObjectStreamClass.static final ObjectStreamField[]
translateFields
(ObjectStreamField[] fields) (package private) final boolean
typeEquals
(ObjectStreamClass other) writeReplace
(Serializable value)
-
Field Details
-
DEBUG_SVUID
private static final boolean DEBUG_SVUID- See Also:
-
kDefaultUID
public static final long kDefaultUID- See Also:
-
isEnum
private boolean isEnum -
bridge
private static final org.glassfish.pfl.basic.reflection.Bridge bridge -
persistentFieldsValue
-
CLASS_MASK
public static final int CLASS_MASK- See Also:
-
FIELD_MASK
public static final int FIELD_MASK- See Also:
-
METHOD_MASK
public static final int METHOD_MASK- See Also:
-
descriptorFor
private static final org.glassfish.pfl.basic.concurrent.SoftCache<Class<?>,ObjectStreamClass> descriptorFor -
name
-
superclass
-
serializable
private boolean serializable -
externalizable
private boolean externalizable -
fields
-
ofClass
-
forProxyClass
boolean forProxyClass -
suid
private long suid -
suidStr
-
actualSuid
private long actualSuid -
actualSuidStr
-
primBytes
int primBytes -
objFields
int objFields -
initialized
private boolean initializedFlag indicating whether or not this instance has successfully completed initialization. This is to try to fix bug 4373844. Working to move to reusing java.io.ObjectStreamClass for JDK 1.5. -
lock
-
hasExternalizableBlockData
private boolean hasExternalizableBlockData -
writeObjectMethod
-
readObjectMethod
-
writeReplaceObjectMethod
-
readResolveObjectMethod
-
cons
-
rmiiiopOptionalDataRepId
Beginning in Java to IDL ptc/02-01-12, RMI-IIOP has a stream format version 2 which puts a fake valuetype around a Serializable's optional custom data. This valuetype has a special repository ID made from the Serializable's information which we are pre-computing and storing here. -
serialVersionUID
private static final long serialVersionUIDuse serialVersionUID from JDK 1.1. for interoperability- See Also:
-
NO_FIELDS
Set serialPersistentFields of a Serializable class to this value to denote that the class has no Serializable fields. -
compareClassByName
-
compareObjStrFieldsByName
Comparator for ObjectStreamFields by name -
compareMemberByName
-
-
Constructor Details
-
ObjectStreamClass
-
ObjectStreamClass
ObjectStreamClass(String n, long s)
-
-
Method Details
-
lookup
Find the descriptor for a class that can be serialized. Null is returned if the specified class does not implement java.io.Serializable or java.io.Externalizable. -
lookupInternal
-
getName
The name of the class described by this descriptor.- Returns:
- name of class
-
getSerialVersionUID
Return the serialVersionUID for this class. The serialVersionUID defines a set of classes all with the same name that have evolved from a common root class and agree to be serialized and deserialized using a common format.- Parameters:
clazz
- class to get UID of- Returns:
- UID for the class
-
getSerialVersionUID
public final long getSerialVersionUID()Return the serialVersionUID for this class. The serialVersionUID defines a set of classes all with the same name that have evolved from a common root class and agree to be serialized and deserialized using a common format.- Returns:
- SerialVersionUID for this class.
-
getSerialVersionUIDStr
Return the serialVersionUID string for this class. The serialVersionUID defines a set of classes all with the same name that have evolved from a common root class and agree to be serialized and deserialized using a common format.- Returns:
- UID for this class
-
getActualSerialVersionUID
Return the actual (computed) serialVersionUID for this class.- Parameters:
clazz
- Class to get UID of- Returns:
- The class UID
-
getActualSerialVersionUID
public final long getActualSerialVersionUID()Return the actual (computed) serialVersionUID for this class.- Returns:
- UID for this class
-
getActualSerialVersionUIDStr
Return the actual (computed) serialVersionUID for this class.- Returns:
- UID for this class
-
forClass
Return the class in the local VM that this version is mapped to. Null is returned if there is no corresponding local class.- Returns:
- Class this is mapped to
-
getFields
Return an array of the fields of this serializable class.- Returns:
- an array containing an element for each persistent field of this class. Returns an array of length zero if there are no fields.
- Since:
- JDK1.2
-
hasField
-
getFieldsNoCopy
-
getField
Get the field of this class by name.- Parameters:
name
- name of the field to get- Returns:
- The ObjectStreamField object of the named field or null if there is no such named field.
-
writeReplace
-
readResolve
-
toString
Return a string describing this ObjectStreamClass. -
getWriteObjectMethod
MethodHandle getWriteObjectMethod() -
getReadObjectMethod
MethodHandle getReadObjectMethod() -
init
private void init() -
computeRMIIIOPOptionalDataRepId
Java to IDL ptc-02-01-12 1.5.1 "The rep_id string passed to the start_value method must be 'RMI:org.omg.custom.class:hashcode:suid' where class is the fully-qualified name of the class whose writeObject method is being invoked and hashcode and suid are the class's hashcode and SUID." -
getRMIIIOPOptionalDataRepId
This will return null if there is no writeObject method.- Returns:
- A Serializable's optional custom data fake repository ID.
-
translateFields
-
compareClassNames
-
typeEquals
-
setSuperclass
-
getSuperclass
-
hasReadObject
final boolean hasReadObject()Return whether the class has a readObject method -
hasWriteObject
final boolean hasWriteObject() -
isCustomMarshaled
final boolean isCustomMarshaled()Returns when or not this class should be custom marshaled (use chunking). This should happen if it is Externalizable OR if it or any of its superclasses has a writeObject method, -
hasExternalizableBlockDataMode
boolean hasExternalizableBlockDataMode() -
newInstance
Object newInstance() throws InstantiationException, InvocationTargetException, UnsupportedOperationExceptionCreates a new instance of the represented class. If the class is externalizable, invokes its public no-arg constructor; otherwise, if the class is serializable, invokes the no-arg constructor of the first non-serializable superclass. Throws UnsupportedOperationException if this class descriptor is not associated with a class, if the associated class is non-serializable or if the appropriate no-arg constructor is inaccessible/unavailable. -
isSerializable
boolean isSerializable() -
isExternalizable
boolean isExternalizable() -
isNonSerializable
boolean isNonSerializable() -
computeFieldInfo
private void computeFieldInfo() -
msg
-
_computeSerialVersionUID
-
computeStructuralUID
-
getSignature
Compute the JVM signature for the class. -
getSignature
-
getSignature
-