JBoss Marshalling 1.3.0.CR9

org.jboss.marshalling
Class AbstractMarshaller

java.lang.Object
  extended by java.io.OutputStream
      extended by org.jboss.marshalling.SimpleByteOutput
          extended by org.jboss.marshalling.ByteOutputStream
              extended by org.jboss.marshalling.SimpleDataOutput
                  extended by org.jboss.marshalling.AbstractObjectOutput
                      extended by org.jboss.marshalling.AbstractMarshaller
All Implemented Interfaces:
Closeable, DataOutput, Flushable, ObjectOutput, ByteOutput, Marshaller

public abstract class AbstractMarshaller
extends AbstractObjectOutput
implements Marshaller

An abstract implementation of the Marshaller interface. Most of the write methods delegate directly to the current data output.


Field Summary
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  Creator externalizerCreator
          The configured externalized object creator.
protected  ObjectResolver objectResolver
          The configured object resolver.
protected  ObjectTable objectTable
          The configured object table.
protected  SerializabilityChecker serializabilityChecker
          The configured serializability checker.
protected  Creator serializedCreator
          The configured serialized object creator.
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
protected AbstractMarshaller(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration)
          Construct a new marshaller instance.
 
Method Summary
 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.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.marshalling.Marshaller
clearClassCache, clearInstanceCache
 
Methods inherited from interface java.io.ObjectOutput
flush, 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.ByteOutput
write, write, write
 
Methods inherited from interface java.io.Flushable
flush
 

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.


serializedCreator

protected final Creator serializedCreator
The configured serialized object creator.


externalizerCreator

protected final Creator externalizerCreator
The configured externalized object creator.


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 factory
configuration -
Method Detail

start

public void start(ByteOutput byteOutput)
           throws IOException
Begin writing to a stream.

Specified by:
start in interface Marshaller
Overrides:
start in class SimpleDataOutput
Parameters:
byteOutput - the new stream
Throws:
IOException - if an error occurs

writeObjectUnshared

public final void writeObjectUnshared(Object obj)
                               throws IOException

Specified by:
writeObjectUnshared in interface Marshaller
Overrides:
writeObjectUnshared in class AbstractObjectOutput
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 interface ObjectOutput
Overrides:
writeObject in class AbstractObjectOutput
Throws:
IOException

finish

public void finish()
            throws IOException
Finish writing to a stream. The stream is released. No further writing may be done until the SimpleDataOutput.start(ByteOutput) method is again invoked.

Specified by:
finish in interface Marshaller
Overrides:
finish in class SimpleDataOutput
Throws:
IOException - if an error occurs

close

public void close()
           throws IOException

Specified by:
close in interface Closeable
Specified by:
close in interface ObjectOutput
Overrides:
close in class SimpleDataOutput
Throws:
IOException

JBoss Marshalling 1.3.0.CR9

Copyright © 2011 JBoss, a division of Red Hat, Inc.