|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.client.http.json.JsonHttpClient.Builder
public static class JsonHttpClient.Builder
Builder for JsonHttpClient
.
Implementation is not thread-safe.
Constructor Summary | |
---|---|
protected |
JsonHttpClient.Builder(HttpTransport transport,
JsonFactory jsonFactory,
GenericUrl baseUrl)
Deprecated. (scheduled to be removed in 1.11) Use #Builder(HttpTransport, JsonFactory,
String, String, HttpRequestInitializer) instead. |
|
JsonHttpClient.Builder(HttpTransport transport,
JsonFactory jsonFactory,
String rootUrl,
String servicePath,
HttpRequestInitializer httpRequestInitializer)
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()
Deprecated. (scheduled to be removed in 1.11) Use getRootUrl() and
getServicePath() instead. |
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. |
JsonObjectParser |
getObjectParser()
Returns the JSON parser used or null if not specified. |
String |
getRootUrl()
Returns the root URL of the service, for example https://www.googleapis.com/ . |
String |
getServicePath()
Returns the service path of the service, for example "tasks/v1/" . |
HttpTransport |
getTransport()
Returns the HTTP transport. |
protected boolean |
isBaseUrlUsed()
Deprecated. (scheduled to be removed in 1.11) Use getRootUrl() and
getServicePath() instead. |
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)
Deprecated. (scheduled to be removed in 1.11) Use setRootUrl(java.lang.String) and
setServicePath(java.lang.String) instead. |
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. |
JsonHttpClient.Builder |
setObjectParser(JsonObjectParser parser)
Specifies the JSON parser to use or null if no used. |
JsonHttpClient.Builder |
setRootUrl(String rootUrl)
Sets the root URL of the service, for example https://www.googleapis.com/ . |
JsonHttpClient.Builder |
setServicePath(String servicePath)
Sets the service path of the service, for example "tasks/v1/" . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Deprecated protected JsonHttpClient.Builder(HttpTransport transport, JsonFactory jsonFactory, GenericUrl baseUrl)
#Builder(HttpTransport, JsonFactory,
String, String, HttpRequestInitializer)
instead.
transport
- The transport to use for requestsjsonFactory
- A factory for creating JSON parsers and serializersbaseUrl
- The base URL of the service. Must end with a "/"public JsonHttpClient.Builder(HttpTransport transport, JsonFactory jsonFactory, String rootUrl, String servicePath, HttpRequestInitializer httpRequestInitializer)
transport
- The transport to use for requestsjsonFactory
- A factory for creating JSON parsers and serializersrootUrl
- The root URL of the service. Must end with a "/"servicePath
- The service path of the service. Must end with a "/" and not begin with a
"/". It is allowed to be an empty string ""
httpRequestInitializer
- The HTTP request initializer or null
for noneMethod Detail |
---|
public JsonHttpClient build()
JsonHttpClient
.
@Deprecated protected final boolean isBaseUrlUsed()
getRootUrl()
and
getServicePath()
instead.
baseUrl
is used instead of rootUrl
and servicePath
.
public final JsonFactory getJsonFactory()
public final HttpTransport getTransport()
public final JsonObjectParser getObjectParser()
null
if not specified.
Warning: This method will stop returning null
in 1.11, and will return
JsonFactory.createJsonObjectParser()
instead.
public JsonHttpClient.Builder setObjectParser(JsonObjectParser parser)
null
if no used.
Warning: This method will stop accepting null
in 1.11. The default will then be
JsonFactory.createJsonObjectParser()
.
@Deprecated public final GenericUrl getBaseUrl()
getRootUrl()
and
getServicePath()
instead.
"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.
Use this method only if baseUrl
is used instead of rootUrl
and
servicePath
.
@Deprecated public JsonHttpClient.Builder setBaseUrl(GenericUrl baseUrl)
setRootUrl(java.lang.String)
and
setServicePath(java.lang.String)
instead.
"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.
Use this method only if baseUrl
is used instead of rootUrl
and
servicePath
.
public final String getRootUrl()
https://www.googleapis.com/
. Must be
URL-encoded and must end with a "/".
Use this method only if rootUrl
and servicePath
are used instead of
baseUrl
.
public JsonHttpClient.Builder setRootUrl(String rootUrl)
https://www.googleapis.com/
. Must be
URL-encoded and must end with a "/". This is determined when the library is generated and
normally should be changed. Subclasses should override by calling super.
Use this method only if rootUrl
and servicePath
are used instead of
baseUrl
.
public final String getServicePath()
"tasks/v1/"
. Must be URL-encoded
and must end with a "/" and not begin with a "/". It is allowed to be an empty string
""
.
Use this method only if rootUrl
and servicePath
are used instead of
baseUrl
.
public JsonHttpClient.Builder setServicePath(String servicePath)
"tasks/v1/"
. Must be URL-encoded
and must end with a "/" and not begin with a "/". It is allowed to be an empty string
""
. This is determined when the library is generated and normally should not be
changed. Subclasses should override by calling super.
Use this method only if rootUrl
and servicePath
are used instead of
baseUrl
.
public JsonHttpClient.Builder setJsonHttpRequestInitializer(JsonHttpRequestInitializer jsonHttpRequestInitializer)
null
for none. Subclasses should override
by calling super.
public JsonHttpRequestInitializer getJsonHttpRequestInitializer()
null
for none.
public JsonHttpClient.Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer)
null
for none. Subclasses should override by
calling super.
public final HttpRequestInitializer getHttpRequestInitializer()
null
for none.
public JsonHttpClient.Builder setApplicationName(String applicationName)
null
for none. Subclasses should override by calling super.
public final String getApplicationName()
null
for none.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |