com.cedarsoft.serialization
Class RegistrySerializer<T,R extends Registry<T>>
java.lang.Object
com.cedarsoft.serialization.RegistrySerializer<T,R>
- Type Parameters:
T - the typeR - the registry for the given type
public class RegistrySerializer<T,R extends Registry<T>>
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegistrySerializer
public RegistrySerializer(@NotNull
SerializedObjectsAccess serializedObjectsAccess,
@NotNull
ExtendedSerializer<T> serializer,
@NotNull
RegistrySerializer.IdResolver<T> idResolver)
- Creates a new registry serializer
- Parameters:
serializedObjectsAccess - the serialized objects accessserializer - the serializeridResolver - the id resolver
RegistrySerializer
public RegistrySerializer(@NotNull
SerializedObjectsAccess serializedObjectsAccess,
@NotNull
ExtendedSerializer<T> serializer,
@NotNull
RegistrySerializer.IdResolver<T> idResolver,
@Nullable
java.util.Comparator<T> comparator)
- Creates a new registry serializer
- Parameters:
serializedObjectsAccess - the serialized objects accessserializer - the serializeridResolver - the id resolvercomparator - the (optional) comparator
deserialize
@NotNull
public java.util.List<? extends T> deserialize()
throws java.io.IOException
- Throws:
java.io.IOException
serialize
public void serialize(@NotNull
T object)
throws StillContainedException,
java.io.IOException
- Serializes an object
- Parameters:
object - the object
- Throws:
java.io.IOException
StillContainedException
createConnectedRegistry
@NotNull
public R createConnectedRegistry(@NotNull
RegistrySerializer.RegistryFactory<T,R> factory)
throws java.io.IOException
- Creates a connected registry
- Parameters:
factory - the factory used to create the registry
- Returns:
- the connected registry
- Throws:
java.io.IOException
getId
@NotNull
@NonNls
protected java.lang.String getId(@NotNull
T object)
getSerializer
@NotNull
public ExtendedSerializer<T> getSerializer()
getSerializedObjectsAccess
@NotNull
public SerializedObjectsAccess getSerializedObjectsAccess()
getIdResolver
@NotNull
public RegistrySerializer.IdResolver<T> getIdResolver()
getComparator
@Nullable
public java.util.Comparator<T> getComparator()
Copyright © 2009 cedarsoft GmbH. All Rights Reserved.