public static final class Pair.Externalizer extends java.lang.Object implements Externalizer, java.io.Externalizable
Pair
instances.Constructor and Description |
---|
Externalizer() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
createExternal(java.lang.Class<?> subjectType,
java.io.ObjectInput input,
Creator defaultCreator)
Create an instance of a type.
|
static Pair.Externalizer |
getInstance()
Get the single instance.
|
void |
readExternal(java.io.ObjectInput in) |
void |
readExternal(java.lang.Object subject,
java.io.ObjectInput input)
Read the external representation of an object.
|
protected java.lang.Object |
readResolve()
Resolve the object to the single externalizer instance.
|
void |
writeExternal(java.lang.Object subject,
java.io.ObjectOutput output)
Write the external representation of an object.
|
void |
writeExternal(java.io.ObjectOutput out) |
public static Pair.Externalizer getInstance()
public void writeExternal(java.lang.Object subject, java.io.ObjectOutput output) throws java.io.IOException
writeExternal
in interface Externalizer
subject
- the object to externalizeoutput
- the outputjava.io.IOException
- if an error occurspublic java.lang.Object createExternal(java.lang.Class<?> subjectType, java.io.ObjectInput input, Creator defaultCreator) throws java.io.IOException, java.lang.ClassNotFoundException
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.createExternal
in interface Externalizer
subjectType
- the type of object to createinput
- the inputdefaultCreator
- the configured creatorjava.io.IOException
- if an error occursjava.lang.ClassNotFoundException
- if a class could not be found during readpublic void readExternal(java.lang.Object subject, java.io.ObjectInput input)
readExternal
in interface Externalizer
subject
- the object to readinput
- the inputpublic void writeExternal(java.io.ObjectOutput out)
writeExternal
in interface java.io.Externalizable
public void readExternal(java.io.ObjectInput in)
readExternal
in interface java.io.Externalizable
protected java.lang.Object readResolve()
Copyright © 2011 JBoss, a division of Red Hat, Inc.