com.google.api.client.http.json
Class JsonHttpClient.Builder

java.lang.Object
  extended by com.google.api.client.http.json.JsonHttpClient.Builder
Enclosing class:
JsonHttpClient

public static class JsonHttpClient.Builder
extends Object

Builder for JsonHttpClient.

Implementation is not thread-safe.

Since:
1.6

Constructor Summary
protected JsonHttpClient.Builder(HttpTransport transport, JsonFactory jsonFactory, GenericUrl baseUrl)
          Returns an instance of a new builder.
 
Method Summary
 JsonHttpClient build()
          Builds a new instance of JsonHttpClient.
 String getApplicationName()
          Returns the application name to be used in the UserAgent header of each request or null for none.
 GenericUrl getBaseUrl()
          Returns the base URL of the service, for example "https://www.googleapis.com/tasks/v1/".
 HttpRequestInitializer getHttpRequestInitializer()
          Returns the HTTP request initializer or null for none.
 JsonFactory getJsonFactory()
          Returns the JSON factory.
 JsonHttpRequestInitializer getJsonHttpRequestInitializer()
          Returns the JSON HTTP request initializer or null for none.
 HttpTransport getTransport()
          Returns the HTTP transport.
 JsonHttpClient.Builder setApplicationName(String applicationName)
          Sets the application name to be used in the UserAgent header of each request or null for none.
 JsonHttpClient.Builder setBaseUrl(GenericUrl baseUrl)
          Sets the base URL of the service, for example "https://www.googleapis.com/tasks/v1/".
 JsonHttpClient.Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer)
          Sets the HTTP request initializer or null for none.
 JsonHttpClient.Builder setJsonHttpRequestInitializer(JsonHttpRequestInitializer jsonHttpRequestInitializer)
          Sets the JSON HTTP request initializer or null for none.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonHttpClient.Builder

protected JsonHttpClient.Builder(HttpTransport transport,
                                 JsonFactory jsonFactory,
                                 GenericUrl baseUrl)
Returns an instance of a new builder.

Parameters:
transport - The transport to use for requests
jsonFactory - A factory for creating JSON parsers and serializers
baseUrl - The base URL of the service. Must end with a "/"
Method Detail

build

public JsonHttpClient build()
Builds a new instance of JsonHttpClient.


getJsonFactory

public final JsonFactory getJsonFactory()
Returns the JSON factory.


getTransport

public final HttpTransport getTransport()
Returns the HTTP transport.


getBaseUrl

public final GenericUrl getBaseUrl()
Returns the base URL of the service, for example "https://www.googleapis.com/tasks/v1/". Must be URL-encoded and must end with a "/". This is determined when the library is generated and normally should not be changed.


setBaseUrl

public JsonHttpClient.Builder setBaseUrl(GenericUrl baseUrl)
Sets the base URL of the service, for example "https://www.googleapis.com/tasks/v1/". Must be URL-encoded and must end with a "/". This is determined when the library is generated and normally should not be changed. Subclasses should override by calling super.

Since:
1.7

setJsonHttpRequestInitializer

public JsonHttpClient.Builder setJsonHttpRequestInitializer(JsonHttpRequestInitializer jsonHttpRequestInitializer)
Sets the JSON HTTP request initializer or null for none. Subclasses should override by calling super.


getJsonHttpRequestInitializer

public JsonHttpRequestInitializer getJsonHttpRequestInitializer()
Returns the JSON HTTP request initializer or null for none.


setHttpRequestInitializer

public JsonHttpClient.Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer)
Sets the HTTP request initializer or null for none. Subclasses should override by calling super.


getHttpRequestInitializer

public final HttpRequestInitializer getHttpRequestInitializer()
Returns the HTTP request initializer or null for none.


setApplicationName

public JsonHttpClient.Builder setApplicationName(String applicationName)
Sets the application name to be used in the UserAgent header of each request or null for none. Subclasses should override by calling super.


getApplicationName

public final String getApplicationName()
Returns the application name to be used in the UserAgent header of each request or null for none.



Copyright © 2011-2012 Google. All Rights Reserved.