Package org.jboss.marshalling
Class AbstractExternalizer
java.lang.Object
org.jboss.marshalling.AbstractExternalizer
- All Implemented Interfaces:
Serializable
,Externalizer
An externalizer base class which handles object creation in a default fashion.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateExternal
(Class<?> subjectType, ObjectInput input, Creator defaultCreator) Create an instance of a type using the provided creator.void
readExternal
(Object subject, ObjectInput input) Read the external representation of an object.void
writeExternal
(Object subject, ObjectOutput output) Write the external representation of an object.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
AbstractExternalizer
public AbstractExternalizer()
-
-
Method Details
-
createExternal
public Object createExternal(Class<?> subjectType, ObjectInput input, Creator defaultCreator) throws IOException, ClassNotFoundException Create an instance of a type using the provided creator.- Specified by:
createExternal
in interfaceExternalizer
- Parameters:
subjectType
- the type to createinput
- the object inputdefaultCreator
- the creator- Returns:
- a new instance
- Throws:
IOException
- if an I/O error occursClassNotFoundException
- if the class could not be located
-
writeExternal
Write the external representation of an object. The object's class and the externalizer's class will already have been written. This default implementation does nothing.- Specified by:
writeExternal
in interfaceExternalizer
- Parameters:
subject
- the object to externalizeoutput
- the output- Throws:
IOException
- if an error occurs
-
readExternal
public void readExternal(Object subject, ObjectInput input) throws IOException, ClassNotFoundException Read the external representation of an object. The object will already be instantiated, but may be uninitialized, when this method is called. This default implementation does nothing.- Specified by:
readExternal
in interfaceExternalizer
- Parameters:
subject
- the object to readinput
- the input- Throws:
IOException
- if an error occursClassNotFoundException
- if a class could not be found during read
-