|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cedarsoft.serialization.AbstractSerializer<T,C,S,D,E>
T - the typeC - the type of the contextS - the object to serialize toD - the object to deserialize fromE - the exception that might be thrownpublic abstract class AbstractSerializer<T,C,S,D,E extends java.lang.Throwable>
| Field Summary |
|---|
| Fields inherited from interface com.cedarsoft.serialization.Serializer |
|---|
PI_TARGET_FORMAT |
| Constructor Summary | |
|---|---|
protected |
AbstractSerializer(java.lang.String defaultElementName,
VersionRange formatVersionRange)
Creates a new version range |
| Method Summary | |
|---|---|
T |
deserialize(java.io.InputStream in)
Deserializes without a context |
protected java.lang.String |
getDefaultElementName()
Returns the default element name |
Version |
getFormatVersion()
Returns the format version that is written |
VersionRange |
getFormatVersionRange()
Returns the format version range that is supported for read |
void |
serialize(T object,
java.io.OutputStream out)
Serializes with a null context |
byte[] |
serializeToByteArray(T object,
C context)
Helper method that serializes to a byte array |
protected void |
verifyDelegatingSerializerVersion(Serializer<?,?> delegate,
Version expectedFormatVersion)
Helper method that can be used to ensure the right format version for each delegate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.cedarsoft.serialization.PluggableSerializer |
|---|
deserialize, serialize |
| Methods inherited from interface com.cedarsoft.serialization.Serializer |
|---|
deserialize, serialize |
| Constructor Detail |
|---|
protected AbstractSerializer(@NotNull@NonNls
java.lang.String defaultElementName,
@NotNull
VersionRange formatVersionRange)
defaultElementName - the default element nameformatVersionRange - the version range. The max value is used when written.| Method Detail |
|---|
protected void verifyDelegatingSerializerVersion(@NotNull
Serializer<?,?> delegate,
@NotNull
Version expectedFormatVersion)
delegate - the delegateexpectedFormatVersion - the expected format version@NotNull public Version getFormatVersion()
Serializer
getFormatVersion in interface Serializer<T,C>@NotNull public VersionRange getFormatVersionRange()
@NotNull @NonNls protected java.lang.String getDefaultElementName()
@NotNull
public byte[] serializeToByteArray(@NotNull
T object,
@Nullable
C context)
throws java.io.IOException
object - the objectcontext - the context
java.io.IOException
public void serialize(@NotNull
T object,
@NotNull
java.io.OutputStream out)
throws java.io.IOException
object - the objectout - the output stream
java.io.IOException
@NotNull
public T deserialize(@NotNull
java.io.InputStream in)
throws java.io.IOException
in - the input stream
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||