From commits-return-4800-archive-asf-public=cust-asf.ponee.io@juneau.apache.org Mon Jan 8 03:01:12 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 3D140180654 for ; Mon, 8 Jan 2018 03:01:12 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2D40D160C2A; Mon, 8 Jan 2018 02:01:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 03697160C3D for ; Mon, 8 Jan 2018 03:01:09 +0100 (CET) Received: (qmail 53864 invoked by uid 500); 8 Jan 2018 02:01:09 -0000 Mailing-List: contact commits-help@juneau.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@juneau.apache.org Delivered-To: mailing list commits@juneau.apache.org Received: (qmail 53855 invoked by uid 99); 8 Jan 2018 02:01:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jan 2018 02:01:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 82B9718064E for ; Mon, 8 Jan 2018 02:01:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -11.731 X-Spam-Level: X-Spam-Status: No, score=-11.731 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id j-IsQjFuFd_k for ; Mon, 8 Jan 2018 02:00:56 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id C48AC5F65C for ; Mon, 8 Jan 2018 02:00:54 +0000 (UTC) Received: (qmail 53617 invoked by uid 99); 8 Jan 2018 02:00:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jan 2018 02:00:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2BF21DF965; Mon, 8 Jan 2018 02:00:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jamesbognar@apache.org To: commits@juneau.incubator.apache.org Date: Mon, 08 Jan 2018 02:00:51 -0000 Message-Id: <1cdad334b854495788175d0826fa607f@git.apache.org> In-Reply-To: <320404025e77476c914c417b3f46cd2e@git.apache.org> References: <320404025e77476c914c417b3f46cd2e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/4] juneau git commit: Javadoc updates. http://git-wip-us.apache.org/repos/asf/juneau/blob/7780e6fe/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java ---------------------------------------------------------------------- diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java index 4803ade..03b4d97 100644 --- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java +++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java @@ -183,25 +183,6 @@ public class RestClientBuilder extends BeanContextBuilder { } /** - * Set a root URL for this client. - * - *

