Skip to content

Commit

Permalink
Merge pull request square#1720 from square/jw/crappydoc
Browse files Browse the repository at this point in the history
Correct rendering of '@' in Javadoc.
  • Loading branch information
swankjesse committed Apr 6, 2016
2 parents 471a12e + 39e5666 commit 9de61e0
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
* <p>
* Adding this class to {@link Retrofit} allows you to return {@link ListenableFuture} from service
* methods.
* <pre>{@code
* <pre><code>
* interface MyService {
* &#64;GET("user/me")
* ListenableFuture<User> getUser()
* }
* }</pre>
* </code></pre>
* There are two configurations supported for the {@code ListenableFuture} type parameter:
* <ul>
* <li>Direct body (e.g., {@code ListenableFuture<User>}) returns the deserialized body for 2XX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
* <p>
* Adding this class to {@link Retrofit} allows you to return {@link CompletableFuture} from
* service methods.
* <pre>{@code
* <pre><code>
* interface MyService {
* &#64;GET("user/me")
* CompletableFuture<User> getUser()
* }
* }</pre>
* </code></pre>
* There are two configurations supported for the {@code CompletableFuture} type parameter:
* <ul>
* <li>Direct body (e.g., {@code CompletableFuture<User>}) returns the deserialized body for 2XX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
* <p>
* Adding this class to {@link Retrofit} allows you to return {@link Observable} from service
* methods.
* <pre>{@code
* <pre><code>
* interface MyService {
* &#64;GET("user/me")
* Observable<User> getUser()
* }
* }</pre>
* </code></pre>
* There are three configurations supported for the {@code Observable} type parameter:
* <ul>
* <li>Direct body (e.g., {@code Observable<User>}) calls {@code onNext} with the deserialized body
Expand Down
4 changes: 2 additions & 2 deletions retrofit/src/main/java/retrofit2/CallAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public interface CallAdapter<T> {
* <p>
* For example, given an instance for a hypothetical utility, {@code Async}, this instance would
* return a new {@code Async<R>} which invoked {@code call} when run.
* <pre>{@code
* <pre><code>
* &#64;Override
* public <R> Async<R> adapt(final Call<R> call) {
* return Async.create(new Callable<Response<R>>() {
Expand All @@ -50,7 +50,7 @@ public interface CallAdapter<T> {
* }
* });
* }
* }</pre>
* </code></pre>
*/
<R> T adapt(Call<R> call);

Expand Down
4 changes: 2 additions & 2 deletions retrofit/src/main/java/retrofit2/Retrofit.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@
* the builder} and pass your interface to {@link #create} to generate an implementation.
* <p>
* For example,
* <pre>{@code
* <pre><code>
* Retrofit retrofit = new Retrofit.Builder()
* .baseUrl("https://api.example.com/")
* .addConverterFactory(GsonConverterFactory.create())
* .build();
*
* MyApi api = retrofit.create(MyApi.class);
* Response<User> user = api.getUser().execute();
* }</pre>
* </code></pre>
*
* @author Bob Lee ([email protected])
* @author Jake Wharton ([email protected])
Expand Down
2 changes: 0 additions & 2 deletions retrofit/src/main/java/retrofit2/http/Body.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
* request body.
* <p>
* Body parameters may not be {@code null}.
*
* @author Eric Denman ([email protected])
*/
@Documented
@Target(PARAMETER)
Expand Down
8 changes: 4 additions & 4 deletions retrofit/src/main/java/retrofit2/http/Field.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@
* field pair for each non-{@code null} item.
* <p>
* Simple Example:
* <pre>{@code
* <pre><code>
* &#64;FormUrlEncoded
* &#64;POST("/")
* Call&lt;ResponseBody> example(
* &#64;Field("name") String name,
* &#64;Field("occupation") String occupation);
* }</pre>
* </code></pre>
* Calling with {@code foo.example("Bob Smith", "President")} yields a request body of
* {@code name=Bob+Smith&occupation=President}.
* <p>
* Array/Varargs Example:
* <pre>{@code
* <pre><code>
* &#64;FormUrlEncoded
* &#64;POST("/list")
* Call&lt;ResponseBody> example(@Field("name") String... names);
* }</pre>
* </code></pre>
* Calling with {@code foo.example("Bob Smith", "Jane Doe")} yields a request body of
* {@code name=Bob+Smith&name=Jane+Doe}.
*
Expand Down
4 changes: 2 additions & 2 deletions retrofit/src/main/java/retrofit2/http/FieldMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
* Named key/value pairs for a form-encoded request.
* <p>
* Simple Example:
* <pre>{@code
* <pre><code>
* &#64;FormUrlEncoded
* &#64;POST("/things")
* Call&lt;ResponseBody> things(@FieldMap Map&lt;String, String&gt; fields);
* }</pre>
* </code></pre>
* Calling with {@code foo.things(ImmutableMap.of("foo", "bar", "kit", "kat")} yields a request
* body of {@code foo=bar&kit=kat}.
* <p>
Expand Down
8 changes: 4 additions & 4 deletions retrofit/src/main/java/retrofit2/http/HTTP.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@

/**
* Use a custom HTTP verb for a request.
* <pre>{@code
* <pre><code>
* interface Service {
* &#064;HTTP(method = "CUSTOM", path = "custom/endpoint/")
* Call<ResponseBody> customEndpoint();
* }
* }</pre>
* </code></pre>
* This annotation can also used for sending {@code DELETE} with a request body:
* <pre>{@code
* <pre><code>
* interface Service {
* &#064;HTTP(method = "DELETE", path = "remove/", hasBody = true)
* Call<ResponseBody> deleteObject(@Body RequestBody object);
* }
* }</pre>
* </code></pre>
*/
@Documented
@Target(METHOD)
Expand Down
8 changes: 2 additions & 6 deletions retrofit/src/main/java/retrofit2/http/Header.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,15 @@

/**
* Replaces the header with the value of its target.
* <p>
* <pre>{@code
* <pre><code>
* &#64;GET("/")
* Call&lt;ResponseBody> foo(@Header("Accept-Language") String lang);
* }</pre>
* <p>
* </code></pre>
* Header parameters may be {@code null} which will omit them from the request. Passing a
* {@link java.util.List List} or array will result in a header for each non-{@code null} item.
* <p>
* <strong>Note:</strong> Headers do not overwrite each other. All headers with the same name will
* be included in the request.
*
* @author Adrian Cole ([email protected])
*/
@Documented
@Retention(RUNTIME)
Expand Down
8 changes: 2 additions & 6 deletions retrofit/src/main/java/retrofit2/http/Headers.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

/**
* Adds headers literally supplied in the {@code value}.
* <p>
* <pre>{@code
* <pre><code>
* &#64;Headers("Cache-Control: max-age=640000")
* &#64;GET("/")
* ...
Expand All @@ -36,12 +35,9 @@
* })
* &#64;GET("/")
* ...
* }</pre>
* <p>
* </code></pre>
* <strong>Note:</strong> Headers do not overwrite each other. All headers with the same name will
* be included in the request.
*
* @author Adrian Cole ([email protected])
*/
@Documented
@Target(METHOD)
Expand Down
4 changes: 2 additions & 2 deletions retrofit/src/main/java/retrofit2/http/Part.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
* <p>
* Values may be {@code null} which will omit them from the request body.
* <p>
* <pre>{@code
* <pre><code>
* &#64;Multipart
* &#64;POST("/")
* Call&lt;ResponseBody> example(
* &#64;Part("description") String description,
* &#64;Part(value = "image", encoding = "8-bit") RequestBody image);
* }</pre>
* </code></pre>
* <p>
* Part parameters may not be {@code null}.
*/
Expand Down
4 changes: 2 additions & 2 deletions retrofit/src/main/java/retrofit2/http/PartMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
* {@linkplain Converter a converter}.</li>
* </ul>
* <p>
* <pre>{@code
* <pre><code>
* &#64;Multipart
* &#64;POST("/upload")
* Call&lt;ResponseBody> upload(
* &#64;Part("file") RequestBody file,
* &#64;PartMap Map&lt;String, RequestBody&gt; params);
* }</pre>
* </code></pre>
* <p>
* A {@code null} value for the map, as a key, or as a value is not allowed.
*
Expand Down
8 changes: 4 additions & 4 deletions retrofit/src/main/java/retrofit2/http/Path.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
* {@link String#valueOf(Object)} and URL encoded.
* <p>
* Simple example:
* <pre>{@code
* <pre><code>
* &#64;GET("/image/{id}")
* Call&lt;ResponseBody> example(@Path("id") int id);
* }</pre>
* </code></pre>
* Calling with {@code foo.example(1)} yields {@code /image/1}.
* <p>
* Values are URL encoded by default. Disable with {@code encoded=true}.
* <pre>{@code
* <pre><code>
* &#64;GET("/user/{name}")
* Call&lt;ResponseBody> encoded(@Path("name") String name);
*
* &#64;GET("/user/{name}")
* Call&lt;ResponseBody> notEncoded(@Path(value="name", encoded=true) String name);
* }</pre>
* </code></pre>
* Calling {@code foo.encoded("John+Doe")} yields {@code /user/John%2BDoe} whereas
* {@code foo.notEncoded("John+Doe")} yields {@code /user/John+Doe}.
* <p>
Expand Down
16 changes: 8 additions & 8 deletions retrofit/src/main/java/retrofit2/http/Query.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,33 @@
* query parameter for each non-{@code null} item.
* <p>
* Simple Example:
* <pre>{@code
* <pre><code>
* &#64;GET("/list")
* Call&lt;ResponseBody> list(@Query("page") int page);
* }</pre>
* </code></pre>
* Calling with {@code foo.list(1)} yields {@code /list?page=1}.
* <p>
* Example with {@code null}:
* <pre>{@code
* <pre><code>
* &#64;GET("/list")
* Call&lt;ResponseBody> list(@Query("category") String category);
* }</pre>
* </code></pre>
* Calling with {@code foo.list(null)} yields {@code /list}.
* <p>
* Array/Varargs Example:
* <pre>{@code
* <pre><code>
* &#64;GET("/list")
* Call&lt;ResponseBody> list(@Query("category") String... categories);
* }</pre>
* </code></pre>
* Calling with {@code foo.list("bar", "baz")} yields
* {@code /list?category=bar&category=baz}.
* <p>
* Parameter names and values are URL encoded by default. Specify {@link #encoded() encoded=true}
* to change this behavior.
* <pre>{@code
* <pre><code>
* &#64;GET("/search")
* Call&lt;ResponseBody> list(@Query(value="foo", encoded=true) String foo);
* }</pre>
* </code></pre>
* Calling with {@code foo.list("foo+bar"))} yields {@code /search?foo=foo+bar}.
*
* @see QueryMap
Expand Down
8 changes: 4 additions & 4 deletions retrofit/src/main/java/retrofit2/http/QueryMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@
* Both keys and values are converted to strings using {@link String#valueOf(Object)}.
* <p>
* Simple Example:
* <pre>{@code
* <pre><code>
* &#64;GET("/search")
* Call&lt;ResponseBody> list(@QueryMap Map&lt;String, String&gt; filters);
* }</pre>
* </code></pre>
* Calling with {@code foo.list(ImmutableMap.of("foo", "bar", "kit", "kat"))} yields
* {@code /search?foo=bar&kit=kat}.
* <p>
* Map keys and values representing parameter values are URL encoded by default. Specify
* {@link #encoded() encoded=true} to change this behavior.
* <pre>{@code
* <pre><code>
* &#64;GET("/search")
* Call&lt;ResponseBody> list(@QueryMap(encoded=true) Map&lt;String, String&gt; filters);
* }</pre>
* </code></pre>
* Calling with {@code foo.list(ImmutableMap.of("foo", "foo+bar"))} yields
* {@code /search?foo=foo+bar}.
* <p>
Expand Down
4 changes: 2 additions & 2 deletions retrofit/src/main/java/retrofit2/http/Url.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

/**
* URL resolved against the {@linkplain Retrofit#baseUrl() base URL}.
* <pre>{@code
* <pre><code>
* &#64;GET
* Call&lt;ResponseBody> list(@Url String url);
* }</pre>
* </code></pre>
* <p>
* See {@linkplain retrofit2.Retrofit.Builder#baseUrl(HttpUrl) base URL} for details of how
* the value will be resolved against a base URL to create the full endpoint URL.
Expand Down

0 comments on commit 9de61e0

Please sign in to comment.