public class UriBuilder extends Object
| Constructor and Description |
|---|
UriBuilder() |
| Modifier and Type | Method and Description |
|---|---|
URI |
build(Object... values) |
URI |
buildFromMap(Map<String,? extends Object> paramMap,
boolean fromEncodedMap) |
protected URI |
buildFromValues(boolean encoded,
Object... values) |
UriBuilder |
clone() |
static Matcher |
createUriParamMatcher(String string) |
UriBuilder |
fragment(String fragment) |
static UriBuilder |
fromUri(String uriTemplate)
Create a new instance initialized from an existing URI.
|
static UriBuilder |
fromUri(URI uri)
Create a new instance initialized from an existing URI.
|
String |
getFragment() |
String |
getHost() |
String |
getPath() |
List<String> |
getPathParamNamesInDeclarationOrder()
Return a unique order list of path params
|
int |
getPort() |
String |
getQuery() |
String |
getScheme() |
String |
getUserInfo() |
UriBuilder |
host(String host) |
UriBuilder |
path(Class<?> resource) |
UriBuilder |
path(Method method) |
UriBuilder |
path(String segment) |
protected static String |
paths(boolean encode,
String basePath,
String... segments) |
UriBuilder |
port(int port) |
protected StringBuffer |
replaceParameter(Map<String,? extends Object> paramMap,
boolean fromEncodedMap,
boolean isTemplate,
String string,
StringBuffer buffer) |
UriBuilder |
replacePath(String path) |
protected StringBuffer |
replacePathParameter(String name,
String value,
boolean isEncoded,
String string,
StringBuffer buffer) |
UriBuilder |
replaceQuery(String query) |
protected StringBuffer |
replaceQueryStringParameter(Map<String,? extends Object> paramMap,
boolean fromEncodedMap,
boolean isTemplate,
String string,
StringBuffer buffer) |
UriBuilder |
scheme(String scheme) |
UriBuilder |
schemeSpecificPart(String ssp) |
UriBuilder |
uri(String uriTemplate) |
UriBuilder |
uri(URI uri) |
UriBuilder |
uriTemplate(String uriTemplate)
You may put path parameters anywhere within the uriTemplate except port
|
UriBuilder |
userInfo(String ui) |
public UriBuilder clone()
public UriBuilder uriTemplate(String uriTemplate)
uriTemplate - public UriBuilder uri(String uriTemplate) throws IllegalArgumentException
IllegalArgumentExceptionpublic UriBuilder uri(URI uri) throws IllegalArgumentException
IllegalArgumentExceptionpublic UriBuilder scheme(String scheme) throws IllegalArgumentException
IllegalArgumentExceptionpublic UriBuilder schemeSpecificPart(String ssp) throws IllegalArgumentException
IllegalArgumentExceptionpublic UriBuilder userInfo(String ui)
public UriBuilder host(String host) throws IllegalArgumentException
IllegalArgumentExceptionpublic UriBuilder port(int port) throws IllegalArgumentException
IllegalArgumentExceptionpublic UriBuilder path(String segment) throws IllegalArgumentException
IllegalArgumentExceptionpublic UriBuilder path(Class<?> resource) throws IllegalArgumentException
IllegalArgumentExceptionpublic UriBuilder path(Method method) throws IllegalArgumentException
IllegalArgumentExceptionpublic UriBuilder replaceQuery(String query) throws IllegalArgumentException
IllegalArgumentExceptionpublic UriBuilder fragment(String fragment) throws IllegalArgumentException
IllegalArgumentExceptionpublic URI buildFromMap(Map<String,? extends Object> paramMap, boolean fromEncodedMap) throws IllegalArgumentException, UriBuilderException
protected StringBuffer replacePathParameter(String name, String value, boolean isEncoded, String string, StringBuffer buffer)
protected StringBuffer replaceParameter(Map<String,? extends Object> paramMap, boolean fromEncodedMap, boolean isTemplate, String string, StringBuffer buffer)
protected StringBuffer replaceQueryStringParameter(Map<String,? extends Object> paramMap, boolean fromEncodedMap, boolean isTemplate, String string, StringBuffer buffer)
public List<String> getPathParamNamesInDeclarationOrder()
public URI build(Object... values) throws IllegalArgumentException, UriBuilderException
public String getHost()
public String getScheme()
public int getPort()
public String getUserInfo()
public String getPath()
public String getQuery()
public String getFragment()
public UriBuilder replacePath(String path)
public static UriBuilder fromUri(URI uri)
uri - a URI that will be used to initialize the UriBuilder.IllegalArgumentException - if uri is null.public static UriBuilder fromUri(String uriTemplate)
uriTemplate - a URI template that will be used to initialize the UriBuilder,
may contain URI parameters.IllegalArgumentException - if uriTemplate is not a valid URI template or is
null.Copyright © 2016. All rights reserved.