提交 39e5666d 编写于 作者: J Jake Wharton

Correct rendering of '@' in Javadoc.

上级 471a12ee
...@@ -32,12 +32,12 @@ import retrofit2.Retrofit; ...@@ -32,12 +32,12 @@ import retrofit2.Retrofit;
* <p> * <p>
* Adding this class to {@link Retrofit} allows you to return {@link ListenableFuture} from service * Adding this class to {@link Retrofit} allows you to return {@link ListenableFuture} from service
* methods. * methods.
* <pre>{@code * <pre><code>
* interface MyService { * interface MyService {
* &#64;GET("user/me") * &#64;GET("user/me")
* ListenableFuture<User> getUser() * ListenableFuture<User> getUser()
* } * }
* }</pre> * </code></pre>
* There are two configurations supported for the {@code ListenableFuture} type parameter: * There are two configurations supported for the {@code ListenableFuture} type parameter:
* <ul> * <ul>
* <li>Direct body (e.g., {@code ListenableFuture<User>}) returns the deserialized body for 2XX * <li>Direct body (e.g., {@code ListenableFuture<User>}) returns the deserialized body for 2XX
......
...@@ -31,12 +31,12 @@ import retrofit2.Retrofit; ...@@ -31,12 +31,12 @@ import retrofit2.Retrofit;
* <p> * <p>
* Adding this class to {@link Retrofit} allows you to return {@link CompletableFuture} from * Adding this class to {@link Retrofit} allows you to return {@link CompletableFuture} from
* service methods. * service methods.
* <pre>{@code * <pre><code>
* interface MyService { * interface MyService {
* &#64;GET("user/me") * &#64;GET("user/me")
* CompletableFuture<User> getUser() * CompletableFuture<User> getUser()
* } * }
* }</pre> * </code></pre>
* There are two configurations supported for the {@code CompletableFuture} type parameter: * There are two configurations supported for the {@code CompletableFuture} type parameter:
* <ul> * <ul>
* <li>Direct body (e.g., {@code CompletableFuture<User>}) returns the deserialized body for 2XX * <li>Direct body (e.g., {@code CompletableFuture<User>}) returns the deserialized body for 2XX
......
...@@ -37,12 +37,12 @@ import rx.functions.Func1; ...@@ -37,12 +37,12 @@ import rx.functions.Func1;
* <p> * <p>
* Adding this class to {@link Retrofit} allows you to return {@link Observable} from service * Adding this class to {@link Retrofit} allows you to return {@link Observable} from service
* methods. * methods.
* <pre>{@code * <pre><code>
* interface MyService { * interface MyService {
* &#64;GET("user/me") * &#64;GET("user/me")
* Observable<User> getUser() * Observable<User> getUser()
* } * }
* }</pre> * </code></pre>
* There are three configurations supported for the {@code Observable} type parameter: * There are three configurations supported for the {@code Observable} type parameter:
* <ul> * <ul>
* <li>Direct body (e.g., {@code Observable<User>}) calls {@code onNext} with the deserialized body * <li>Direct body (e.g., {@code Observable<User>}) calls {@code onNext} with the deserialized body
......
...@@ -40,7 +40,7 @@ public interface CallAdapter<T> { ...@@ -40,7 +40,7 @@ public interface CallAdapter<T> {
* <p> * <p>
* For example, given an instance for a hypothetical utility, {@code Async}, this instance would * 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. * return a new {@code Async<R>} which invoked {@code call} when run.
* <pre>{@code * <pre><code>
* &#64;Override * &#64;Override
* public <R> Async<R> adapt(final Call<R> call) { * public <R> Async<R> adapt(final Call<R> call) {
* return Async.create(new Callable<Response<R>>() { * return Async.create(new Callable<Response<R>>() {
...@@ -50,7 +50,7 @@ public interface CallAdapter<T> { ...@@ -50,7 +50,7 @@ public interface CallAdapter<T> {
* } * }
* }); * });
* } * }
* }</pre> * </code></pre>
*/ */
<R> T adapt(Call<R> call); <R> T adapt(Call<R> call);
......
...@@ -43,7 +43,7 @@ import static retrofit2.Utils.checkNotNull; ...@@ -43,7 +43,7 @@ import static retrofit2.Utils.checkNotNull;
* the builder} and pass your interface to {@link #create} to generate an implementation. * the builder} and pass your interface to {@link #create} to generate an implementation.
* <p> * <p>
* For example, * For example,
* <pre>{@code * <pre><code>
* Retrofit retrofit = new Retrofit.Builder() * Retrofit retrofit = new Retrofit.Builder()
* .baseUrl("https://api.example.com/") * .baseUrl("https://api.example.com/")
* .addConverterFactory(GsonConverterFactory.create()) * .addConverterFactory(GsonConverterFactory.create())
...@@ -51,7 +51,7 @@ import static retrofit2.Utils.checkNotNull; ...@@ -51,7 +51,7 @@ import static retrofit2.Utils.checkNotNull;
* *
* MyApi api = retrofit.create(MyApi.class); * MyApi api = retrofit.create(MyApi.class);
* Response<User> user = api.getUser().execute(); * Response<User> user = api.getUser().execute();
* }</pre> * </code></pre>
* *
* @author Bob Lee (bob@squareup.com) * @author Bob Lee (bob@squareup.com)
* @author Jake Wharton (jw@squareup.com) * @author Jake Wharton (jw@squareup.com)
......
...@@ -32,8 +32,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -32,8 +32,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* request body. * request body.
* <p> * <p>
* Body parameters may not be {@code null}. * Body parameters may not be {@code null}.
*
* @author Eric Denman (edenman@squareup.com)
*/ */
@Documented @Documented
@Target(PARAMETER) @Target(PARAMETER)
......
...@@ -30,22 +30,22 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -30,22 +30,22 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* field pair for each non-{@code null} item. * field pair for each non-{@code null} item.
* <p> * <p>
* Simple Example: * Simple Example:
* <pre>{@code * <pre><code>
* &#64;FormUrlEncoded * &#64;FormUrlEncoded
* &#64;POST("/") * &#64;POST("/")
* Call&lt;ResponseBody> example( * Call&lt;ResponseBody> example(
* &#64;Field("name") String name, * &#64;Field("name") String name,
* &#64;Field("occupation") String occupation); * &#64;Field("occupation") String occupation);
* }</pre> * </code></pre>
* Calling with {@code foo.example("Bob Smith", "President")} yields a request body of * Calling with {@code foo.example("Bob Smith", "President")} yields a request body of
* {@code name=Bob+Smith&occupation=President}. * {@code name=Bob+Smith&occupation=President}.
* <p> * <p>
* Array/Varargs Example: * Array/Varargs Example:
* <pre>{@code * <pre><code>
* &#64;FormUrlEncoded * &#64;FormUrlEncoded
* &#64;POST("/list") * &#64;POST("/list")
* Call&lt;ResponseBody> example(@Field("name") String... names); * 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 * Calling with {@code foo.example("Bob Smith", "Jane Doe")} yields a request body of
* {@code name=Bob+Smith&name=Jane+Doe}. * {@code name=Bob+Smith&name=Jane+Doe}.
* *
......
...@@ -26,11 +26,11 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -26,11 +26,11 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* Named key/value pairs for a form-encoded request. * Named key/value pairs for a form-encoded request.
* <p> * <p>
* Simple Example: * Simple Example:
* <pre>{@code * <pre><code>
* &#64;FormUrlEncoded * &#64;FormUrlEncoded
* &#64;POST("/things") * &#64;POST("/things")
* Call&lt;ResponseBody> things(@FieldMap Map&lt;String, String&gt; fields); * 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 * Calling with {@code foo.things(ImmutableMap.of("foo", "bar", "kit", "kat")} yields a request
* body of {@code foo=bar&kit=kat}. * body of {@code foo=bar&kit=kat}.
* <p> * <p>
......
...@@ -25,19 +25,19 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -25,19 +25,19 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Use a custom HTTP verb for a request. * Use a custom HTTP verb for a request.
* <pre>{@code * <pre><code>
* interface Service { * interface Service {
* &#064;HTTP(method = "CUSTOM", path = "custom/endpoint/") * &#064;HTTP(method = "CUSTOM", path = "custom/endpoint/")
* Call<ResponseBody> customEndpoint(); * Call<ResponseBody> customEndpoint();
* } * }
* }</pre> * </code></pre>
* This annotation can also used for sending {@code DELETE} with a request body: * This annotation can also used for sending {@code DELETE} with a request body:
* <pre>{@code * <pre><code>
* interface Service { * interface Service {
* &#064;HTTP(method = "DELETE", path = "remove/", hasBody = true) * &#064;HTTP(method = "DELETE", path = "remove/", hasBody = true)
* Call<ResponseBody> deleteObject(@Body RequestBody object); * Call<ResponseBody> deleteObject(@Body RequestBody object);
* } * }
* }</pre> * </code></pre>
*/ */
@Documented @Documented
@Target(METHOD) @Target(METHOD)
......
...@@ -24,19 +24,15 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -24,19 +24,15 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Replaces the header with the value of its target. * Replaces the header with the value of its target.
* <p> * <pre><code>
* <pre>{@code
* &#64;GET("/") * &#64;GET("/")
* Call&lt;ResponseBody> foo(@Header("Accept-Language") String lang); * Call&lt;ResponseBody> foo(@Header("Accept-Language") String lang);
* }</pre> * </code></pre>
* <p>
* Header parameters may be {@code null} which will omit them from the request. Passing a * 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. * {@link java.util.List List} or array will result in a header for each non-{@code null} item.
* <p> * <p>
* <strong>Note:</strong> Headers do not overwrite each other. All headers with the same name will * <strong>Note:</strong> Headers do not overwrite each other. All headers with the same name will
* be included in the request. * be included in the request.
*
* @author Adrian Cole (adrianc@netflix.com)
*/ */
@Documented @Documented
@Retention(RUNTIME) @Retention(RUNTIME)
......
...@@ -24,8 +24,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -24,8 +24,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Adds headers literally supplied in the {@code value}. * Adds headers literally supplied in the {@code value}.
* <p> * <pre><code>
* <pre>{@code
* &#64;Headers("Cache-Control: max-age=640000") * &#64;Headers("Cache-Control: max-age=640000")
* &#64;GET("/") * &#64;GET("/")
* ... * ...
...@@ -36,12 +35,9 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -36,12 +35,9 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* }) * })
* &#64;GET("/") * &#64;GET("/")
* ... * ...
* }</pre> * </code></pre>
* <p>
* <strong>Note:</strong> Headers do not overwrite each other. All headers with the same name will * <strong>Note:</strong> Headers do not overwrite each other. All headers with the same name will
* be included in the request. * be included in the request.
*
* @author Adrian Cole (adrianc@netflix.com)
*/ */
@Documented @Documented
@Target(METHOD) @Target(METHOD)
......
...@@ -40,13 +40,13 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -40,13 +40,13 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* <p> * <p>
* Values may be {@code null} which will omit them from the request body. * Values may be {@code null} which will omit them from the request body.
* <p> * <p>
* <pre>{@code * <pre><code>
* &#64;Multipart * &#64;Multipart
* &#64;POST("/") * &#64;POST("/")
* Call&lt;ResponseBody> example( * Call&lt;ResponseBody> example(
* &#64;Part("description") String description, * &#64;Part("description") String description,
* &#64;Part(value = "image", encoding = "8-bit") RequestBody image); * &#64;Part(value = "image", encoding = "8-bit") RequestBody image);
* }</pre> * </code></pre>
* <p> * <p>
* Part parameters may not be {@code null}. * Part parameters may not be {@code null}.
*/ */
......
...@@ -34,13 +34,13 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -34,13 +34,13 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* {@linkplain Converter a converter}.</li> * {@linkplain Converter a converter}.</li>
* </ul> * </ul>
* <p> * <p>
* <pre>{@code * <pre><code>
* &#64;Multipart * &#64;Multipart
* &#64;POST("/upload") * &#64;POST("/upload")
* Call&lt;ResponseBody> upload( * Call&lt;ResponseBody> upload(
* &#64;Part("file") RequestBody file, * &#64;Part("file") RequestBody file,
* &#64;PartMap Map&lt;String, RequestBody&gt; params); * &#64;PartMap Map&lt;String, RequestBody&gt; params);
* }</pre> * </code></pre>
* <p> * <p>
* A {@code null} value for the map, as a key, or as a value is not allowed. * A {@code null} value for the map, as a key, or as a value is not allowed.
* *
......
...@@ -27,20 +27,20 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -27,20 +27,20 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* {@link String#valueOf(Object)} and URL encoded. * {@link String#valueOf(Object)} and URL encoded.
* <p> * <p>
* Simple example: * Simple example:
* <pre>{@code * <pre><code>
* &#64;GET("/image/{id}") * &#64;GET("/image/{id}")
* Call&lt;ResponseBody> example(@Path("id") int id); * Call&lt;ResponseBody> example(@Path("id") int id);
* }</pre> * </code></pre>
* Calling with {@code foo.example(1)} yields {@code /image/1}. * Calling with {@code foo.example(1)} yields {@code /image/1}.
* <p> * <p>
* Values are URL encoded by default. Disable with {@code encoded=true}. * Values are URL encoded by default. Disable with {@code encoded=true}.
* <pre>{@code * <pre><code>
* &#64;GET("/user/{name}") * &#64;GET("/user/{name}")
* Call&lt;ResponseBody> encoded(@Path("name") String name); * Call&lt;ResponseBody> encoded(@Path("name") String name);
* *
* &#64;GET("/user/{name}") * &#64;GET("/user/{name}")
* Call&lt;ResponseBody> notEncoded(@Path(value="name", encoded=true) String 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 * Calling {@code foo.encoded("John+Doe")} yields {@code /user/John%2BDoe} whereas
* {@code foo.notEncoded("John+Doe")} yields {@code /user/John+Doe}. * {@code foo.notEncoded("John+Doe")} yields {@code /user/John+Doe}.
* <p> * <p>
......
...@@ -30,33 +30,33 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -30,33 +30,33 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* query parameter for each non-{@code null} item. * query parameter for each non-{@code null} item.
* <p> * <p>
* Simple Example: * Simple Example:
* <pre>{@code * <pre><code>
* &#64;GET("/list") * &#64;GET("/list")
* Call&lt;ResponseBody> list(@Query("page") int page); * Call&lt;ResponseBody> list(@Query("page") int page);
* }</pre> * </code></pre>
* Calling with {@code foo.list(1)} yields {@code /list?page=1}. * Calling with {@code foo.list(1)} yields {@code /list?page=1}.
* <p> * <p>
* Example with {@code null}: * Example with {@code null}:
* <pre>{@code * <pre><code>
* &#64;GET("/list") * &#64;GET("/list")
* Call&lt;ResponseBody> list(@Query("category") String category); * Call&lt;ResponseBody> list(@Query("category") String category);
* }</pre> * </code></pre>
* Calling with {@code foo.list(null)} yields {@code /list}. * Calling with {@code foo.list(null)} yields {@code /list}.
* <p> * <p>
* Array/Varargs Example: * Array/Varargs Example:
* <pre>{@code * <pre><code>
* &#64;GET("/list") * &#64;GET("/list")
* Call&lt;ResponseBody> list(@Query("category") String... categories); * Call&lt;ResponseBody> list(@Query("category") String... categories);
* }</pre> * </code></pre>
* Calling with {@code foo.list("bar", "baz")} yields * Calling with {@code foo.list("bar", "baz")} yields
* {@code /list?category=bar&category=baz}. * {@code /list?category=bar&category=baz}.
* <p> * <p>
* Parameter names and values are URL encoded by default. Specify {@link #encoded() encoded=true} * Parameter names and values are URL encoded by default. Specify {@link #encoded() encoded=true}
* to change this behavior. * to change this behavior.
* <pre>{@code * <pre><code>
* &#64;GET("/search") * &#64;GET("/search")
* Call&lt;ResponseBody> list(@Query(value="foo", encoded=true) String foo); * 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}. * Calling with {@code foo.list("foo+bar"))} yields {@code /search?foo=foo+bar}.
* *
* @see QueryMap * @see QueryMap
......
...@@ -28,19 +28,19 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -28,19 +28,19 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* Both keys and values are converted to strings using {@link String#valueOf(Object)}. * Both keys and values are converted to strings using {@link String#valueOf(Object)}.
* <p> * <p>
* Simple Example: * Simple Example:
* <pre>{@code * <pre><code>
* &#64;GET("/search") * &#64;GET("/search")
* Call&lt;ResponseBody> list(@QueryMap Map&lt;String, String&gt; filters); * 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 * Calling with {@code foo.list(ImmutableMap.of("foo", "bar", "kit", "kat"))} yields
* {@code /search?foo=bar&kit=kat}. * {@code /search?foo=bar&kit=kat}.
* <p> * <p>
* Map keys and values representing parameter values are URL encoded by default. Specify * Map keys and values representing parameter values are URL encoded by default. Specify
* {@link #encoded() encoded=true} to change this behavior. * {@link #encoded() encoded=true} to change this behavior.
* <pre>{@code * <pre><code>
* &#64;GET("/search") * &#64;GET("/search")
* Call&lt;ResponseBody> list(@QueryMap(encoded=true) Map&lt;String, String&gt; filters); * 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 * Calling with {@code foo.list(ImmutableMap.of("foo", "foo+bar"))} yields
* {@code /search?foo=foo+bar}. * {@code /search?foo=foo+bar}.
* <p> * <p>
......
...@@ -26,10 +26,10 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; ...@@ -26,10 +26,10 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* URL resolved against the {@linkplain Retrofit#baseUrl() base URL}. * URL resolved against the {@linkplain Retrofit#baseUrl() base URL}.
* <pre>{@code * <pre><code>
* &#64;GET * &#64;GET
* Call&lt;ResponseBody> list(@Url String url); * Call&lt;ResponseBody> list(@Url String url);
* }</pre> * </code></pre>
* <p> * <p>
* See {@linkplain retrofit2.Retrofit.Builder#baseUrl(HttpUrl) base URL} for details of how * 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. * the value will be resolved against a base URL to create the full endpoint URL.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册