- * When set, URL strings passed in through the various rest call methods (e.g. {@link RestClient#doGet(Object)} - * will be prefixed with the specified root. - * This root URL is ignored on those methods if you pass in a {@link URL}, {@link URI}, or an absolute URL string. - * - * @param rootUrl - * The root URL to prefix to relative URL strings. - * Trailing slashes are trimmed. - * Usually a String but you can also pass in URI and URL objects as well. - * @return This object (for method chaining). - */ - public RestClientBuilder rootUrl(Object rootUrl) { - set(RESTCLIENT_rootUri, rootUrl); - return this; - } - - /** * Enable SSL support on this client. * * @param opts @@ -242,16 +223,6 @@ public class RestClientBuilder extends BeanContextBuilder { } /** - * Adds an interceptor that gets called immediately after a connection is made. - * - * @param interceptor The interceptor. - * @return This object (for method chaining). - */ - public RestClientBuilder interceptor(RestCallInterceptor interceptor) { - return addTo(RESTCLIENT_interceptors, interceptor); - } - - /** * Adds a {@link RestCallLogger} to the list of interceptors on this class. * * @param level The log level to log messages at. @@ -263,23 +234,6 @@ public class RestClientBuilder extends BeanContextBuilder { } /** - * Make HTTP calls retryable if an error response (>=400) is received. - * - * @param retries The number of retries to attempt. - * @param interval The time in milliseconds between attempts. - * @param retryOn - * Optional object used for determining whether a retry should be attempted. - * If null, uses {@link RetryOn#DEFAULT}. - * @return This object (for method chaining). - */ - public RestClientBuilder retryable(int retries, int interval, RetryOn retryOn) { - set(RESTCLIENT_retries, retries); - set(RESTCLIENT_retryInterval, interval); - set(RESTCLIENT_retryOn, retryOn); - return this; - } - - /** * When called, the {@link #createConnectionManager()} method will return a {@link PoolingHttpClientConnectionManager} * instead of a {@link BasicHttpClientConnectionManager}. * @@ -291,73 +245,6 @@ public class RestClientBuilder extends BeanContextBuilder { } /** - * Sets the serializer used for serializing POJOs to the HTTP request message body. - * - * @param serializer The serializer. - * @return This object (for method chaining). - */ - public RestClientBuilder serializer(Serializer serializer) { - return set(RESTCLIENT_serializer, serializer); - } - - /** - * Same as {@link #serializer(Serializer)}, except takes in a serializer class that will be instantiated through a - * no-arg constructor. - * - * @param serializerClass The serializer class. - * @return This object (for method chaining). - */ - public RestClientBuilder serializer(Class serializerClass) { - return set(RESTCLIENT_serializer, serializerClass); - } - - /** - * Sets the parser used for parsing POJOs from the HTTP response message body. - * - * @param parser The parser. - * @return This object (for method chaining). - */ - public RestClientBuilder parser(Parser parser) { - set(RESTCLIENT_parser, parser); - return this; - } - - /** - * Same as {@link #parser(Parser)}, except takes in a parser class that will be instantiated through a no-arg - * constructor. - * - * @param parserClass The parser class. - * @return This object (for method chaining). - */ - public RestClientBuilder parser(Class parserClass) { - return set(RESTCLIENT_parser, parserClass); - } - - /** - * Sets the part serializer to use for converting POJOs to headers, query parameters, form-data parameters, and - * path variables. - * - * @param partSerializer The part serializer instance. - * @return This object (for method chaining). - */ - public RestClientBuilder partSerializer(HttpPartSerializer partSerializer) { - return set(RESTCLIENT_partSerializer, partSerializer); - } - - /** - * Sets the part formatter to use for converting POJOs to headers, query parameters, form-data parameters, and - * path variables. - * - * @param partSerializerClass - * The part serializer class. - * The class must have a no-arg constructor. - * @return This object (for method chaining). - */ - public RestClientBuilder partSerializer(Class partSerializerClass) { - return set(RESTCLIENT_partSerializer, partSerializerClass); - } - - /** * Set up this client to use BASIC auth. * * @param host The auth scope hostname. @@ -388,32 +275,6 @@ public class RestClientBuilder extends BeanContextBuilder { return this; } - /** - * Defines the executor service to use when calling future methods on the {@link RestCall} class. - * - *

- * This executor service is used to create {@link Future} objects on the following methods: - *

    - *
  • {@link RestCall#runFuture()} - *
  • {@link RestCall#getResponseFuture(Class)} - *
  • {@link RestCall#getResponseFuture(Type,Type...)} - *
  • {@link RestCall#getResponseAsString()} - *
- * - *

- * The default executor service is a single-threaded {@link ThreadPoolExecutor} with a 30 second timeout - * and a queue size of 10. - * - * @param executorService The executor service. - * @param shutdownOnClose Call {@link ExecutorService#shutdown()} when {@link RestClient#close()} is called. - * @return This object (for method chaining). - */ - public RestClientBuilder executorService(ExecutorService executorService, boolean shutdownOnClose) { - set(RESTCLIENT_executorService, executorService); - set(RESTCLIENT_executorServiceShutdownOnClose, shutdownOnClose); - return this; - } - //-------------------------------------------------------------------------------- // HTTP headers @@ -682,6 +543,20 @@ public class RestClientBuilder extends BeanContextBuilder { } /** + * When called, No-Trace: true is added to requests. + * + *

+ * This gives the opportunity for the servlet to not log errors on invalid requests. + * This is useful for testing purposes when you don't want your log file to show lots of errors that are simply the + * results of testing. + * + * @return This object (for method chaining). + */ + public RestClientBuilder noTrace() { + return header("No-Trace", true); + } + + /** * Sets the value for the Origin request header. * *

@@ -817,269 +692,420 @@ public class RestClientBuilder extends BeanContextBuilder { //-------------------------------------------------------------------------------- /** - * Sets the {@link Serializer#SERIALIZER_abridged} property on all serializers in this group. + * Defines the executor service to use when calling future methods on the {@link RestCall} class. * - * @param value The new value for this property. + *

+ * This executor service is used to create {@link Future} objects on the following methods: + *

    + *
  • {@link RestCall#runFuture()} + *
  • {@link RestCall#getResponseFuture(Class)} + *
  • {@link RestCall#getResponseFuture(Type,Type...)} + *
  • {@link RestCall#getResponseAsString()} + *
+ * + *

+ * The default executor service is a single-threaded {@link ThreadPoolExecutor} with a 30 second timeout + * and a queue size of 10. + * + *

See Also:
+ *
    + *
  • {@link RestClient#RESTCLIENT_executorService} + *
  • {@link RestClient#RESTCLIENT_executorServiceShutdownOnClose} + *
+ * + * @param executorService The executor service. + * @param shutdownOnClose Call {@link ExecutorService#shutdown()} when {@link RestClient#close()} is called. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_abridged */ - public RestClientBuilder abridged(boolean value) { - return set(SERIALIZER_abridged, value); + public RestClientBuilder executorService(ExecutorService executorService, boolean shutdownOnClose) { + set(RESTCLIENT_executorService, executorService); + set(RESTCLIENT_executorServiceShutdownOnClose, shutdownOnClose); + return this; } /** - * Sets the {@link Serializer#SERIALIZER_addBeanTypeProperties} property on all serializers in this group. + * Configuration property: Request headers. * - * @param value The new value for this property. + *
See Also:
+ *
    + *
  • {@link RestClient#RESTCLIENT_headers} + *
+ * + * @param key The header name. + * @param value The header value. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_addBeanTypeProperties */ - public RestClientBuilder addBeanTypeProperties(boolean value) { - return set(SERIALIZER_addBeanTypeProperties, value); + public RestClientBuilder header(String key, Object value) { + return addTo(RESTCLIENT_headers, key, value); } /** - * Sets the {@link Serializer#SERIALIZER_detectRecursions} property on all serializers in this group. + * Configuration property: Keep HttpClient open. + * + *

+ * Don't close this client when the {@link RestClient#close()} method is called. * + *

See Also:
+ *
    + *
  • {@link RestClient#RESTCLIENT_keepHttpClientOpen} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_detectRecursions */ - public RestClientBuilder detectRecursions(boolean value) { - return set(SERIALIZER_detectRecursions, value); + public RestClientBuilder keepHttpClientOpen(boolean value) { + return set(RESTCLIENT_keepHttpClientOpen, value); } /** - * Sets the {@link Parser#PARSER_fileCharset} property on all parsers in this group. + * Adds an interceptor that gets called immediately after a connection is made. * - * @param value The new value for this property. + *
See Also:
+ *
    + *
  • {@link RestClient#RESTCLIENT_interceptors} + *
+ * + * @param interceptor The interceptor. * @return This object (for method chaining). - * @see Parser#PARSER_fileCharset */ - public RestClientBuilder fileCharset(String value) { - return set(PARSER_fileCharset, value); + public RestClientBuilder interceptor(RestCallInterceptor interceptor) { + return addTo(RESTCLIENT_interceptors, interceptor); } /** - * Configuration property: Request headers. + * Sets the parser used for parsing POJOs from the HTTP response message body. * - * @param key The header name. - * @param value The header value. + *
See Also:
+ *
    + *
  • {@link RestClient#RESTCLIENT_parser} + *
+ * + * @param parser The parser. * @return This object (for method chaining). - * @see RestClient#RESTCLIENT_headers */ - public RestClientBuilder header(String key, Object value) { - return addTo(RESTCLIENT_headers, key, value); + public RestClientBuilder parser(Parser parser) { + return set(RESTCLIENT_parser, parser); } /** - * Sets the {@link Serializer#SERIALIZER_ignoreRecursions} property on all serializers in this group. + * Same as {@link #parser(Parser)}, except takes in a parser class that will be instantiated through a no-arg + * constructor. * - * @param value The new value for this property. + *
See Also:
+ *
    + *
  • {@link RestClient#RESTCLIENT_parser} + *
+ * + * @param parserClass The parser class. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_ignoreRecursions */ - public RestClientBuilder ignoreRecursions(boolean value) { - return set(SERIALIZER_ignoreRecursions, value); + public RestClientBuilder parser(Class parserClass) { + return set(RESTCLIENT_parser, parserClass); } /** - * Sets the {@link Serializer#SERIALIZER_initialDepth} property on all serializers in this group. + * Sets the part serializer to use for converting POJOs to headers, query parameters, form-data parameters, and + * path variables. * - * @param value The new value for this property. + *
See Also:
+ *
    + *
  • {@link RestClient#RESTCLIENT_partSerializer} + *
+ * + * @param partSerializer The part serializer instance. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_initialDepth */ - public RestClientBuilder initialDepth(int value) { - return set(SERIALIZER_initialDepth, value); + public RestClientBuilder partSerializer(HttpPartSerializer partSerializer) { + return set(RESTCLIENT_partSerializer, partSerializer); } /** - * Sets the {@link Parser#PARSER_inputStreamCharset} property on all parsers in this group. + * Sets the part formatter to use for converting POJOs to headers, query parameters, form-data parameters, and + * path variables. * - * @param value The new value for this property. + *
See Also:
+ *
    + *
  • {@link RestClient#RESTCLIENT_partSerializer} + *
+ * + * @param partSerializerClass + * The part serializer class. + * The class must have a no-arg constructor. * @return This object (for method chaining). - * @see Parser#PARSER_inputStreamCharset */ - public RestClientBuilder inputStreamCharset(String value) { - return set(PARSER_inputStreamCharset, value); + public RestClientBuilder partSerializer(Class partSerializerClass) { + return set(RESTCLIENT_partSerializer, partSerializerClass); } /** - * Configuration property: Keep HttpClient open. + * Make HTTP calls retryable if an error response (>=400) is received. + * + *
See Also:
+ *
    + *
  • {@link RestClient#RESTCLIENT_retries} + *
  • {@link RestClient#RESTCLIENT_retryInterval} + *
  • {@link RestClient#RESTCLIENT_retryOn} + *
+ * + * @param retries The number of retries to attempt. + * @param interval The time in milliseconds between attempts. + * @param retryOn + * Optional object used for determining whether a retry should be attempted. + * If null, uses {@link RetryOn#DEFAULT}. + * @return This object (for method chaining). + */ + public RestClientBuilder retryable(int retries, int interval, RetryOn retryOn) { + set(RESTCLIENT_retries, retries); + set(RESTCLIENT_retryInterval, interval); + set(RESTCLIENT_retryOn, retryOn); + return this; + } + + /** + * Set a root URL for this client. * *

- * Don't close this client when the {@link RestClient#close()} method is called. + * When set, URL strings passed in through the various rest call methods (e.g. {@link RestClient#doGet(Object)} + * will be prefixed with the specified root. + * This root URL is ignored on those methods if you pass in a {@link URL}, {@link URI}, or an absolute URL string. * - *

Notes:
+ *
See Also:
*
    - *
  • This is equivalent to calling set(RESTCLIENT_keepHttpClientOpen, value). + *
  • {@link RestClient#RESTCLIENT_rootUri} *
+ * + * @param rootUrl + * The root URL to prefix to relative URL strings. + * Trailing slashes are trimmed. + * Usually a String but you can also pass in URI and URL objects as well. + * @return This object (for method chaining). + */ + public RestClientBuilder rootUrl(Object rootUrl) { + return set(RESTCLIENT_rootUri, rootUrl); + } + + /** + * Configuration property: Request query parameters. * - * @param value The new value for this property. + *
See Also:
+ *
    + *
  • {@link RestClient#RESTCLIENT_query} + *
+ * + * @param key The query parameter name. + * @param value The query parameter value value. * @return This object (for method chaining). - * @see RestClient#RESTCLIENT_keepHttpClientOpen */ - public RestClientBuilder keepHttpClientOpen(boolean value) { - return set(RESTCLIENT_keepHttpClientOpen, value); + public RestClientBuilder query(String key, Object value) { + return addTo(RESTCLIENT_query, key, value); } /** - * Sets the {@link Serializer#SERIALIZER_listener} and {@link Parser#PARSER_listener} property on all - * serializers and parsers in this group. + * Sets the serializer used for serializing POJOs to the HTTP request message body. * - * @param sl The new serializer listener. - * @param pl The new parser listener. + *
See Also:
+ *
    + *
  • {@link RestClient#RESTCLIENT_serializer} + *
+ * + * @param serializer The serializer. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_abridged */ - public RestClientBuilder listeners(Class sl, Class pl) { - set(SERIALIZER_listener, sl); - set(PARSER_listener, pl); - return this; + public RestClientBuilder serializer(Serializer serializer) { + return set(RESTCLIENT_serializer, serializer); } /** - * Sets the {@link Serializer#SERIALIZER_maxDepth} property on all serializers in this group. + * Same as {@link #serializer(Serializer)}, except takes in a serializer class that will be instantiated through a + * no-arg constructor. * - * @param value The new value for this property. + *
See Also:
+ *
    + *
  • {@link RestClient#RESTCLIENT_serializer} + *
+ * + * @param serializerClass The serializer class. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_maxDepth */ - public RestClientBuilder maxDepth(int value) { - return set(SERIALIZER_maxDepth, value); + public RestClientBuilder serializer(Class serializerClass) { + return set(RESTCLIENT_serializer, serializerClass); } /** - * Sets the {@link Serializer#SERIALIZER_maxIndent} property on all serializers in this group. + * Sets the {@link Serializer#SERIALIZER_abridged} property on all serializers in this group. * + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_abridged} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_maxIndent */ - public RestClientBuilder maxIndent(boolean value) { - return set(SERIALIZER_maxIndent, value); + public RestClientBuilder abridged(boolean value) { + return set(SERIALIZER_abridged, value); } /** - * When called, No-Trace: true is added to requests. - * - *

- * This gives the opportunity for the servlet to not log errors on invalid requests. - * This is useful for testing purposes when you don't want your log file to show lots of errors that are simply the - * results of testing. + * Sets the {@link Serializer#SERIALIZER_addBeanTypeProperties} property on all serializers in this group. * + *

See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_addBeanTypeProperties} + *
+ * + * @param value The new value for this property. * @return This object (for method chaining). */ - public RestClientBuilder noTrace() { - return header("No-Trace", true); + public RestClientBuilder addBeanTypeProperties(boolean value) { + return set(SERIALIZER_addBeanTypeProperties, value); } /** - * Sets the {@link UonSerializer#UON_paramFormat} property on the URL-encoding serializers in this group. - * - *

- * This overrides the behavior of the URL-encoding serializer to quote and escape characters in query names and - * values that may be confused for UON notation (e.g. "'(foo=123)'", "'@(1,2,3)'"). + * Sets the {@link Serializer#SERIALIZER_detectRecursions} property on all serializers in this group. * + *

See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_detectRecursions} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see UonSerializer#UON_paramFormat */ - public RestClientBuilder paramFormat(String value) { - super.set(UON_paramFormat, value); - return this; + public RestClientBuilder detectRecursions(boolean value) { + return set(SERIALIZER_detectRecursions, value); } /** - * Shortcut for calling paramFormat("PLAINTEXT"). + * Sets the {@link Serializer#SERIALIZER_ignoreRecursions} property on all serializers in this group. * - *

- * The default behavior is to serialize part values (query parameters, form data, headers, path variables) in UON - * notation. - * Calling this method forces plain-text to be used instead. + *

See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_ignoreRecursions} + *
+ * + * @param value The new value for this property. + * @return This object (for method chaining). + */ + public RestClientBuilder ignoreRecursions(boolean value) { + return set(SERIALIZER_ignoreRecursions, value); + } + + /** + * Sets the {@link Serializer#SERIALIZER_initialDepth} property on all serializers in this group. * - *

- * Specifically, UON notation has the following effects: + *

See Also:
*
    - *
  • Boolean strings ("true"/"false") and numeric values ("123") will be - * quoted ("'true'", "'false'", "'123'". - *
    This allows them to be differentiated from actual boolean and numeric values. - *
  • String such as "(foo='bar')" that mimic UON structures will be quoted and escaped to - * "'(foo=bar~'baz~')'". + *
  • {@link Serializer#SERIALIZER_initialDepth} *
- *

- * The down-side to using plain text part serialization is that you cannot serialize arbitrary POJOs. + * + * @param value The new value for this property. + * @return This object (for method chaining). + */ + public RestClientBuilder initialDepth(int value) { + return set(SERIALIZER_initialDepth, value); + } + + /** + * Sets the {@link Serializer#SERIALIZER_maxDepth} property on all serializers in this group. * + *

See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_maxDepth} + *
+ * + * @param value The new value for this property. * @return This object (for method chaining). */ - public RestClientBuilder plainTextParts() { - super.set(UON_paramFormat, "PLAINTEXT"); - return this; + public RestClientBuilder maxDepth(int value) { + return set(SERIALIZER_maxDepth, value); } /** - * Configuration property: Request query parameters. + * Sets the {@link Serializer#SERIALIZER_maxIndent} property on all serializers in this group. * - * @param key The query parameter name. - * @param value The query parameter value value. + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_maxIndent} + *
+ * + * @param value The new value for this property. * @return This object (for method chaining). - * @see RestClient#RESTCLIENT_query */ - public RestClientBuilder query(String key, Object value) { - return addTo(RESTCLIENT_query, key, value); + public RestClientBuilder maxIndent(boolean value) { + return set(SERIALIZER_maxIndent, value); } /** * Sets the {@link Serializer#SERIALIZER_quoteChar} property on all serializers in this group. * + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_quoteChar} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_quoteChar */ public RestClientBuilder quoteChar(char value) { return set(SERIALIZER_quoteChar, value); } /** - * Sets the {@link Serializer#SERIALIZER_sortCollections} property on all serializers in this group. + * Sets the {@link Serializer#SERIALIZER_listener} property on all serializers in this group. * - * @param value The new value for this property. + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_listener} + *
+ * + * @param sl The new serializer listener. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_sortCollections */ - public RestClientBuilder sortCollections(boolean value) { - return set(SERIALIZER_sortCollections, value); + public RestClientBuilder serializerListener(Class sl) { + return set(SERIALIZER_listener, sl); } /** - * Sets the {@link Serializer#SERIALIZER_sortMaps} property on all serializers in this group. + * Sets the {@link Serializer#SERIALIZER_sortCollections} property on all serializers in this group. * + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_sortCollections} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_sortMaps */ - public RestClientBuilder sortMaps(boolean value) { - return set(SERIALIZER_sortMaps, value); + public RestClientBuilder sortCollections(boolean value) { + return set(SERIALIZER_sortCollections, value); } /** - * Sets the {@link Parser#PARSER_strict} property on all parsers in this group. + * Sets the {@link Serializer#SERIALIZER_sortMaps} property on all serializers in this group. * + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_sortMaps} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Parser#PARSER_strict */ - public RestClientBuilder strict(boolean value) { - return set(PARSER_strict, value); + public RestClientBuilder sortMaps(boolean value) { + return set(SERIALIZER_sortMaps, value); } /** * Sets the {@link Serializer#SERIALIZER_trimEmptyCollections} property on all serializers in this group. * + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_trimEmptyCollections} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_trimEmptyCollections */ public RestClientBuilder trimEmptyCollections(boolean value) { return set(SERIALIZER_trimEmptyCollections, value); @@ -1088,9 +1114,13 @@ public class RestClientBuilder extends BeanContextBuilder { /** * Sets the {@link Serializer#SERIALIZER_trimEmptyMaps} property on all serializers in this group. * + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_trimEmptyMaps} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_trimEmptyMaps */ public RestClientBuilder trimEmptyMaps(boolean value) { return set(SERIALIZER_trimEmptyMaps, value); @@ -1099,9 +1129,13 @@ public class RestClientBuilder extends BeanContextBuilder { /** * Sets the {@link Serializer#SERIALIZER_trimNullProperties} property on all serializers in this group. * + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_trimNullProperties} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_trimNullProperties */ public RestClientBuilder trimNullProperties(boolean value) { return set(SERIALIZER_trimNullProperties, value); @@ -1110,31 +1144,28 @@ public class RestClientBuilder extends BeanContextBuilder { /** * Sets the {@link Serializer#SERIALIZER_trimStrings} property on all serializers in this group. * + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_trimStrings} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_trimStrings */ public RestClientBuilder trimStrings(boolean value) { return set(SERIALIZER_trimStrings, value); } /** - * Sets the {@link Parser#PARSER_trimStrings} property on all parsers in this group. - * - * @param value The new value for this property. - * @return This object (for method chaining). - * @see Parser#PARSER_trimStrings - */ - public RestClientBuilder trimStringsP(boolean value) { - return set(PARSER_trimStrings, value); - } - - /** * Sets the {@link Serializer#SERIALIZER_uriContext} property on all serializers in this group. * + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_uriContext} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_uriContext */ public RestClientBuilder uriContext(UriContext value) { return set(SERIALIZER_uriContext, value); @@ -1143,9 +1174,13 @@ public class RestClientBuilder extends BeanContextBuilder { /** * Sets the {@link Serializer#SERIALIZER_uriRelativity} property on all serializers in this group. * + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_uriRelativity} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_uriRelativity */ public RestClientBuilder uriRelativity(UriRelativity value) { return set(SERIALIZER_uriRelativity, value); @@ -1154,9 +1189,13 @@ public class RestClientBuilder extends BeanContextBuilder { /** * Sets the {@link Serializer#SERIALIZER_uriResolution} property on all serializers in this group. * + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_uriResolution} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_uriResolution */ public RestClientBuilder uriResolution(UriResolution value) { return set(SERIALIZER_uriResolution, value); @@ -1165,13 +1204,142 @@ public class RestClientBuilder extends BeanContextBuilder { /** * Sets the {@link Serializer#SERIALIZER_useWhitespace} property on all serializers in this group. * + *
See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_useWhitespace} + *
+ * * @param value The new value for this property. * @return This object (for method chaining). - * @see Serializer#SERIALIZER_useWhitespace */ public RestClientBuilder useWhitespace(boolean value) { return set(SERIALIZER_useWhitespace, value); } + + /** + * Sets the {@link Parser#PARSER_fileCharset} property on all parsers in this group. + * + *
See Also:
+ *
    + *
  • {@link Parser#PARSER_fileCharset} + *
+ * + * @param value The new value for this property. + * @return This object (for method chaining). + */ + public RestClientBuilder fileCharset(String value) { + return set(PARSER_fileCharset, value); + } + + /** + * Sets the {@link Parser#PARSER_inputStreamCharset} property on all parsers in this group. + * + *
See Also:
+ *
    + *
  • {@link Parser#PARSER_inputStreamCharset} + *
+ * + * @param value The new value for this property. + * @return This object (for method chaining). + */ + public RestClientBuilder inputStreamCharset(String value) { + return set(PARSER_inputStreamCharset, value); + } + + /** + * Sets the {@link Parser#PARSER_listener} property on all parsers in this group. + * + *
See Also:
+ *
    + *
  • {@link Parser#PARSER_listener} + *
+ * + * @param pl The new parser listener. + * @return This object (for method chaining). + */ + public RestClientBuilder parserListener(Class pl) { + return set(PARSER_listener, pl); + } + + /** + * Sets the {@link Parser#PARSER_strict} property on all parsers in this group. + * + *
See Also:
+ *
    + *
  • {@link Parser#PARSER_strict} + *
+ * + * @param value The new value for this property. + * @return This object (for method chaining). + */ + public RestClientBuilder strict(boolean value) { + return set(PARSER_strict, value); + } + + /** + * Sets the {@link Parser#PARSER_trimStrings} property on all parsers in this group. + * + *
See Also:
+ *
    + *
  • {@link Parser#PARSER_trimStrings} + *
+ * + * @param value The new value for this property. + * @return This object (for method chaining). + */ + public RestClientBuilder trimStringsP(boolean value) { + return set(PARSER_trimStrings, value); + } + + /** + * Sets the {@link UonSerializer#UON_paramFormat} property on the URL-encoding serializers in this group. + * + *

+ * This overrides the behavior of the URL-encoding serializer to quote and escape characters in query names and + * values that may be confused for UON notation (e.g. "'(foo=123)'", "'@(1,2,3)'"). + * + *

See Also:
+ *
    + *
  • {@link UonSerializer#UON_paramFormat} + *
+ * + * @param value The new value for this property. + * @return This object (for method chaining). + */ + public RestClientBuilder paramFormat(String value) { + return set(UON_paramFormat, value); + } + + /** + * Shortcut for calling paramFormat("PLAINTEXT"). + * + *

+ * The default behavior is to serialize part values (query parameters, form data, headers, path variables) in UON + * notation. + * Calling this method forces plain-text to be used instead. + * + *

+ * Specifically, UON notation has the following effects: + *

    + *
  • Boolean strings ("true"/"false") and numeric values ("123") will be + * quoted ("'true'", "'false'", "'123'". + *
    This allows them to be differentiated from actual boolean and numeric values. + *
  • String such as "(foo='bar')" that mimic UON structures will be quoted and escaped to + * "'(foo=bar~'baz~')'". + *
+ *

+ * The down-side to using plain text part serialization is that you cannot serialize arbitrary POJOs. + * + *

See Also:
+ *
    + *
  • {@link UonSerializer#UON_paramFormat} + *
+ * + * @return This object (for method chaining). + */ + public RestClientBuilder plainTextParts() { + return set(UON_paramFormat, "PLAINTEXT"); + } @Override /* BeanContextBuilder */ public RestClientBuilder beanClassVisibility(Visibility value) { http://git-wip-us.apache.org/repos/asf/juneau/blob/7780e6fe/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java ---------------------------------------------------------------------- diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java index 3c07472..df26ff8 100644 --- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java +++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java @@ -513,9 +513,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *
* For example: "?body=(name='John%20Smith',age=45)" * - *

- * See {@link RestContext#REST_allowBodyParam} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_allowBodyParam} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -532,9 +534,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *
* For example: "?method=OPTIONS" * - *

- * See {@link RestContext#REST_allowedMethodParams} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_allowedMethodParams} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -550,9 +554,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * parameters. *
For example: "?Accept=text/json&Content-Type=text/json" * - *

- * See {@link RestContext#REST_allowHeaderParams} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_allowHeaderParams} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -567,9 +573,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * This class handles the basic lifecycle of an HTTP REST call. *
Subclasses can be used to customize how these HTTP calls are handled. * - *

- * See {@link RestContext#REST_callHandler} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_callHandler} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -583,6 +591,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #callHandler(Class)} except input is a pre-constructed instance. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_callHandler} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -600,8 +613,10 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * A REST child resource is simply another servlet that is initialized as part of the parent resource and has a * servlet path directly under the parent servlet path. * - *

- * See {@link RestContext#REST_children} for more information. + *

See Also:
+ *
    + *
  • {@link RestContext#REST_children} + *
* * @param values The values to add to this setting. * @return This object (for method chaining). @@ -616,6 +631,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #children(Class...)} except input is pre-constructed instances. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_children} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -632,8 +652,10 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* This can be used for resources that don't have a {@link RestResource#path()} annotation. * - *

- * See {@link RestContext#REST_children} for more information. + *

See Also:
+ *
    + *
  • {@link RestContext#REST_children} + *
* * @param path The child path relative to the parent resource URI. * @param child The child to add to this resource. @@ -649,8 +671,10 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Used to retrieve localized files from the classpath. * - *

- * See {@link RestContext#REST_classpathResourceFinder} for more information. + *

See Also:
+ *
    + *
  • {@link RestContext#REST_classpathResourceFinder} + *
* * @param value The new value for this setting. * @return This object (for method chaining). @@ -665,6 +689,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #classpathResourceFinder(ClasspathResourceFinder)} except input is a pre-constructed instance. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_classpathResourceFinder} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -682,9 +711,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * The client version is used to support backwards compatibility for breaking REST interface changes. *
Used in conjunction with {@link RestMethod#clientVersion()} annotation. * - *

- * See {@link RestContext#REST_clientVersionHeader} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_clientVersionHeader} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -704,9 +735,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * The net effect is that the {@link RestRequest#getContextPath()} and {@link RestRequest#getServletPath()} methods * will return this value instead of the actual context path of the web app. * - *

- * See {@link RestContext#REST_contextPath} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_contextPath} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -724,9 +757,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * These converters get called immediately after execution of the REST method in the same order specified in the * annotation. * - *

- * See {@link RestContext#REST_converters} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_converters} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -740,6 +775,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #converters(Class...)} except input is pre-constructed instances. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_converters} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -753,9 +793,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* The default character encoding for the request and response if not specified on the request. * - *

- * See {@link RestContext#REST_defaultCharset} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_defaultCharset} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -769,9 +811,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Adds class-level default HTTP request headers to this resource. * - *

- * See {@link RestContext#REST_defaultRequestHeaders} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_defaultRequestHeaders} + *
+ * * @param headers The headers in the format "Header-Name: header-value". * @return This object (for method chaining). * @throws RestServletException If malformed header is found. @@ -792,6 +836,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #defaultRequestHeaders(String...)} but adds a single header name/value pair. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_defaultRequestHeaders} + *
+ * * @param name The HTTP header name. * @param value The HTTP header value. * @return This object (for method chaining). @@ -806,9 +855,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Specifies default values for response headers. * - *

- * See {@link RestContext#REST_defaultResponseHeaders} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_defaultResponseHeaders} + *
+ * * @param headers The headers in the format "Header-Name: header-value". * @return This object (for method chaining). * @throws RestServletException If malformed header is found. @@ -829,6 +880,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #defaultResponseHeaders(String...)} but adds a single header name/value pair. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_defaultResponseHeaders} + *
+ * * @param name The HTTP header name. * @param value The HTTP header value. * @return This object (for method chaining). @@ -843,9 +899,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* These can be used to enable various kinds of compression (e.g. "gzip") on requests and responses. * - *

- * See {@link RestContext#REST_encoders} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_encoders} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -859,6 +917,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #encoders(Class...)} except input a pre-constructed instances. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_encoders} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -877,9 +940,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * Typically, guards will be used for permissions checking on the user making the request, but it can also be used * for other purposes like pre-call validation of a request. * - *

- * See {@link RestContext#REST_guards} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_guards} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -893,6 +958,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #guards(Class...)} except input is pre-constructed instances. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_guards} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -906,9 +976,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Class used to retrieve title/description/swagger information about a resource. * - *

- * See {@link RestContext#REST_infoProvider} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_infoProvider} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -922,6 +994,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #infoProvider(Class)} except input is a pre-constructed instance. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_infoProvider} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -935,9 +1012,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Specifies the logger to use for logging. * - *

- * See {@link RestContext#REST_logger} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_logger} + *
+ * * @param value The new value for this setting. Can be null to disable logging. * @return This object (for method chaining). */ @@ -951,6 +1030,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #logger(Class)} except input is a pre-constructed instance. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_logger} + *
+ * * @param value The new value for this setting. Can be null to disable logging. * @return This object (for method chaining). */ @@ -965,9 +1049,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * Useful for alleviating DoS attacks by throwing an exception when too much input is received instead of resulting * in out-of-memory errors which could affect system stability. * - *

- * See {@link RestContext#REST_maxInput} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_maxInput} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -981,9 +1067,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Identifies the location of the resource bundle for this class. * - *

- * See {@link RestContext#REST_messages} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_messages} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -998,6 +1086,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * Same as {@link #messages(MessageBundleLocation...)} except allows you to pass in the base class and bundle * path separately. * + *
See Also:
+ *
    + *
  • {@link RestContext#REST_messages} + *
+ * * @param baseClass * The base class that the bundle path is relative to. *
If null, assumed to be the resource class itself. @@ -1014,6 +1107,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #messages(Class,String)} except assumes the base class is the resource class itself. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_messages} + *
+ * * @param bundlePath The bundle path relative to the base class. * @return This object (for method chaining). */ @@ -1027,9 +1125,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Defines MIME-type file type mappings. * - *

- * See {@link RestContext#REST_mimeTypes} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_mimeTypes} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -1045,9 +1145,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * RestRequest, Accept, Reader). * This annotation allows you to provide your own resolvers for your own class types that you want resolved. * - *

- * See {@link RestContext#REST_paramResolvers} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_paramResolvers} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -1062,6 +1164,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #paramResolvers(Class...)} except input is pre-constructed instances. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_paramResolvers} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -1075,9 +1182,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Specifies the parser listener class to use for listening to non-fatal parsing errors. * - *

- * See {@link Parser#PARSER_listener} for more information. - * + *

See Also:
+ *
    + *
  • {@link Parser#PARSER_listener} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -1091,9 +1200,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Adds class-level parsers to this resource. * - *

- * See {@link RestContext#REST_parsers} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_parsers} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -1107,6 +1218,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #parsers(Class...)} except allows you to overwrite the previous value. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_parsers} + *
+ * * @param append * If true, append to the existing list, otherwise overwrite the previous value. * @param values The values to add to this setting. @@ -1126,6 +1242,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * Parser instances are considered set-in-stone and do NOT inherit properties and transforms defined on the * resource class or method. * + *
See Also:
+ *
    + *
  • {@link RestContext#REST_parsers} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -1139,9 +1260,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Specifies the {@link HttpPartParser} to use for parsing headers, query/form parameters, and URI parts. * - *

- * See {@link RestContext#REST_partParser} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_partParser} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -1155,6 +1278,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #partParser(Class)} except input is a pre-constructed instance. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_partParser} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -1168,9 +1296,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Specifies the {@link HttpPartSerializer} to use for serializing headers, query/form parameters, and URI parts. * - *

- * See {@link RestContext#REST_partSerializer} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_partSerializer} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -1184,6 +1314,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #partSerializer(Class)} except input is a pre-constructed instance. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_partSerializer} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -1197,9 +1332,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Identifies the URL subpath relative to the parent resource. * - *

- * See {@link RestContext#REST_path} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_path} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -1216,9 +1353,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Render stack traces in HTTP response bodies when errors occur. * - *

- * See {@link RestContext#REST_renderResponseStackTraces} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_renderResponseStackTraces} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -1235,9 +1374,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Can be used to provide customized resolution of REST resource class instances (e.g. resources retrieve from Spring). * - *

- * See {@link RestContext#REST_resourceResolver} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_resourceResolver} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -1251,6 +1392,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #resourceResolver(Class)} except input is a pre-constructed instance. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_resourceResolver} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -1265,9 +1411,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * Specifies a list of {@link ResponseHandler} classes that know how to convert POJOs returned by REST methods or * set via {@link RestResponse#setOutput(Object)} into appropriate HTTP responses. * - *

- * See {@link RestContext#REST_responseHandlers} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_responseHandlers} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -1281,6 +1429,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #responseHandlers(Class...)} except input is pre-constructed instances. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_responseHandlers} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -1294,9 +1447,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Specifies the serializer listener class to use for listening to non-fatal serialization errors. * - *

- * See {@link Serializer#SERIALIZER_listener} for more information. - * + *

See Also:
+ *
    + *
  • {@link Serializer#SERIALIZER_listener} + *
+ * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -1310,9 +1465,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Adds class-level serializers to this resource. * - *

- * See {@link RestContext#REST_serializers} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_serializers} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -1326,6 +1483,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #serializers(Class...)} except allows you to overwrite the previous value. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_serializers} + *
+ * * @param append * If true, append to the existing list, otherwise overwrite the previous value. * @param values The values to add to this setting. @@ -1345,6 +1507,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * Serializer instances are considered set-in-stone and do NOT inherit properties and transforms defined on the * resource class or method. * + *
See Also:
+ *
    + *
  • {@link RestContext#REST_serializers} + *
+ * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -1358,8 +1525,10 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Used to customize the headers on responses returned for statically-served files. * - *

- * See {@link RestContext#REST_staticFileResponseHeaders} for more information. + *

See Also:
+ *
    + *
  • {@link RestContext#REST_staticFileResponseHeaders} + *
* * @param append * If true, append to the existing list, otherwise overwrite the previous value. @@ -1377,6 +1546,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * Same as {@link #staticFileResponseHeaders(boolean, Map)} with append=true except headers are strings * composed of key/value pairs. * + *
See Also:
+ *
    + *
  • {@link RestContext#REST_staticFileResponseHeaders} + *
+ * * @param headers The headers in the format "Header-Name: header-value". * @return This object (for method chaining). * @throws RestServletException If malformed header is found. @@ -1397,6 +1571,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Same as {@link #staticFileResponseHeaders(String...)} except header is broken into name/value pair. * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_staticFileResponseHeaders} + *
+ * * @param name The HTTP header name. * @param value The HTTP header value. * @return This object (for method chaining). @@ -1411,9 +1590,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

* Used to define paths and locations of statically-served files such as images or HTML documents. * - *

- * See {@link RestContext#REST_staticFiles} for more information. - * + *

See Also:
+ *
    + *
  • {@link RestContext#REST_staticFiles} + *
+ * * @param values The values to append to this setting. * @return This object (for method chaining). */ @@ -1434,6 +1615,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *
  • "path:location:headers-json" (e.g. "foodocs:docs/foo:{'Cache-Control':'max-age=86400, public'}") * * + *
    See Also:
    + *
      + *
    • {@link RestContext#REST_staticFiles} + *
    + * * @param mappingString The static file mapping string. * @return This object (for method chaining). */ @@ -1454,6 +1640,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *
  • "path:location:headers-json" (e.g. "foodocs:docs/foo:{'Cache-Control':'max-age=86400, public'}") * * + *
    See Also:
    + *
      + *
    • {@link RestContext#REST_staticFiles} + *
    + * * @param baseClass * Overrides the default class to use for retrieving the classpath resource. *
    If null, uses the REST resource class. @@ -1470,6 +1661,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

    * Same as {@link #staticFiles(String)} except path and location are already split values. * + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_staticFiles} + *
    + * * @param path * The mapped URI path. *
    Leading and trailing slashes are trimmed. @@ -1488,6 +1684,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

    * Same as {@link #staticFiles(String,String)} except overrides the base class for retrieving the resource. * + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_staticFiles} + *
    + * * @param baseClass * Overrides the default class to use for retrieving the classpath resource. *
    If null, uses the REST resource class. @@ -1509,9 +1710,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

    * Overrides the media types inferred from the serializers that identify what media types can be produced by the resource. * - *

    - * See {@link RestContext#REST_supportedAcceptTypes} for more information. - * + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_supportedAcceptTypes} + *
    + * * @param append * If true, append to the existing list, otherwise overwrite the previous value. * @param values The values to add to this setting. @@ -1527,6 +1730,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

    * Same as {@link #supportedAcceptTypes(boolean, String...)} except input is {@link MediaType} instances. * + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_supportedAcceptTypes} + *
    + * * @param append * If true, append to the existing list, otherwise overwrite the previous value. * @param values The values to add to this setting. @@ -1542,9 +1750,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

    * Overrides the media types inferred from the parsers that identify what media types can be consumed by the resource. * - *

    - * See {@link RestContext#REST_supportedContentTypes} for more information. - * + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_supportedContentTypes} + *
    + * * @param append * If true, append to the existing list, otherwise overwrite the previous value. * @param values The values to add to this setting. @@ -1560,6 +1770,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

    * Same as {@link #supportedContentTypes(boolean, String...)} except input is {@link MediaType} instances. * + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_supportedContentTypes} + *
    + * * @param append * If true, append to the existing list, otherwise overwrite the previous value. * @param values The values to add to this setting. @@ -1576,8 +1791,10 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * When enabled, resources retrieved via {@link RestContext#getClasspathResource(String, Locale)} (and related * methods) will be cached in memory to speed subsequent lookups. * - *

    - * See {@link RestContext#REST_useClasspathResourceCaching} for more information. + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_useClasspathResourceCaching} + *
    * * @param value The new value for this setting. * @return This object (for method chaining). @@ -1593,9 +1810,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * When enabled, the number of times an exception has occurred will be determined based on stack trace hashsums, * made available through the {@link RestException#getOccurrence()} method. * - *

    - * See {@link RestContext#REST_useStackTraceHashes} for more information. - * + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_useStackTraceHashes} + *
    + * * @param value The new value for this setting. * @return This object (for method chaining). */ @@ -1610,9 +1829,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon * Defines widgets that can be used in conjunction with string variables of the form "$W{name}"to quickly * generate arbitrary replacement text. * - *

    - * See {@link RestContext#REST_widgets} for more information. - * + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_widgets} + *
    + * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -1627,6 +1848,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

    * Same as {@link #widgets(Class...)} except input is pre-constructed instances. * + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_widgets} + *
    + * * @param values The values to add to this setting. * @return This object (for method chaining). */ @@ -1640,6 +1866,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon *

    * Same as {@link #widgets(Widget...)} except allows you to overwrite the previous value. * + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_widgets} + *
    + * * @param append * If true, appends to the existing list of widgets. *
    Otherwise, replaces the previous list. http://git-wip-us.apache.org/repos/asf/juneau/blob/7780e6fe/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java ---------------------------------------------------------------------- diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java index 765ef25..9e6c602 100644 --- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java +++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java @@ -41,8 +41,10 @@ public @interface RestMethod { /** * Appends the specified bean filters to all serializers and parsers used by this method. * - *

    - * See {@link BeanContext#BEAN_beanFilters} for more information. + *

    See Also:
    + *
      + *
    • {@link BeanContext#BEAN_beanFilters} + *
    */ Class[] beanFilters() default {}; @@ -90,6 +92,11 @@ public @interface RestMethod { * bpi={"Bean1: foo","Bean2: bar,baz"} * bpi="Bean1: foo; Bean2: bar,baz" *

    + * + *
    See Also:
    + *
      + *
    • {@link BeanContext#BEAN_includeProperties} + *
    */ String[] bpi() default {}; @@ -136,6 +143,11 @@ public @interface RestMethod { * bpx={"Bean1: foo","Bean2: bar,baz"} * bpx="Bean1: foo; Bean2: bar,baz" *

    + * + *
    See Also:
    + *
      + *
    • {@link BeanContext#BEAN_excludeProperties} + *
    */ String[] bpx() default {}; @@ -211,8 +223,10 @@ public @interface RestMethod { *

    * Associates one or more {@link RestConverter converters} with this method. * - *

    - * See {@link RestContext#REST_converters} for more information. + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_converters} + *
    */ Class[] converters() default {}; @@ -232,8 +246,10 @@ public @interface RestMethod { * {@link SystemPropertiesVar $S} * {@link SwitchVar $SW} * - *

    - * See {@link RestContext#REST_defaultCharset} for more information. + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_defaultCharset} + *
    */ String defaultCharset() default ""; @@ -329,8 +345,12 @@ public @interface RestMethod { * {@link SystemPropertiesVar $S} * {@link SwitchVar $SW} * - *

    - * See {@link RestContext#REST_defaultRequestHeaders} for more information. + * @see RestContext#REST_defaultRequestHeaders + * + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_defaultRequestHeaders} + *
    */ String[] defaultRequestHeaders() default {}; @@ -394,8 +414,10 @@ public @interface RestMethod { *

    * Use inherit={"ENCODERS"} to inherit encoders from the resource class. * - *

    - * See {@link RestContext#REST_encoders} for more information. + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_encoders} + *
    */ Class[] encoders() default {}; @@ -413,8 +435,10 @@ public @interface RestMethod { *

    * Associates one or more {@link RestGuard RestGuards} with this method. * - *

    - * See {@link RestContext#REST_guards} for more information. + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_guards} + *
    */ Class[] guards() default {}; @@ -491,8 +515,10 @@ public @interface RestMethod { * {@link SystemPropertiesVar $S} * {@link SwitchVar $SW} * - *

    - * See {@link RestContext#REST_maxInput} for more information. + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_maxInput} + *
    */ String maxInput() default ""; @@ -570,8 +596,10 @@ public @interface RestMethod { * } *

    * - *

    - * See {@link RestContext#REST_parsers} for more information. + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_parsers} + *
    */ Class[] parsers() default {}; @@ -600,9 +628,11 @@ public @interface RestMethod { /** * Appends the specified POJO swaps to all serializers and parsers used by this method. - * - *

    - * See {@link BeanContext#BEAN_pojoSwaps} for more information. + * + *

    See Also:
    + *
      + *
    • {@link BeanContext#BEAN_pojoSwaps} + *
    */ Class[] pojoSwaps() default {}; @@ -655,8 +685,10 @@ public @interface RestMethod { * } *

    * - *

    - * See {@link RestContext#REST_serializers} for more information. + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_serializers} + *
    */ Class[] serializers() default {}; @@ -722,8 +754,10 @@ public @interface RestMethod { * {@link SystemPropertiesVar $S} * {@link SwitchVar $SW} * - *

    - * See {@link RestContext#REST_supportedAcceptTypes} for more information. + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_supportedAcceptTypes} + *
    */ String[] supportedAcceptTypes() default {}; @@ -743,8 +777,10 @@ public @interface RestMethod { * {@link SystemPropertiesVar $S} * {@link SwitchVar $SW} * - *

    - * See {@link RestContext#REST_supportedContentTypes} for more information. + *

    See Also:
    + *
      + *
    • {@link RestContext#REST_supportedContentTypes} + *
    */ String[] supportedContentTypes() default {};