org.glassfish.jersey.client
Class WebTarget

java.lang.Object
  extended by org.glassfish.jersey.client.WebTarget
All Implemented Interfaces:
WebTarget

public class WebTarget
extends Object
implements WebTarget

Jersey implementation of JAX-RS client target contract.

Author:
Marek Potociar (marek.potociar at oracle.com)

Constructor Summary
protected WebTarget(UriBuilder uriBuilder, Map<String,Object> pathParams, ClientConfig clientConfig)
          Create new web target instance.
protected WebTarget(UriBuilder uriBuilder, WebTarget that)
          Create new web target instance.
 
Method Summary
 ClientConfig configuration()
           
 URI getUri()
           
 UriBuilder getUriBuilder()
           
 WebTarget matrixParam(String name, Object... values)
           
 WebTarget path(String path)
           
 WebTarget pathParam(String name, Object value)
           
 WebTarget pathParams(Map<String,Object> parameters)
           
 WebTarget queryParam(String name, Object... values)
           
 WebTarget queryParams(MultivaluedMap<String,Object> parameters)
           
protected  void replacePathParams(Map<String,Object> valueMap, boolean discardExisting)
          Replace path parameter values.
 JerseyInvocation.Builder request()
           
 JerseyInvocation.Builder request(MediaType... acceptedResponseTypes)
           
 JerseyInvocation.Builder request(String... acceptedResponseTypes)
           
protected  void setPathParam(String name, Object value)
          Set value of a path parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebTarget

protected WebTarget(UriBuilder uriBuilder,
                    WebTarget that)
Create new web target instance.

Parameters:
uriBuilder - builder for the target URI.
that - original target to copy the internal data from.

WebTarget

protected WebTarget(UriBuilder uriBuilder,
                    Map<String,Object> pathParams,
                    ClientConfig clientConfig)
Create new web target instance.

Parameters:
uriBuilder - builder for the target URI.
pathParams - map of path parameter names to values.
clientConfig - target configuration.
Method Detail

setPathParam

protected final void setPathParam(String name,
                                  Object value)
Set value of a path parameter.

Parameters:
name - path parameter name.
value - path parameter value. If null, any existing mapping for the path parameter name will be removed.

replacePathParams

protected final void replacePathParams(Map<String,Object> valueMap,
                                       boolean discardExisting)
Replace path parameter values.

Parameters:
valueMap - path parameter name to value map.
discardExisting - if true, all existing parameters will be discarded.

getUri

public URI getUri()
Specified by:
getUri in interface WebTarget

getUriBuilder

public UriBuilder getUriBuilder()
Specified by:
getUriBuilder in interface WebTarget

configuration

public ClientConfig configuration()
Specified by:
configuration in interface WebTarget

path

public WebTarget path(String path)
               throws NullPointerException
Specified by:
path in interface WebTarget
Throws:
NullPointerException

pathParam

public WebTarget pathParam(String name,
                           Object value)
                    throws NullPointerException
Specified by:
pathParam in interface WebTarget
Throws:
NullPointerException

pathParams

public WebTarget pathParams(Map<String,Object> parameters)
                     throws NullPointerException
Specified by:
pathParams in interface WebTarget
Throws:
NullPointerException

matrixParam

public WebTarget matrixParam(String name,
                             Object... values)
                      throws NullPointerException
Specified by:
matrixParam in interface WebTarget
Throws:
NullPointerException

queryParam

public WebTarget queryParam(String name,
                            Object... values)
                     throws NullPointerException
Specified by:
queryParam in interface WebTarget
Throws:
NullPointerException

queryParams

public WebTarget queryParams(MultivaluedMap<String,Object> parameters)
                      throws IllegalArgumentException,
                             NullPointerException
Specified by:
queryParams in interface WebTarget
Throws:
IllegalArgumentException
NullPointerException

request

public JerseyInvocation.Builder request()
Specified by:
request in interface WebTarget

request

public JerseyInvocation.Builder request(String... acceptedResponseTypes)
Specified by:
request in interface WebTarget

request

public JerseyInvocation.Builder request(MediaType... acceptedResponseTypes)
Specified by:
request in interface WebTarget


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.