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 theMarshallerinterface. Most of the write methods delegate directly to the current data output.
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassExternalizerFactoryclassExternalizerFactoryThe configured class externalizer factory.protected ClassResolverclassResolverThe configured class resolver.protected ClassTableclassTableThe configured class table.protected intconfiguredVersionThe configured version to write.protected ExceptionListenerexceptionListenerThe configured exception listener.protected ObjectResolverobjectPreResolverThe configured pre object resolver.protected ObjectResolverobjectResolverThe configured object resolver.protected ObjectTableobjectTableThe configured object table.protected SerializabilityCheckerserializabilityCheckerThe configured serializability checker.protected StreamHeaderstreamHeaderThe 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 protectedAbstractMarshaller(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration)Construct a new marshaller instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidfinish()Finish writing to a stream.voidstart(ByteOutput byteOutput)Begin writing to a stream.voidwriteObject(Object obj)voidwriteObjectUnshared(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:
startin interfaceMarshaller- Overrides:
startin classSimpleDataOutput- Parameters:
byteOutput- the new stream- Throws:
IOException- if an error occurs
-
writeObjectUnshared
public final void writeObjectUnshared(Object obj) throws IOException
- Specified by:
writeObjectUnsharedin interfaceMarshaller- Overrides:
writeObjectUnsharedin 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:
writeObjectin interfaceObjectOutput- Overrides:
writeObjectin classAbstractObjectOutput- Throws:
IOException
-
finish
public void finish() throws IOExceptionFinish writing to a stream. The stream is released. No further writing may be done until theSimpleDataOutput.start(ByteOutput)method is again invoked.- Specified by:
finishin interfaceMarshaller- Overrides:
finishin classSimpleDataOutput- Throws:
IOException- if an error occurs
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectOutput- Overrides:
closein classSimpleDataOutput- Throws:
IOException
-
-