|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cedarsoft.serialization.AbstractSerializer<T,S,D,E>
T - the typeS - the object to serialize toD - the object to deserialize fromE - the exception that might be thrownpublic abstract class AbstractSerializer<T,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 the object |
protected java.lang.String |
getDefaultElementName()
|
Version |
getFormatVersion()
Returns the format version that is written |
VersionRange |
getFormatVersionRange()
|
byte[] |
serialize(T object)
Serializes the given object |
void |
serialize(T object,
java.io.OutputStream out)
Serializes the object to the output stream |
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,Lookup>@NotNull public VersionRange getFormatVersionRange()
@NotNull @NonNls protected java.lang.String getDefaultElementName()
@NotNull
public byte[] serialize(@NotNull
T object)
throws java.io.IOException
ExtendedSerializer
serialize in interface ExtendedSerializer<T>object - the object
java.io.IOException
public void serialize(@NotNull
T object,
@NotNull
java.io.OutputStream out)
throws java.io.IOException
ExtendedSerializer
serialize in interface ExtendedSerializer<T>object - the objectout - the out stream
java.io.IOException
@NotNull
public T deserialize(@NotNull
java.io.InputStream in)
throws java.io.IOException
ExtendedSerializer
deserialize in interface ExtendedSerializer<T>in - the input stream
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||