Package org.openqa.selenium.remote.codec
Class AbstractHttpCommandCodec
- java.lang.Object
-
- org.openqa.selenium.remote.codec.AbstractHttpCommandCodec
-
- All Implemented Interfaces:
CommandCodec<org.openqa.selenium.remote.http.HttpRequest>
- Direct Known Subclasses:
JsonHttpCommandCodec,W3CHttpCommandCodec
public abstract class AbstractHttpCommandCodec extends java.lang.Object implements CommandCodec<org.openqa.selenium.remote.http.HttpRequest>
A command codec that adheres to the W3C's WebDriver wire protocol.- See Also:
- W3C WebDriver spec
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractHttpCommandCodec.CommandSpec
-
Constructor Summary
Constructors Constructor Description AbstractHttpCommandCodec()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidalias(java.lang.String commandName, java.lang.String isAnAliasFor)Allow commands to have aliases.protected abstract java.util.Map<java.lang.String,?>amendParameters(java.lang.String name, java.util.Map<java.lang.String,?> parameters)Commanddecode(org.openqa.selenium.remote.http.HttpRequest encodedCommand)Decodes a command.protected voiddefineCommand(java.lang.String name, AbstractHttpCommandCodec.CommandSpec spec)voiddefineCommand(java.lang.String name, org.openqa.selenium.remote.http.HttpMethod method, java.lang.String pathPattern)Defines a new command mapping.protected static AbstractHttpCommandCodec.CommandSpecdelete(java.lang.String path)org.openqa.selenium.remote.http.HttpRequestencode(Command command)Encodes a command.protected static AbstractHttpCommandCodec.CommandSpecget(java.lang.String path)protected static AbstractHttpCommandCodec.CommandSpecpost(java.lang.String path)
-
-
-
Method Detail
-
encode
public org.openqa.selenium.remote.http.HttpRequest encode(Command command)
Description copied from interface:CommandCodecEncodes a command.- Specified by:
encodein interfaceCommandCodec<org.openqa.selenium.remote.http.HttpRequest>- Parameters:
command- the command to encode.- Returns:
- the encoded command.
-
amendParameters
protected abstract java.util.Map<java.lang.String,?> amendParameters(java.lang.String name, java.util.Map<java.lang.String,?> parameters)
-
decode
public Command decode(org.openqa.selenium.remote.http.HttpRequest encodedCommand)
Description copied from interface:CommandCodecDecodes a command.- Specified by:
decodein interfaceCommandCodec<org.openqa.selenium.remote.http.HttpRequest>- Parameters:
encodedCommand- the command to decode.- Returns:
- the decoded command.
-
defineCommand
public void defineCommand(java.lang.String name, org.openqa.selenium.remote.http.HttpMethod method, java.lang.String pathPattern)Defines a new command mapping.- Specified by:
defineCommandin interfaceCommandCodec<org.openqa.selenium.remote.http.HttpRequest>- Parameters:
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.
-
alias
public void alias(java.lang.String commandName, java.lang.String isAnAliasFor)Description copied from interface:CommandCodecAllow commands to have aliases.- Specified by:
aliasin interfaceCommandCodec<org.openqa.selenium.remote.http.HttpRequest>- Parameters:
commandName- The command being added.isAnAliasFor- The command name that this is an alias for.
-
defineCommand
protected void defineCommand(java.lang.String name, AbstractHttpCommandCodec.CommandSpec spec)
-
delete
protected static AbstractHttpCommandCodec.CommandSpec delete(java.lang.String path)
-
get
protected static AbstractHttpCommandCodec.CommandSpec get(java.lang.String path)
-
post
protected static AbstractHttpCommandCodec.CommandSpec post(java.lang.String path)
-
-