public class JsonHttpCommandCodec extends Object implements CommandCodec<HttpRequest>
Constructor and Description |
---|
JsonHttpCommandCodec() |
Modifier and Type | Method and Description |
---|---|
Command |
decode(HttpRequest encodedCommand)
Decodes a command.
|
void |
defineCommand(String name,
HttpMethod method,
String pathPattern)
Defines a new command mapping.
|
HttpRequest |
encode(Command command)
Encodes a command.
|
public HttpRequest encode(Command command)
CommandCodec
encode
in interface CommandCodec<HttpRequest>
command
- the command to encode.public Command decode(HttpRequest encodedCommand)
CommandCodec
decode
in interface CommandCodec<HttpRequest>
encodedCommand
- the command to decode.public void defineCommand(String name, HttpMethod method, String pathPattern)
name
- The command name.method
- The HTTP method to use for the command.pathPattern
- The URI path pattern for the command. When encoding a command, each
path segment prefixed with a ":" will be replaced with the corresponding parameter
from the encoded command.Copyright © 2015. All rights reserved.