Top Description Methods
org.jboss.marshalling

public Interface Externalizer

extends Serializable
Known Direct Implementers
org.jboss.marshalling.Pair.Externalizer
Imports
java.io.IOException, .ObjectOutput, .ObjectInput, .Serializable

A replacement serializer for an object class.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the new instance
createExternal
(Class<?>
the type of object to create
subjectType
,
ObjectInput
the input
input
)

Create an instance of a type.

public void
writeExternal(Object
the object to externalize
subject
,
ObjectOutput
the output
output
)

Write the external representation of an object.

Method Detail

createExternalback to summary
public Object createExternal(Class<?> subjectType, ObjectInput input) throws IOException, ClassNotFoundException

Create an instance of a type. The object may then be initialized from input, or that may be deferred to the readExternal() method. Instances may simply delegate the task to the given Creator. Note that this method is called only on the leaf class, so externalizers for non-final classes that initialize the instance from the stream need to be aware of this.

Parameters
subjectType:Class<?>

the type of object to create

input:ObjectInput

the input

Returns:Object

the new instance

Exceptions
IOException:
if an error occurs
ClassNotFoundException:
if a class could not be found during read
writeExternalback to summary
public void writeExternal(Object subject, ObjectOutput output) throws IOException

Write the external representation of an object. The object's class and the externalizer's class will already have been written.

Parameters
subject:Object

the object to externalize

output:ObjectOutput

the output

Exceptions
IOException:
if an error occurs