Class ReflectionStreamingSerializer<T>
java.lang.Object
se.l4.commons.serialization.internal.reflection.ReflectionStreamingSerializer<T>
- Type Parameters:
T-
- All Implemented Interfaces:
Serializer<T>,SerializerOrResolver<T>
public class ReflectionStreamingSerializer<T> extends Object implements Serializer<T>
Serializer that uses only fields or methods. Can fully stream the object.
- Author:
- Andreas Holstenson
-
Nested Class Summary
Nested classes/interfaces inherited from interface se.l4.commons.serialization.Serializer
Serializer.NullHandling -
Constructor Summary
Constructors Constructor Description ReflectionStreamingSerializer(TypeInfo<T> type) -
Method Summary
Modifier and Type Method Description SerializerFormatDefinitiongetFormatDefinition()Get the definition that describes what this serializer can read and write.Tread(StreamingInput in)Read an object from the specified stream.voidwrite(T object, String name, StreamingOutput stream)Write and object to the specified stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface se.l4.commons.serialization.Serializer
fromBytes, fromBytes, toBytes, toBytes
-
Constructor Details
-
Method Details
-
read
Description copied from interface:SerializerRead an object from the specified stream.- Specified by:
readin interfaceSerializer<T>- Returns:
- Throws:
IOException
-
write
Description copied from interface:SerializerWrite and object to the specified stream.- Specified by:
writein interfaceSerializer<T>- Parameters:
object- object to write, if the serializer implementsSerializer.NullHandlingthis may benull, if not the serializer can assume it is notnullname- the name the object should have, should be passed along to the outputstream- the stream to use for writing- Throws:
IOException- if unable to write the object
-
getFormatDefinition
Description copied from interface:SerializerGet the definition that describes what this serializer can read and write.- Specified by:
getFormatDefinitionin interfaceSerializer<T>- Returns:
-