org.openstreetmap.osmosis.core.store
Class BaseObjectWriter

java.lang.Object
  extended by org.openstreetmap.osmosis.core.store.BaseObjectWriter
All Implemented Interfaces:
ObjectWriter
Direct Known Subclasses:
GenericObjectWriter, SingleClassObjectWriter

public abstract class BaseObjectWriter
extends java.lang.Object
implements ObjectWriter

Provides functionality common to all object writer implementations.

Author:
Brett Henderson

Constructor Summary
protected BaseObjectWriter(StoreWriter storeWriter, StoreClassRegister storeClassRegister)
          Creates a new instance.
 
Method Summary
protected abstract  void writeClassIdentifier(StoreWriter sw, StoreClassRegister scr, java.lang.Class<?> clazz)
          Writes the class identifier to the underlying data stream to allow it to be identified when reading in again.
 void writeObject(Storeable value)
          Writes an object to storage in a way that allows its type to be automatically determined when read back in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseObjectWriter

protected BaseObjectWriter(StoreWriter storeWriter,
                           StoreClassRegister storeClassRegister)
Creates a new instance.

Parameters:
storeWriter - The store writer to write all serialised data to.
storeClassRegister - The register for class to identifier mappings.
Method Detail

writeClassIdentifier

protected abstract void writeClassIdentifier(StoreWriter sw,
                                             StoreClassRegister scr,
                                             java.lang.Class<?> clazz)
Writes the class identifier to the underlying data stream to allow it to be identified when reading in again.

Parameters:
sw - The store writer to write all serialised data to.
scr - The register for class to identifier mappings.
clazz - The class to be written.

writeObject

public void writeObject(Storeable value)
Writes an object to storage in a way that allows its type to be automatically determined when read back in.

Specified by:
writeObject in interface ObjectWriter
Parameters:
value - The object to be written.