This decoder can also decode the content of an HTTP POST request whose content type is application/x-www-form-urlencoded:QueryStringDecoderdecoder = newQueryStringDecoder("/hello?recipient=world&x=1;y=2"); assert decoder.path().equals("/hello"); assert decoder.parameters().get("recipient").get(0).equals("world"); assert decoder.parameters().get("x").get(0).equals("1"); assert decoder.parameters().get("y").get(0).equals("2");
QueryStringDecoderdecoder = newQueryStringDecoder("recipient=world&x=1;y=2", false); ...
QueryStringEncoder
| Modifier and Type | Field and Description |
|---|---|
| private final Charset | |
| private static final int | |
| private final int | |
| private Map | |
| private String | |
| private int | |
| private final boolean | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | QueryStringDecoder(String uri, boolean hasPath)
Creates a new decoder that decodes the specified URI encoded in the specified charset. |
| public | QueryStringDecoder(String uri, Charset charset)
Creates a new decoder that decodes the specified URI encoded in the specified charset. |
| public | QueryStringDecoder(String uri, Charset charset, boolean hasPath)
Creates a new decoder that decodes the specified URI encoded in the specified charset. |
| public | QueryStringDecoder(String uri, Charset charset, boolean hasPath, int maxParams)
Creates a new decoder that decodes the specified URI encoded in the specified charset. |
| public | QueryStringDecoder(String uri, Charset charset, boolean hasPath, int maxParams, boolean semicolonIsNormalChar)
Creates a new decoder that decodes the specified URI encoded in the specified charset. |
| public | |
| public | QueryStringDecoder(URI uri, Charset charset)
Creates a new decoder that decodes the specified URI encoded in the specified charset. |
| public | QueryStringDecoder(URI uri, Charset charset, int maxParams)
Creates a new decoder that decodes the specified URI encoded in the specified charset. |
| public | QueryStringDecoder(URI uri, Charset charset, int maxParams, boolean semicolonIsNormalChar)
Creates a new decoder that decodes the specified URI encoded in the specified charset. |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | |
| public static String | Returns: The decoded string, ors if there's nothing to decode.
If the string to decode is null, returns an empty string.The string to decode (can be empty). s)Decodes a bit of a URL encoded by a browser. |
| public static String | Returns: The decoded string, ors if there's nothing to decode.
If the string to decode is null, returns an empty string.The string to decode (can be empty). s, final Charset The charset to use to decode the string (should really
be charset)CharsetUtil#UTF_8.Decodes a bit of a URL encoded by a browser. |
| private static String | |
| private static Map | |
| private static int | |
| public Map | |
| public String | |
| private int | |
| public String | |
| public String | |
| public String | |
| public String |
| charset | back to summary |
|---|---|
| private final Charset charset | |
| DEFAULT_MAX_PARAMS | back to summary |
|---|---|
| private static final int DEFAULT_MAX_PARAMS | |
| maxParams | back to summary |
|---|---|
| private final int maxParams | |
| params | back to summary |
|---|---|
| private Map<String, List<String>> params | |
| path | back to summary |
|---|---|
| private String path | |
| pathEndIdx | back to summary |
|---|---|
| private int pathEndIdx | |
| semicolonIsNormalChar | back to summary |
|---|---|
| private final boolean semicolonIsNormalChar | |
| uri | back to summary |
|---|---|
| private final String uri | |
| QueryStringDecoder | back to summary |
|---|---|
| public QueryStringDecoder(String uri) Creates a new decoder that decodes the specified URI. The decoder will assume that the query string is encoded in UTF-8. | |
| QueryStringDecoder | back to summary |
|---|---|
| public QueryStringDecoder(String uri, boolean hasPath) Creates a new decoder that decodes the specified URI encoded in the specified charset. | |
| QueryStringDecoder | back to summary |
|---|---|
| public QueryStringDecoder(String uri, Charset charset) Creates a new decoder that decodes the specified URI encoded in the specified charset. | |
| QueryStringDecoder | back to summary |
|---|---|
| public QueryStringDecoder(String uri, Charset charset, boolean hasPath) Creates a new decoder that decodes the specified URI encoded in the specified charset. | |
| QueryStringDecoder | back to summary |
|---|---|
| public QueryStringDecoder(String uri, Charset charset, boolean hasPath, int maxParams) Creates a new decoder that decodes the specified URI encoded in the specified charset. | |
| QueryStringDecoder | back to summary |
|---|---|
| public QueryStringDecoder(String uri, Charset charset, boolean hasPath, int maxParams, boolean semicolonIsNormalChar) Creates a new decoder that decodes the specified URI encoded in the specified charset. | |
| QueryStringDecoder | back to summary |
|---|---|
| public QueryStringDecoder(URI uri) Creates a new decoder that decodes the specified URI. The decoder will assume that the query string is encoded in UTF-8. | |
| QueryStringDecoder | back to summary |
|---|---|
| public QueryStringDecoder(URI uri, Charset charset) Creates a new decoder that decodes the specified URI encoded in the specified charset. | |
| QueryStringDecoder | back to summary |
|---|---|
| public QueryStringDecoder(URI uri, Charset charset, int maxParams) Creates a new decoder that decodes the specified URI encoded in the specified charset. | |
| QueryStringDecoder | back to summary |
|---|---|
| public QueryStringDecoder(URI uri, Charset charset, int maxParams, boolean semicolonIsNormalChar) Creates a new decoder that decodes the specified URI encoded in the specified charset. | |
| addParam | back to summary |
|---|---|
| private static boolean addParam(String s, int nameStart, int valueStart, int valueEnd, Map<String, List<String>> params, Charset charset) | |
| decodeComponent | back to summary |
|---|---|
| public static String decodeComponent(final String s) Decodes a bit of a URL encoded by a browser.
This is equivalent to calling
| |
| decodeComponent | back to summary |
|---|---|
| public static String decodeComponent(final String s, final Charset charset) Decodes a bit of a URL encoded by a browser.
The string is expected to be encoded as per RFC 3986, Section 2.
This is the encoding used by JavaScript functions
This is essentially equivalent to calling
| |
| decodeComponent | back to summary |
|---|---|
| private static String decodeComponent(String s, int from, int toExcluded, Charset charset, boolean isPath) | |
| decodeParams | back to summary |
|---|---|
| private static Map | |
| findPathEndIndex | back to summary |
|---|---|
| private static int findPathEndIndex(String uri) | |
| parameters | back to summary |
|---|---|
| public Map Returns the decoded key-value parameter pairs of the URI. | |
| path | back to summary |
|---|---|
| public String path() Returns the decoded path string of the URI. | |
| pathEndIdx | back to summary |
|---|---|
| private int pathEndIdx() | |
| rawPath | back to summary |
|---|---|
| public String rawPath() Returns the raw path string of the URI. | |
| rawQuery | back to summary |
|---|---|
| public String rawQuery() Returns raw query string of the URI. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| uri | back to summary |
|---|---|
| public String uri() Returns the uri used to initialize this | |