public abstract class ObjectSerializerFactory extends Object
SerializerUtil
Constructor and Description |
---|
ObjectSerializerFactory() |
Modifier and Type | Method and Description |
---|---|
abstract void |
deserializeXmlStream(InputSource is,
XmlObjectResultsHandler handler,
boolean validate)
Deserializes XML objects from a stream
NOTE: Consider using
SerializerUtil.deserializeXmlObject(String,boolean)
for convenience deserializing a single object. |
static ObjectSerializerFactory |
getInstance()
Get the singleton instance of the
ObjectSerializerFactory . |
abstract BinaryObjectDeserializer |
newBinaryDeserializer(InputStream is)
Creates a
BinaryObjectDeserializer for reading objects from
the given stream. |
abstract BinaryObjectSerializer |
newBinarySerializer(OutputStream os)
Creates a
BinaryObjectSerializer for writing objects to
the given stream. |
abstract XmlObjectSerializer |
newXmlSerializer(Writer w,
boolean includeHeader,
boolean multiObject)
Creates a
BinaryObjectSerializer for writing objects to
the given stream. |
public static ObjectSerializerFactory getInstance()
ObjectSerializerFactory
.public abstract BinaryObjectSerializer newBinarySerializer(OutputStream os)
BinaryObjectSerializer
for writing objects to
the given stream.
NOTE: consider using SerializerUtil.serializeBinaryObject(Object)
for convenience serializing a single object.
NOTE2: do not mix and match SerializerUtil.serializeBinaryObject(Object)
with {newBinaryDeserializer(InputStream)
. This is unsafe since there
is header information and state associated with the stream. Objects written
using one method must be read using the proper corresponding method.os
- The streampublic abstract BinaryObjectDeserializer newBinaryDeserializer(InputStream is)
BinaryObjectDeserializer
for reading objects from
the given stream.
NOTE: Consider using SerializerUtil.deserializeBinaryObject(byte[])
for convenience deserializing a single object.
NOTE2: Do not mix and match SerializerUtil.deserializeBinaryObject(byte[])
with {newBinarySerializer(OutputStream)
. This is unsafe since there
is header information and state associated with the stream. Objects written
using one method must be read using the proper corresponding method.is
- The streampublic abstract XmlObjectSerializer newXmlSerializer(Writer w, boolean includeHeader, boolean multiObject)
BinaryObjectSerializer
for writing objects to
the given stream.
NOTE: consider using SerializerUtil.serializeXmlObject(Object,boolean)
for convenience serializing a single object.
NOTE2: do not mix and match SerializerUtil.serializeXmlObject(Object,boolean)
with {deserializeXmlStream(InputSource, XmlObjectResultsHandler, boolean)
.w
- The writerincludeHeader
- True to include the xml headermultiObject
- Is this to produce a multi-object document. If false, only
a single object may be written.public abstract void deserializeXmlStream(InputSource is, XmlObjectResultsHandler handler, boolean validate)
SerializerUtil.deserializeXmlObject(String,boolean)
for convenience deserializing a single object.
NOTE2: Do not mix and match SerializerUtil.deserializeXmlObject(String,boolean)
with {newXmlSerializer(Writer, boolean, boolean)
.is
- The input sourcehandler
- The callback to receive objects from the streamvalidate
- True if we are to validateCopyright © 2019. All rights reserved.