com.cedarsoft.serialization
Class AbstractSerializer<T,S,D,E extends java.lang.Throwable>
java.lang.Object
com.cedarsoft.serialization.AbstractSerializer<T,S,D,E>
- Type Parameters:
T - the typeS - the object to serialize toD - the object to deserialize fromE - the exception that might be thrown
- All Implemented Interfaces:
- ExtendedSerializer<T>, PluggableSerializer<T,S,D,E>, Serializer<T,Lookup>
- Direct Known Subclasses:
- AbstractJDomSerializer, AbstractStaxMateSerializer
public abstract class AbstractSerializer<T,S,D,E extends java.lang.Throwable>
- extends java.lang.Object
- implements PluggableSerializer<T,S,D,E>
|
Method Summary |
T |
deserialize(java.io.InputStream in)
Deserializes the object |
protected java.lang.String |
getDefaultElementName()
|
byte[] |
serialize(T object)
Serializes the given object |
void |
serialize(T object,
java.io.OutputStream out)
Serializes the object to the output stream |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractSerializer
protected AbstractSerializer(@NotNull@NonNls
java.lang.String defaultElementName)
getDefaultElementName
@NotNull
@NonNls
protected java.lang.String getDefaultElementName()
serialize
@NotNull
public byte[] serialize(@NotNull
T object)
throws java.io.IOException
- Description copied from interface:
ExtendedSerializer
- Serializes the given object
- Specified by:
serialize in interface ExtendedSerializer<T>
- Parameters:
object - the object
- Returns:
- the serialized object
- Throws:
java.io.IOException
serialize
public void serialize(@NotNull
T object,
@NotNull
java.io.OutputStream out)
throws java.io.IOException
- Description copied from interface:
ExtendedSerializer
- Serializes the object to the output stream
- Specified by:
serialize in interface ExtendedSerializer<T>
- Parameters:
object - the objectout - the out stream
- Throws:
java.io.IOException
deserialize
@NotNull
public T deserialize(@NotNull
java.io.InputStream in)
throws java.io.IOException
- Description copied from interface:
ExtendedSerializer
- Deserializes the object
- Specified by:
deserialize in interface ExtendedSerializer<T>
- Parameters:
in - the input stream
- Returns:
- the deserialized object
- Throws:
java.io.IOException
Copyright © 2009 cedarsoft GmbH. All Rights Reserved.