T - the type of message that can be serializedpublic abstract class MessageSerializer<T extends Message> extends ValueSerializer<T>
messages.| Constructor and Description |
|---|
MessageSerializer() |
| Modifier and Type | Method and Description |
|---|---|
abstract T |
read(MessageReader reader)
Reads a message from the specified reader
|
T |
read(ValueReader reader)
Parses a message from the specified reader
|
static <T extends Message> |
readFromJSON(MessageSerializer<T> parser,
CharSequence cs) |
void |
write(int tag,
String name,
T t,
MessageWriter writer) |
abstract void |
write(T message,
MessageWriter writer)
Write the specified message to the specified writer.
|
void |
write(T value,
ValueWriter writer) |
static <T extends Message> |
writeToJSON(T message,
MessageSerializer<T> serializer) |
static <T extends Message> |
writeToJSON(T message,
MessageSerializer<T> serializer,
Writer w) |
listOf, mappingTo, setOfpublic abstract T read(MessageReader reader) throws IOException
reader - the reader to create the message fromIOException - if the message could not be readpublic final T read(ValueReader reader) throws IOException
read in class ValueSerializer<T extends Message>reader - the serializer to create the fromIOException - if the message could not be readpublic abstract void write(T message, MessageWriter writer) throws IOException
message - the message to writewriter - the writer to write the message toIOException - if the message could not be writtenpublic final void write(T value, ValueWriter writer) throws IOException
write in class ValueSerializer<T extends Message>IOExceptionpublic static <T extends Message> String writeToJSON(T message, MessageSerializer<T> serializer)
public void write(int tag,
String name,
T t,
MessageWriter writer)
throws IOException
write in class ValueSerializer<T extends Message>IOExceptionpublic static <T extends Message> void writeToJSON(T message, MessageSerializer<T> serializer, Writer w) throws IOException
IOExceptionpublic static <T extends Message> T readFromJSON(MessageSerializer<T> parser, CharSequence cs)
Copyright © 2012–2015 Danish Maritime Authority. All rights reserved.