Skip to content

Commit 9af4186

Browse files
committed
Javadoc fixes
1 parent 32e725a commit 9af4186

12 files changed

+204
-194
lines changed

library/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.loopj.android.http"
4-
android:versionName="1.4.4-SNAPSHOT"
4+
android:versionName="1.4.4"
55
android:versionCode="144">
66

77
<uses-sdk

library/src/com/loopj/android/http/AsyncHttpClient.java

+110-77
Large diffs are not rendered by default.

library/src/com/loopj/android/http/AsyncHttpResponseHandler.java

+10-11
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,12 @@
3737
import java.net.URI;
3838

3939
/**
40-
* Used to intercept and handle the responses from requests made using
41-
* {@link AsyncHttpClient}. The {@link #onSuccess(int, org.apache.http.Header[], byte[])} method is
42-
* designed to be anonymously overridden with your own response handling code.
43-
* <p>&nbsp;</p>
44-
* Additionally, you can override the {@link #onFailure(int, org.apache.http.Header[], byte[], Throwable)},
45-
* {@link #onStart()}, {@link #onFinish()}, {@link #onRetry()} and {@link #onProgress(int, int)} methods as required.
46-
* <p>&nbsp;</p>
47-
* For example:
48-
* <p>&nbsp;</p>
40+
* Used to intercept and handle the responses from requests made using {@link AsyncHttpClient}. The
41+
* {@link #onSuccess(int, org.apache.http.Header[], byte[])} method is designed to be anonymously
42+
* overridden with your own response handling code. <p>&nbsp;</p> Additionally, you can override the
43+
* {@link #onFailure(int, org.apache.http.Header[], byte[], Throwable)}, {@link #onStart()}, {@link
44+
* #onFinish()}, {@link #onRetry()} and {@link #onProgress(int, int)} methods as required.
45+
* <p>&nbsp;</p> For example: <p>&nbsp;</p>
4946
* <pre>
5047
* AsyncHttpClient client = new AsyncHttpClient();
5148
* client.get("http://www.google.com", new AsyncHttpResponseHandler() {
@@ -60,7 +57,8 @@
6057
* }
6158
*
6259
* &#064;Override
63-
* public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
60+
* public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error)
61+
* {
6462
* // Response failed :(
6563
* }
6664
*
@@ -193,7 +191,8 @@ public void onStart() {
193191
}
194192

195193
/**
196-
* Fired in all cases when the request is finished, after both success and failure, override to handle in your own code
194+
* Fired in all cases when the request is finished, after both success and failure, override to
195+
* handle in your own code
197196
*/
198197
public void onFinish() {
199198
}

library/src/com/loopj/android/http/BinaryHttpResponseHandler.java

+7-11
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@
3030
import java.util.regex.PatternSyntaxException;
3131

3232
/**
33-
* Used to intercept and handle the responses from requests made using
34-
* {@link AsyncHttpClient}. Receives response body as byte array with a
35-
* content-type whitelist. (e.g. checks Content-Type against allowed list,
36-
* Content-length).
37-
* <p>&nbsp;</p>
38-
* For example:
39-
* <p>&nbsp;</p>
33+
* Used to intercept and handle the responses from requests made using {@link AsyncHttpClient}.
34+
* Receives response body as byte array with a content-type whitelist. (e.g. checks Content-Type
35+
* against allowed list, Content-length). <p>&nbsp;</p> For example: <p>&nbsp;</p>
4036
* <pre>
4137
* AsyncHttpClient client = new AsyncHttpClient();
4238
* String[] allowedTypes = new String[] { "image/png" };
@@ -61,8 +57,8 @@ public class BinaryHttpResponseHandler extends AsyncHttpResponseHandler {
6157
};
6258

6359
/**
64-
* Method can be overriden to return allowed content types,
65-
* can be sometimes better than passing data in constructor
60+
* Method can be overriden to return allowed content types, can be sometimes better than passing
61+
* data in constructor
6662
*
6763
* @return array of content-types or Pattern string templates (eg. '.*' to match every response)
6864
*/
@@ -78,8 +74,8 @@ public BinaryHttpResponseHandler() {
7874
}
7975

