public class QueryStringDecoderV2 extends Object
| 构造器和说明 |
|---|
QueryStringDecoderV2(String uri) |
QueryStringDecoderV2(String uri,
boolean hasPath) |
QueryStringDecoderV2(String uri,
Charset charset) |
QueryStringDecoderV2(String uri,
Charset charset,
boolean hasPath) |
QueryStringDecoderV2(String uri,
Charset charset,
boolean hasPath,
int maxParams) |
QueryStringDecoderV2(URI uri) |
QueryStringDecoderV2(URI uri,
Charset charset) |
QueryStringDecoderV2(URI uri,
Charset charset,
int maxParams) |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
decodeComponent(String s)
Decodes a bit of an URL encoded by a browser.
|
static String |
decodeComponent(String s,
Charset charset)
Decodes a bit of an URL encoded by a browser.
|
ConstraintMap<String> |
parameters() |
String |
path() |
String |
uri() |
public QueryStringDecoderV2(String uri)
public QueryStringDecoderV2(String uri, boolean hasPath)
public QueryStringDecoderV2(String uri, Charset charset, boolean hasPath, int maxParams)
public QueryStringDecoderV2(URI uri)
public String uri()
public String path()
public ConstraintMap<String> parameters()
public static String decodeComponent(String s)
This is equivalent to calling decodeComponent(String, Charset) with
the UTF-8 charset (recommended to comply with RFC 3986, Section 2).
s - The string to decode (can be empty).s if there's nothing to decode. If the
string to decode is null, returns an empty string.IllegalArgumentException - if the string contains a malformed escape sequence.public static String decodeComponent(String s, Charset charset)
The string is expected to be encoded as per RFC 3986, Section 2. This is the
encoding used by JavaScript functions encodeURI and
encodeURIComponent, but not escape. For example in this
encoding, é (in Unicode U+00E9 or in UTF-8 0xC3 0xA9)
is encoded as %C3%A9 or %c3%a9.
This is essentially equivalent to calling
URLDecoder.decode(s,
charset.name()) except that it's over 2x faster and generates less garbage
for the GC. Actually this function doesn't allocate any memory if there's
nothing to decode, the argument itself is returned.
s - The string to decode (can be empty).charset - The charset to use to decode the string (should really be
CharsetUtil.UTF_8.s if there's nothing to decode. If the
string to decode is null, returns an empty string.IllegalArgumentException - if the string contains a malformed escape sequence.Copyright © 2017. All rights reserved.