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

Correct rendering of '@' in Javadoc.

上级 471a12ee
......@@ -32,12 +32,12 @@ import retrofit2.Retrofit;
* <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
......
......@@ -31,12 +31,12 @@ import retrofit2.Retrofit;
* <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
......
......@@ -37,12 +37,12 @@ import rx.functions.Func1;
* <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
......
......@@ -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>>() {
......@@ -50,7 +50,7 @@ public interface CallAdapter<T> {
* }
* });
* }
* }</pre>
* </code></pre>
*/
<R> T adapt(Call<R> call);
......
......@@ -43,7 +43,7 @@ import static retrofit2.Utils.checkNotNull;
* 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())
......@@ -51,7 +51,7 @@ import static retrofit2.Utils.checkNotNull;
*
* MyApi api = retrofit.create(MyApi.class);
* Response<User> user = api.getUser().execute();
* }</pre>
* </code></pre>
*
* @author Bob Lee (bob@squareup.com)
* @author Jake Wharton (jw@squareup.com)
......
......@@ -32,8 +32,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* request body.
* <p>
* Body parameters may not be {@code null}.
*
* @author Eric Denman (edenman@squareup.com)
*/
@Documented
@Target(PARAMETER)
......
......@@ -30,22 +30,22 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* 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}.
*
......
......@@ -26,11 +26,11 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* 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>
......
......@@ -25,19 +25,19 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* 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)
......
......@@ -24,19 +24,15 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* 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 (adrianc@netflix.com)
*/
@Documented
@Retention(RUNTIME)
......
......@@ -24,8 +24,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Adds headers literally supplied in the {@code value}.
* <p>
* <pre>{@code
* <pre><code>
* &#64;Headers("Cache-Control: max-age=640000")
* &#64;GET("/")
* ...
......@@ -36,12 +35,9 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* })
* &#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 (adrianc@netflix.com)
*/
@Documented
@Target(METHOD)
......
......@@ -40,13 +40,13 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* <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}.
*/
......
......@@ -34,13 +34,13 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* {@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.
*
......
......@@ -27,20 +27,20 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* {@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>
......
......@@ -30,33 +30,33 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* 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
......
......@@ -28,19 +28,19 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* 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>
......
......@@ -26,10 +26,10 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* 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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册