org.openstreetmap.osmosis.core.store
Class SingleClassObjectSerializationFactory

java.lang.Object
  extended by org.openstreetmap.osmosis.core.store.SingleClassObjectSerializationFactory
All Implemented Interfaces:
ObjectSerializationFactory

public class SingleClassObjectSerializationFactory
extends java.lang.Object
implements ObjectSerializationFactory

An object reader and writer factory providing object serialisation capabilities where only a single class type will be stored.

Author:
Brett Henderson

Constructor Summary
SingleClassObjectSerializationFactory(java.lang.Class<?> storeableType)
          Creates a new instance.
 
Method Summary
 ObjectReader createObjectReader(StoreReader storeReader, StoreClassRegister storeClassRegister)
          Creates a new object reader.
 ObjectWriter createObjectWriter(StoreWriter storeWriter, StoreClassRegister storeClassRegister)
          Creates a new object writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleClassObjectSerializationFactory

public SingleClassObjectSerializationFactory(java.lang.Class<?> storeableType)
Creates a new instance.

Parameters:
storeableType - The class type to be supported.
Method Detail

createObjectReader

public ObjectReader createObjectReader(StoreReader storeReader,
                                       StoreClassRegister storeClassRegister)
Creates a new object reader.

Specified by:
createObjectReader in interface ObjectSerializationFactory
Parameters:
storeReader - The store writer to write all serialised data to.
storeClassRegister - The register for class to identifier mappings.
Returns:
The newly created object reader.

createObjectWriter

public ObjectWriter createObjectWriter(StoreWriter storeWriter,
                                       StoreClassRegister storeClassRegister)
Creates a new object writer.

Specified by:
createObjectWriter in interface ObjectSerializationFactory
Parameters:
storeWriter - The store writer to write all serialised data to.
storeClassRegister - The register for class to identifier mappings.
Returns:
The newly created object writer.