Package org.jboss.marshalling
Class AbstractMarshaller
- java.lang.Object
-
- java.io.OutputStream
-
- org.jboss.marshalling.SimpleByteOutput
-
- org.jboss.marshalling.ByteOutputStream
-
- org.jboss.marshalling.SimpleDataOutput
-
- org.jboss.marshalling.AbstractObjectOutput
-
- org.jboss.marshalling.AbstractMarshaller
-
- All Implemented Interfaces:
Closeable
,DataOutput
,Flushable
,ObjectOutput
,AutoCloseable
,ByteOutput
,Marshaller
public abstract class AbstractMarshaller extends AbstractObjectOutput implements Marshaller
An abstract implementation of theMarshaller
interface. Most of the write methods delegate directly to the current data output.
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassExternalizerFactory
classExternalizerFactory
The configured class externalizer factory.protected ClassResolver
classResolver
The configured class resolver.protected ClassTable
classTable
The configured class table.protected int
configuredVersion
The configured version to write.protected ExceptionListener
exceptionListener
The configured exception listener.protected ObjectResolver
objectPreResolver
The configured pre object resolver.protected ObjectResolver
objectResolver
The configured object resolver.protected ObjectTable
objectTable
The configured object table.protected SerializabilityChecker
serializabilityChecker
The configured serializability checker.protected StreamHeader
streamHeader
The configured stream header.-
Fields inherited from class org.jboss.marshalling.SimpleDataOutput
buffer, bufferSize
-
Fields inherited from class org.jboss.marshalling.ByteOutputStream
byteOutput
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMarshaller(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration)
Construct a new marshaller instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
finish()
Finish writing to a stream.void
start(ByteOutput byteOutput)
Begin writing to a stream.void
writeObject(Object obj)
void
writeObjectUnshared(Object obj)
-
Methods inherited from class org.jboss.marshalling.AbstractObjectOutput
doWriteObject
-
Methods inherited from class org.jboss.marshalling.SimpleDataOutput
flush, shallowFlush, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.marshalling.ByteOutput
write, write, write
-
Methods inherited from interface java.io.DataOutput
writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Methods inherited from interface org.jboss.marshalling.Marshaller
clearClassCache, clearInstanceCache
-
Methods inherited from interface java.io.ObjectOutput
flush, write, write, write
-
-
-
-
Field Detail
-
classExternalizerFactory
protected final ClassExternalizerFactory classExternalizerFactory
The configured class externalizer factory.
-
streamHeader
protected final StreamHeader streamHeader
The configured stream header.
-
classResolver
protected final ClassResolver classResolver
The configured class resolver.
-
objectResolver
protected final ObjectResolver objectResolver
The configured object resolver.
-
objectPreResolver
protected final ObjectResolver objectPreResolver
The configured pre object resolver.
-
classTable
protected final ClassTable classTable
The configured class table.
-
objectTable
protected final ObjectTable objectTable
The configured object table.
-
exceptionListener
protected final ExceptionListener exceptionListener
The configured exception listener.
-
serializabilityChecker
protected final SerializabilityChecker serializabilityChecker
The configured serializability checker.
-
configuredVersion
protected final int configuredVersion
The configured version to write.
-
-
Constructor Detail
-
AbstractMarshaller
protected AbstractMarshaller(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration)
Construct a new marshaller instance.- Parameters:
marshallerFactory
- the marshaller factoryconfiguration
-
-
-
Method Detail
-
start
public void start(ByteOutput byteOutput) throws IOException
Begin writing to a stream.- Specified by:
start
in interfaceMarshaller
- Overrides:
start
in classSimpleDataOutput
- Parameters:
byteOutput
- the new stream- Throws:
IOException
- if an error occurs
-
writeObjectUnshared
public final void writeObjectUnshared(Object obj) throws IOException
- Specified by:
writeObjectUnshared
in interfaceMarshaller
- Overrides:
writeObjectUnshared
in classAbstractObjectOutput
- Parameters:
obj
- the object to be written- Throws:
IOException
- if an error occurs
-
writeObject
public final void writeObject(Object obj) throws IOException
- Specified by:
writeObject
in interfaceObjectOutput
- Overrides:
writeObject
in classAbstractObjectOutput
- Throws:
IOException
-
finish
public void finish() throws IOException
Finish writing to a stream. The stream is released. No further writing may be done until theSimpleDataOutput.start(ByteOutput)
method is again invoked.- Specified by:
finish
in interfaceMarshaller
- Overrides:
finish
in classSimpleDataOutput
- Throws:
IOException
- if an error occurs
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectOutput
- Overrides:
close
in classSimpleDataOutput
- Throws:
IOException
-
-