|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.client.JerseyWebTarget
public class JerseyWebTarget
Jersey implementation of JAX-RS client target
contract.
| Constructor Summary | |
|---|---|
protected |
JerseyWebTarget(UriBuilder uriBuilder,
ClientConfig clientConfig)
Create new web target instance. |
protected |
JerseyWebTarget(UriBuilder uriBuilder,
JerseyWebTarget that)
Create new web target instance. |
| Method Summary | |
|---|---|
ClientConfig |
configuration()
Get access to the underlying configuration. |
java.net.URI |
getUri()
Get the URI identifying the resource. |
UriBuilder |
getUriBuilder()
Get the URI builder initialized with the URI of the current
resource target. |
JerseyWebTarget |
matrixParam(java.lang.String name,
java.lang.Object... values)
Create a new WebTarget instance by appending a matrix parameter to
the existing set of matrix parameters of the current final segment of the
URI of the current target instance. |
JerseyWebTarget |
path(java.lang.String path)
Create a new WebTarget instance by appending path to the URI of
the current target instance. |
JerseyWebTarget |
queryParam(java.lang.String name,
java.lang.Object... values)
Create a new WebTarget instance by configuring a query parameter on the URI
of the current target instance. |
JerseyInvocation.Builder |
request()
Start building a request to the targeted web resource. |
JerseyInvocation.Builder |
request(MediaType... acceptedResponseTypes)
Start building a request to the targeted web resource and define the accepted response media types. |
JerseyInvocation.Builder |
request(java.lang.String... acceptedResponseTypes)
Start building a request to the targeted web resource and define the accepted response media types. |
JerseyWebTarget |
resolveTemplate(java.lang.String name,
java.lang.Object value)
Create a new WebTarget instance by resolving a URI template with a given name
in the URI of the current target instance using a supplied value. |
JerseyWebTarget |
resolveTemplate(java.lang.String name,
java.lang.Object value,
boolean encodeSlashInPath)
Create a new WebTarget instance by resolving a URI template with a given name
in the URI of the current target instance using a supplied value. |
JerseyWebTarget |
resolveTemplateFromEncoded(java.lang.String name,
java.lang.Object value)
Create a new WebTarget instance by resolving a URI template with a given name
in the URI of the current target instance using a supplied encoded value. |
JerseyWebTarget |
resolveTemplates(java.util.Map<java.lang.String,java.lang.Object> templateValues)
Create a new WebTarget instance by resolving one or more URI templates
in the URI of the current target instance using supplied name-value pairs. |
JerseyWebTarget |
resolveTemplates(java.util.Map<java.lang.String,java.lang.Object> templateValues,
boolean encodeSlashInPath)
Create a new WebTarget instance by resolving one or more URI templates
in the URI of the current target instance using supplied name-value pairs. |
JerseyWebTarget |
resolveTemplatesFromEncoded(java.util.Map<java.lang.String,java.lang.Object> templateValues)
Create a new WebTarget instance by resolving one or more URI templates
in the URI of the current target instance using supplied name-encoded value pairs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected JerseyWebTarget(UriBuilder uriBuilder,
JerseyWebTarget that)
uriBuilder - builder for the target URI.that - original target to copy the internal data from.
protected JerseyWebTarget(UriBuilder uriBuilder,
ClientConfig clientConfig)
uriBuilder - builder for the target URI.clientConfig - target configuration.| Method Detail |
|---|
public java.net.URI getUri()
WebTarget
getUri in interface WebTargetpublic UriBuilder getUriBuilder()
WebTargetURI of the current
resource target. The returned URI builder is detached from the target,
i.e. any updates in the URI builder MUST NOT have any effects on the
URI of the originating target.
getUriBuilder in interface WebTargetpublic ClientConfig configuration()
WebTargetconfiguration.
configuration in interface WebTarget
public JerseyWebTarget path(java.lang.String path)
throws java.lang.NullPointerException
WebTargetWebTarget instance by appending path to the URI of
the current target instance.
When constructing the final path, a '/' separator will be inserted between the existing path and the supplied path if necessary. Existing '/' characters are preserved thus a single value can represent multiple URI path segments.
A snapshot of the present configuration of the current (parent) target instance is taken and is inherited by the newly constructed (child) target instance.
path in interface WebTargetpath - the path, may contain URI template parameters.
java.lang.NullPointerException - if path is null.
public JerseyWebTarget matrixParam(java.lang.String name,
java.lang.Object... values)
throws java.lang.NullPointerException
WebTargetWebTarget instance by appending a matrix parameter to
the existing set of matrix parameters of the current final segment of the
URI of the current target instance.
If multiple values are supplied the parameter will be added once per value. In case a single
null value is entered, all parameters with that name in the current final path segment
are removed (if present) from the collection of last segment matrix parameters inherited from
the current target.
Note that the matrix parameters are tied to a particular path segment; appending a value to an existing matrix parameter name will not affect the position of the matrix parameter in the URI path.
A snapshot of the present configuration of the current (parent) target instance is taken and is inherited by the newly constructed (child) target instance.
matrixParam in interface WebTargetname - the matrix parameter name, may contain URI template parameters.values - the matrix parameter value(s), each object will be converted
to a String using its toString() method. Stringified
values may contain URI template parameters.
java.lang.NullPointerException - if the parameter name is null or if there are multiple
values present and any of those values is null.
public JerseyWebTarget queryParam(java.lang.String name,
java.lang.Object... values)
throws java.lang.NullPointerException
WebTargetWebTarget instance by configuring a query parameter on the URI
of the current target instance.
If multiple values are supplied the parameter will be added once per value. In case a single
null value is entered, all parameters with that name are removed (if present) from
the collection of query parameters inherited from the current target.
A snapshot of the present configuration of the current (parent) target instance is taken and is inherited by the newly constructed (child) target instance.
queryParam in interface WebTargetname - the query parameter name, may contain URI template parametersvalues - the query parameter value(s), each object will be converted
to a String using its toString() method. Stringified
values may contain URI template parameters.
java.lang.NullPointerException - if the parameter name is null or if there are multiple
values present and any of those values is null.public JerseyInvocation.Builder request()
WebTarget
request in interface WebTargetpublic JerseyInvocation.Builder request(java.lang.String... acceptedResponseTypes)
WebTarget
request in interface WebTargetacceptedResponseTypes - accepted response media types.
public JerseyInvocation.Builder request(MediaType... acceptedResponseTypes)
WebTarget
request in interface WebTargetacceptedResponseTypes - accepted response media types.
public JerseyWebTarget resolveTemplate(java.lang.String name,
java.lang.Object value)
throws java.lang.NullPointerException
WebTargetWebTarget instance by resolving a URI template with a given name
in the URI of the current target instance using a supplied value.
In case a null template name or value is entered a NullPointerException
is thrown.
A snapshot of the present configuration of the current (parent) target instance is taken and is inherited by the newly constructed (child) target instance.
resolveTemplate in interface WebTargetname - name of the URI template.value - value to be used to resolve the template.
java.lang.NullPointerException - if the resolved template name or value is null.
public JerseyWebTarget resolveTemplate(java.lang.String name,
java.lang.Object value,
boolean encodeSlashInPath)
throws java.lang.NullPointerException
WebTargetWebTarget instance by resolving a URI template with a given name
in the URI of the current target instance using a supplied value.
In case a null template name or value is entered a NullPointerException
is thrown.
A snapshot of the present configuration of the current (parent) target instance is taken and is inherited by the newly constructed (child) target instance.
resolveTemplate in interface WebTargetname - name of the URI template.value - value to be used to resolve the template.encodeSlashInPath - if true, the slash ('/') characters
in template values will be encoded if the template
is placed in the URI path component, otherwise the slash
characters will not be encoded in path templates.
java.lang.NullPointerException - if the resolved template name or value is null.
public JerseyWebTarget resolveTemplateFromEncoded(java.lang.String name,
java.lang.Object value)
throws java.lang.NullPointerException
WebTargetWebTarget instance by resolving a URI template with a given name
in the URI of the current target instance using a supplied encoded value.
A template with a matching name will be replaced by the supplied value.
Value is converted to String using its toString() method and is then
encoded to match the rules of the URI component to which they pertain. All % characters in
the stringified values that are not followed by two hexadecimal numbers will be encoded.
In case a null template name or value is entered a NullPointerException
is thrown.
A snapshot of the present configuration of the current (parent) target instance is taken and is inherited by the newly constructed (child) target instance.
resolveTemplateFromEncoded in interface WebTargetname - name of the URI template.value - encoded value to be used to resolve the template.
java.lang.NullPointerException - if the resolved template name or value is null.
public JerseyWebTarget resolveTemplates(java.util.Map<java.lang.String,java.lang.Object> templateValues)
throws java.lang.NullPointerException
WebTargetWebTarget instance by resolving one or more URI templates
in the URI of the current target instance using supplied name-value pairs.
A call to the method with an empty parameter map is ignored, i.e. same WebTarget
instance is returned.
A snapshot of the present configuration of the current (parent) target instance is taken and is inherited by the newly constructed (child) target instance.
resolveTemplates in interface WebTargettemplateValues - a map of URI template names and their values.
java.lang.NullPointerException - if the name-value map or any of the names or values in the map
is null.
public JerseyWebTarget resolveTemplates(java.util.Map<java.lang.String,java.lang.Object> templateValues,
boolean encodeSlashInPath)
throws java.lang.NullPointerException
WebTargetWebTarget instance by resolving one or more URI templates
in the URI of the current target instance using supplied name-value pairs.
A call to the method with an empty parameter map is ignored, i.e. same WebTarget
instance is returned.
A snapshot of the present configuration of the current (parent) target instance is taken and is inherited by the newly constructed (child) target instance.
resolveTemplates in interface WebTargettemplateValues - a map of URI template names and their values.encodeSlashInPath - if true, the slash ('/') characters
in template values will be encoded if the template
is placed in the URI path component, otherwise the slash
characters will not be encoded in path templates.
java.lang.NullPointerException - if the name-value map or any of the names or values in the map
is null.
public JerseyWebTarget resolveTemplatesFromEncoded(java.util.Map<java.lang.String,java.lang.Object> templateValues)
throws java.lang.NullPointerException
WebTargetWebTarget instance by resolving one or more URI templates
in the URI of the current target instance using supplied name-encoded value pairs.
All templates with their name matching one of the keys in the supplied map will be replaced
by the value in the supplied map. Values are converted to String using
their toString() method and are then encoded to match the
rules of the URI component to which they pertain. All % characters in
the stringified values that are not followed by two hexadecimal numbers
will be encoded.
A call to the method with an empty parameter map is ignored, i.e. same WebTarget
instance is returned.
A snapshot of the present configuration of the current (parent) target instance is taken and is inherited by the newly constructed (child) target instance.
resolveTemplatesFromEncoded in interface WebTargettemplateValues - a map of URI template names and their encoded values.
java.lang.NullPointerException - if the name-value map or any of the names or encoded values in the map
is null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||