public class QueryStringEncoder
extends java.lang.Object
QueryStringEncoder
encoder = newQueryStringEncoder
("/hello"); encoder.addParam("recipient", "world"); assert encoder.toString().equals("/hello?recipient=world");
QueryStringDecoder
构造器和说明 |
---|
QueryStringEncoder(java.lang.String uri)
Creates a new encoder that encodes a URI that starts with the specified
path string.
|
QueryStringEncoder(java.lang.String uri,
java.nio.charset.Charset charset)
Creates a new encoder that encodes a URI that starts with the specified
path string in the specified charset.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addParam(java.lang.String name,
java.lang.String value)
Adds a parameter with the specified name and value to this encoder.
|
java.lang.String |
toString()
Returns the URL-encoded URI which was created from the path string
specified in the constructor and the parameters added by
addParam(String, String) method. |
java.net.URI |
toUri()
Returns the URL-encoded URI object which was created from the path string
specified in the constructor and the parameters added by
addParam(String, String) method. |
public QueryStringEncoder(java.lang.String uri)
public QueryStringEncoder(java.lang.String uri, java.nio.charset.Charset charset)
public void addParam(java.lang.String name, java.lang.String value)
public java.net.URI toUri() throws java.net.URISyntaxException
addParam(String, String)
method.java.net.URISyntaxException
public java.lang.String toString()
addParam(String, String)
method.toString
在类中 java.lang.Object