Package org.jboss.marshalling
Class Pair.Externalizer
java.lang.Object
org.jboss.marshalling.Pair.Externalizer
- All Implemented Interfaces:
Externalizable
,Serializable
,Externalizer
An externalizer for
Pair
instances.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Pair.Externalizer
private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateExternal
(Class<?> subjectType, ObjectInput input, Creator defaultCreator) Create an instance of a type.static Pair.Externalizer
Get the single instance.void
void
readExternal
(Object subject, ObjectInput input) Read the external representation of an object.protected Object
Resolve the object to the single externalizer instance.void
void
writeExternal
(Object subject, ObjectOutput output) Write the external representation of an object.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
instance
-
-
Constructor Details
-
Externalizer
public Externalizer()
-
-
Method Details
-
getInstance
Get the single instance. Though multiple instances can be created using the public constructor, only a single instance need be used in practice since this class maintains no internal state.- Returns:
- the instance
-
writeExternal
Write the external representation of an object. The object's class and the externalizer's class will already have been written.- Specified by:
writeExternal
in interfaceExternalizer
- Parameters:
subject
- the object to externalizeoutput
- the output- Throws:
IOException
- if an error occurs
-
createExternal
public Object createExternal(Class<?> subjectType, ObjectInput input, Creator defaultCreator) throws IOException, ClassNotFoundException Create an instance of a type. The object may then be initialized frominput
, or that may be deferred to thereadExternal()
method. Instances may simply delegate the task to the givenCreator
. 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.- Specified by:
createExternal
in interfaceExternalizer
- Parameters:
subjectType
- the type of object to createinput
- the inputdefaultCreator
- the configured creator- Returns:
- the new instance
- Throws:
IOException
- if an error occursClassNotFoundException
- if a class could not be found during read
-
readExternal
Read the external representation of an object. The object will already be instantiated, but may be uninitialized, when this method is called.- Specified by:
readExternal
in interfaceExternalizer
- Parameters:
subject
- the object to readinput
- the input
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
-
readResolve
Resolve the object to the single externalizer instance.- Returns:
- the instance
-