Package org.jboss.marshalling.serial
Class ExternalizedObject
- java.lang.Object
-
- org.jboss.marshalling.serial.ExternalizedObject
-
- All Implemented Interfaces:
Externalizable
,Serializable
,Creator
public final class ExternalizedObject extends Object implements Externalizable, Creator
An externalized object. This wrapper allows an object that was written with anExternalizer
to be read by standard Java serialization. Note that if an externalized object's child object graph ever refers to the original object, there will be an error in the reconstructed object graph such that those references will refer to this wrapper object rather than the properly externalized object.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ExternalizedObject()
ExternalizedObject(Externalizer externalizer, Object obj)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
create(Class<T> clazz)
Create an object instance.void
readExternal(ObjectInput in)
protected Object
readResolve()
Return the externalized object afterreadExternal()
completes.void
writeExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
ExternalizedObject
public ExternalizedObject()
-
ExternalizedObject
public ExternalizedObject(Externalizer externalizer, Object obj)
-
-
Method Detail
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
readResolve
protected Object readResolve()
Return the externalized object afterreadExternal()
completes.- Returns:
- the externalized object
- Throws:
ObjectStreamException
- never
-
create
public <T> T create(Class<T> clazz) throws InvalidClassException
Create an object instance.- Specified by:
create
in interfaceCreator
- Parameters:
clazz
- the type of object to create- Returns:
- the object instance
- Throws:
InvalidClassException
- if an instance of the class could not be instantiated for some reason
-
-