public abstract class Serializer extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_STRICT
Default value for the "strict" serializer settings.
|
| Constructor and Description |
|---|
Serializer() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
binaryProtocol() |
abstract <Message extends PMessage<Message,Field>,Field extends PField> |
deserialize(InputStream input,
PMessageDescriptor<Message,Field> descriptor)
Deserialize a message.
|
abstract <Message extends PMessage<Message,Field>,Field extends PField> |
deserialize(InputStream input,
PService service)
Deserialize a service call.
|
protected boolean |
isRequestCallType(PServiceCallType type)
Utility method to check if a service call is a request type.
|
abstract String |
mediaType() |
abstract <Message extends PMessage<Message,Field>,Field extends PField> |
serialize(OutputStream output,
Message message)
Serialize a message.
|
abstract <Message extends PMessage<Message,Field>,Field extends PField> |
serialize(OutputStream output,
PServiceCall<Message,Field> call)
Serialize a service call.
|
public static final boolean DEFAULT_STRICT
public abstract <Message extends PMessage<Message,Field>,Field extends PField> int serialize(@Nonnull OutputStream output, @Nonnull Message message) throws IOException
Message - The message type.Field - The message field type.output - The output stream to write to.message - The message to write.IOException - If writing or serialization failed.public abstract <Message extends PMessage<Message,Field>,Field extends PField> int serialize(@Nonnull OutputStream output, @Nonnull PServiceCall<Message,Field> call) throws IOException
Message - The message type contained in the service call.Field - The message field type.output - The output stream to write to.call - The service call to write.IOException - If writing or serialization failed.@Nonnull public abstract <Message extends PMessage<Message,Field>,Field extends PField> Message deserialize(@Nonnull InputStream input, @Nonnull PMessageDescriptor<Message,Field> descriptor) throws IOException
Message - The message type.Field - The message field type.input - The input stream to read from.descriptor - The descriptor of the message to read.IOException - If reading or deserialization failed.@Nonnull public abstract <Message extends PMessage<Message,Field>,Field extends PField> PServiceCall<Message,Field> deserialize(@Nonnull InputStream input, @Nonnull PService service) throws IOException
Message - The message type contained in the returned service call.Field - The message field type.input - The input stream to read from.service - The service definition to read for.IOException - If reading or deserialization failed.public abstract boolean binaryProtocol()
@Nonnull public abstract String mediaType()
protected boolean isRequestCallType(PServiceCallType type)
type - The service call type.Copyright © 2015–2018 morimekta.net. All rights reserved.