8076
/**
81-
* Creates a new BinaryHttpResponseHandler, and overrides the default allowed
82-
* content types with passed String array (hopefully) of content types.
77+
* Creates a new BinaryHttpResponseHandler, and overrides the default allowed content types with
78+
* passed String array (hopefully) of content types.
8379
*
8480
* @param allowedContentTypes content types array, eg. 'image/jpeg' or pattern '.*'
8581
*/

library/src/com/loopj/android/http/JsonHttpResponseHandler.java

+17-28
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,11 @@
2828
import org.json.JSONTokener;
2929

3030
/**
31-
* Used to intercept and handle the responses from requests made using
32-
* {@link AsyncHttpClient}, with automatic parsing into a {@link JSONObject}
33-
* or {@link JSONArray}.
34-
* <p>&nbsp;</p>
35-
* This class is designed to be passed to get, post, put and delete requests
36-
* with the {@link #onSuccess(JSONObject)} or {@link #onSuccess(JSONArray)}
37-
* methods anonymously overridden.
38-
* <p>&nbsp;</p>
39-
* Additionally, you can override the other event methods from the
40-
* parent class.
31+
* Used to intercept and handle the responses from requests made using {@link AsyncHttpClient}, with
32+
* automatic parsing into a {@link JSONObject} or {@link JSONArray}. <p>&nbsp;</p> This class is
33+
* designed to be passed to get, post, put and delete requests with the {@link
34+
* #onSuccess(JSONObject)} or {@link #onSuccess(JSONArray)} methods anonymously overridden.
35+
* <p>&nbsp;</p> Additionally, you can override the other event methods from the parent class.
4136
*/
4237
public class JsonHttpResponseHandler extends TextHttpResponseHandler {
4338
private static final String LOG_TAG = "JsonHttpResponseHandler";
@@ -59,9 +54,8 @@ public JsonHttpResponseHandler(String encoding) {
5954
//
6055

6156
/**
62-
* Fired when a request returns successfully and contains a json object
63-
* at the base of the response string. Override to handle in your
64-
* own code.
57+
* Fired when a request returns successfully and contains a json object at the base of the
58+
* response string. Override to handle in your own code.
6559
*
6660
* @param response the parsed json object found in the server response (if any)
6761
*/
@@ -70,19 +64,17 @@ public void onSuccess(JSONObject response) {
7064

7165

7266
/**
73-
* Fired when a request returns successfully and contains a json array
74-
* at the base of the response string. Override to handle in your
75-
* own code.
67+
* Fired when a request returns successfully and contains a json array at the base of the
68+
* response string. Override to handle in your own code.
7669
*
7770
* @param response the parsed json array found in the server response (if any)
7871
*/
7972
public void onSuccess(JSONArray response) {
8073
}
8174

8275
/**
83-
* Fired when a request returns successfully and contains a json object
84-
* at the base of the response string. Override to handle in your
85-
* own code.
76+
* Fired when a request returns successfully and contains a json object at the base of the
77+
* response string. Override to handle in your own code.
8678
*
8779
* @param statusCode the status code of the response
8880
* @param headers the headers of the HTTP response
@@ -93,9 +85,8 @@ public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
9385
}
9486

9587
/**
96-
* Fired when a request returns successfully and contains a json object
97-
* at the base of the response string. Override to handle in your
98-
* own code.
88+
* Fired when a request returns successfully and contains a json object at the base of the
89+
* response string. Override to handle in your own code.
9990
*
10091
* @param statusCode the status code of the response
10192
* @param response the parsed json object found in the server response (if any)
@@ -105,9 +96,8 @@ public void onSuccess(int statusCode, JSONObject response) {
10596
}
10697

10798
/**
108-
* Fired when a request returns successfully and contains a json array
109-
* at the base of the response string. Override to handle in your
110-
* own code.
99+
* Fired when a request returns successfully and contains a json array at the base of the
100+
* response string. Override to handle in your own code.
111101
*
112102
* @param statusCode the status code of the response
113103
* @param headers the headers of the HTTP response
@@ -118,9 +108,8 @@ public void onSuccess(int statusCode, Header[] headers, JSONArray response) {
118108
}
119109

120110
/**
121-
* Fired when a request returns successfully and contains a json array
122-
* at the base of the response string. Override to handle in your
123-
* own code.
111+
* Fired when a request returns successfully and contains a json array at the base of the
112+
* response string. Override to handle in your own code.
124113
*
125114
* @param statusCode the status code of the response
126115
* @param response the parsed json array found in the server response (if any)

library/src/com/loopj/android/http/MySSLSocketFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import javax.net.ssl.X509TrustManager;
1616

1717
/**
18-
* This file is introduced to fix HTTPS Post bug on API &lt; ICS
19-
* see http://code.google.com/p/android/issues/detail?id=13117#c14
18+
* This file is introduced to fix HTTPS Post bug on API &lt; ICS see
19+
* http://code.google.com/p/android/issues/detail?id=13117#c14
2020
*/
2121
public class MySSLSocketFactory extends SSLSocketFactory {
2222
SSLContext sslContext = SSLContext.getInstance("TLS");

library/src/com/loopj/android/http/PersistentCookieStore.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,10 @@
3535
import java.util.concurrent.ConcurrentHashMap;
3636

3737
/**
38-
* A persistent cookie store which implements the Apache HttpClient
39-
* {@link CookieStore} interface. Cookies are stored and will persist on the
40-
* user's device between application sessions since they are serialized and
41-
* stored in {@link SharedPreferences}.
42-
* <p>&nbsp;</p>
43-
* Instances of this class are designed to be used with
44-
* {@link AsyncHttpClient#setCookieStore}, but can also be used with a
38+
* A persistent cookie store which implements the Apache HttpClient {@link CookieStore} interface.
39+
* Cookies are stored and will persist on the user's device between application sessions since they
40+
* are serialized and stored in {@link SharedPreferences}. <p>&nbsp;</p> Instances of this class are
41+
* designed to be used with {@link AsyncHttpClient#setCookieStore}, but can also be used with a
4542
* regular old apache HttpClient/HttpContext if you prefer.
4643
*/
4744
public class PersistentCookieStore implements CookieStore {

library/src/com/loopj/android/http/RequestHandle.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@ public RequestHandle(Future<?> request) {
1313
}
1414

1515
/**
16-
* Attempts to cancel this request. This attempt will fail if the request has
17-
* already completed, has already been cancelled, or could not be cancelled
18-
* for some other reason. If successful, and this request has not started
19-
* when cancel is called, this request should never run. If the request has
20-
* already started, then the mayInterruptIfRunning parameter determines
21-
* whether the thread executing this request should be interrupted in an
22-
* attempt to stop the request.
23-
* <p/>
24-
* After this method returns, subsequent calls to isDone() will always
25-
* return true. Subsequent calls to isCancelled() will always return true
26-
* if this method returned true.
16+
* Attempts to cancel this request. This attempt will fail if the request has already completed,
17+
* has already been cancelled, or could not be cancelled for some other reason. If successful,
18+
* and this request has not started when cancel is called, this request should never run. If the
19+
* request has already started, then the mayInterruptIfRunning parameter determines whether the
20+
* thread executing this request should be interrupted in an attempt to stop the request.
21+
* <p>&nbsp;</p> After this method returns, subsequent calls to isDone() will always return
22+
* true. Subsequent calls to isCancelled() will always return true if this method returned
23+
* true.
2724
*
28-
* @param mayInterruptIfRunning true if the thread executing this request should be interrupted; otherwise, in-progress requests are allowed to complete
29-
* @return false if the request could not be cancelled, typically because it has already completed normally; true otherwise
25+
* @param mayInterruptIfRunning true if the thread executing this request should be interrupted;
26+
* otherwise, in-progress requests are allowed to complete
27+
* @return false if the request could not be cancelled, typically because it has already
28+
* completed normally; true otherwise
3029
*/
3130
public boolean cancel(boolean mayInterruptIfRunning) {
3231
return this.request != null && request.cancel(mayInterruptIfRunning);
3332
}
3433

3534
/**
36-
* Returns true if this task completed. Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true.
35+
* Returns true if this task completed. Completion may be due to normal termination, an
36+
* exception, or cancellation -- in all of these cases, this method will return true.
3737
*
3838
* @return true if this task completed
3939
*/

library/src/com/loopj/android/http/RequestParams.java

+24-26
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,8 @@
4040
import java.util.concurrent.ConcurrentHashMap;
4141

4242
/**
43-
* A collection of string request parameters or files to send along with
44-
* requests made from an {@link AsyncHttpClient} instance.
45-
* <p>&nbsp;</p>
46-
* For example:
47-
* <p>&nbsp;</p>
43+
* A collection of string request parameters or files to send along with requests made from an
44+
* {@link AsyncHttpClient} instance. <p>&nbsp;</p> For example: <p>&nbsp;</p>
4845
* <pre>
4946
* RequestParams params = new RequestParams();
5047
* params.put("username", "james");
@@ -54,34 +51,34 @@
5451
* params.put("profile_picture2", someInputStream); // Upload an InputStream
5552
* params.put("profile_picture3", new ByteArrayInputStream(someBytes)); // Upload some bytes
5653
*
57-
* Map<String, String> map = new HashMap<String, String>();
54+
* Map&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
5855
* map.put("first_name", "James");
5956
* map.put("last_name", "Smith");
60-
* params.put("user", map); // url params: "user[first_name]=James&user[last_name]=Smith"
57+
* params.put("user", map); // url params: "user[first_name]=James&amp;user[last_name]=Smith"
6158
*
62-
* Set<String> set = new HashSet<String>(); // unordered collection
59+
* Set&lt;String&gt; set = new HashSet&lt;String&gt;(); // unordered collection
6360
* set.add("music");
6461
* set.add("art");
65-
* params.put("like", set); // url params: "like=music&like=art"
62+
* params.put("like", set); // url params: "like=music&amp;like=art"
6663
*
67-
* List<String> list = new ArrayList<String>(); // Ordered collection
64+
* List&lt;String&gt; list = new ArrayList&lt;String&gt;(); // Ordered collection
6865
* list.add("Java");
6966
* list.add("C");
70-
* params.put("languages", list); // url params: "languages[]=Java&languages[]=C"
67+
* params.put("languages", list); // url params: "languages[]=Java&amp;languages[]=C"
7168
*
7269
* String[] colors = { "blue", "yellow" }; // Ordered collection
73-
* params.put("colors", colors); // url params: "colors[]=blue&colors[]=yellow"
70+
* params.put("colors", colors); // url params: "colors[]=blue&amp;colors[]=yellow"
7471
*
75-
* List<Map<String, String>> listOfMaps = new ArrayList<Map<String, String>>();
76-
* Map<String, String> user1 = new HashMap<String, String>();
72+
* List&lt;Map&lt;String, String&gt;&gt; listOfMaps = new ArrayList&lt;Map&lt;String, String&gt;&gt;();
73+
* Map&lt;String, String&gt; user1 = new HashMap&lt;String, String&gt;();
7774
* user1.put("age", "30");
7875
* user1.put("gender", "male");
79-
* Map<String, String> user2 = new HashMap<String, String>();
76+
* Map&lt;String, String&gt; user2 = new HashMap&lt;String, String&gt;();
8077
* user2.put("age", "25");
8178
* user2.put("gender", "female");
8279
* listOfMaps.add(user1);
8380
* listOfMaps.add(user2);
84-
* params.put("users", listOfMaps); // url params: "users[][age]=30&users[][gender]=male&users[][age]=25&users[][gender]=female"
81+
* params.put("users", listOfMaps); // url params: "users[][age]=30&amp;users[][gender]=male&amp;users[][age]=25&amp;users[][gender]=female"
8582
*
8683
* AsyncHttpClient client = new AsyncHttpClient();
8784
* client.post("http://myendpoint.com", params, responseHandler);
@@ -96,15 +93,15 @@ public class RequestParams {
9693
protected ConcurrentHashMap<String, Object> urlParamsWithObjects;
9794

9895
/**
99-
* Constructs a new empty <code>RequestParams</code> instance.
96+
* Constructs a new empty {@code RequestParams} instance.
10097
*/
10198
public RequestParams() {
10299
this((Map<String, String>) null);
103100
}
104101

105102
/**
106-
* Constructs a new RequestParams instance containing the key/value
107-
* string params from the specified map.
103+
* Constructs a new RequestParams instance containing the key/value string params from the
104+
* specified map.
108105
*
109106
* @param source the source key/value string map to add.
110107
*/
@@ -118,8 +115,8 @@ public RequestParams(Map<String, String> source) {
118115
}
119116

120117
/**
121-
* Constructs a new RequestParams instance and populate it with a single
122-
* initial key/value string param.
118+
* Constructs a new RequestParams instance and populate it with a single initial key/value
119+
* string param.
123120
*
124121
* @param key the key name for the intial param.
125122
* @param value the value string for the initial param.
@@ -131,11 +128,11 @@ public RequestParams(final String key, final String value) {
131128
}
132129

133130
/**
134-
* Constructs a new RequestParams instance and populate it with multiple
135-
* initial key/value string param.
131+
* Constructs a new RequestParams instance and populate it with multiple initial key/value
132+
* string param.
136133
*
137-
* @param keysAndValues a sequence of keys and values. Objects are
138-
* automatically converted to Strings (including the value {@code null}).
134+
* @param keysAndValues a sequence of keys and values. Objects are automatically converted to
135+
* Strings (including the value {@code null}).
139136
* @throws IllegalArgumentException if the number of arguments isn't even.
140137
*/
141138
public RequestParams(Object... keysAndValues) {
@@ -319,7 +316,8 @@ public void setHttpEntityIsRepeatable(boolean isRepeatable) {
319316
* Returns an HttpEntity containing all request parameters
320317
*
321318
* @param progressHandler HttpResponseHandler for reporting progress on entity submit
322-
* @return HttpEntity resulting HttpEntity to be included along with {@link org.apache.http.client.methods.HttpEntityEnclosingRequestBase}
319+
* @return HttpEntity resulting HttpEntity to be included along with {@link
320+
* org.apache.http.client.methods.HttpEntityEnclosingRequestBase}
323321
* @throws IOException if one of the streams cannot be read
324322
*/
325323
public HttpEntity getEntity(ResponseHandlerInterface progressHandler) throws IOException {

library/src/com/loopj/android/http/ResponseHandlerInterface.java

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public interface ResponseHandlerInterface {
1515
* Returns data whether request completed successfully
1616
*
1717
* @param response HttpResponse object with data
18+
* @throws java.io.IOException if retrieving data from response fails
1819
*/
1920
void sendResponseMessage(HttpResponse response) throws IOException;
2021

@@ -76,11 +77,15 @@ public interface ResponseHandlerInterface {
7677

7778
/**
7879
* Helper for handlers to receive Request URI info
80+
*
81+
* @param requestURI claimed request URI
7982
*/
8083
public void setRequestURI(URI requestURI);
8184

8285
/**
8386
* Helper for handlers to receive Request Header[] info
87+
*
88+
* @param requestHeaders Headers, claimed to be from original request
8489
*/
8590
public void setRequestHeaders(Header[] requestHeaders);
8691

0 commit comments

Comments
 (0)