http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java index c04c22d..99b3335 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java @@ -64,7 +64,8 @@ public final class RestContext extends Context { * <li><b>Default:</b> <jk>true</jk> * </ul> * <p> - * When enabled, headers such as <js>"Accept"</js> and <js>"Content-Type"</js> to be passed in as URL query parameters. + * When enabled, headers such as <js>"Accept"</js> and <js>"Content-Type"</js> to be passed in as URL query + * parameters. * For example: <js>"?Accept=text/json&Content-Type=text/json"</js> * <p> * Parameter names are case-insensitive. @@ -84,7 +85,8 @@ public final class RestContext extends Context { * <li><b>Default:</b> <js>""</js> * </ul> * <p> - * When specified, the HTTP method can be overridden by passing in a <js>"method"</js> URL parameter on a regular GET request. + * When specified, the HTTP method can be overridden by passing in a <js>"method"</js> URL parameter on a regular + * GET request. * For example: <js>"?method=OPTIONS"</js> * <p> * Format is a comma-delimited list of HTTP method names that can be passed in as a method parameter. @@ -92,8 +94,9 @@ public final class RestContext extends Context { * Use "*" to represent all methods. * For backwards compatibility, "true" also means "*". * <p> - * Note that per the <a class="doclink" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html">HTTP specification</a>, special care should - * be taken when allowing non-safe (POST, PUT, DELETE) methods to be invoked through GET requests. + * Note that per the <a class="doclink" + * href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html">HTTP specification</a>, special care should + * be taken when allowing non-safe (POST, PUT, DELETE) methods to be invoked through GET requests. * <p> * Applicable to servlet class only. * <p> @@ -110,7 +113,8 @@ public final class RestContext extends Context { * <li><b>Default:</b> <jk>true</jk> * </ul> * <p> - * When enabled, the HTTP body content on PUT and POST requests can be passed in as text using the <js>"body"</js> URL parameter. + * When enabled, the HTTP body content on PUT and POST requests can be passed in as text using the <js>"body"</js> + * URL parameter. * For example: <js>"?body={name:'John%20Smith',age:45}"</js> * <p> * Parameter name is case-insensitive. @@ -149,7 +153,7 @@ public final class RestContext extends Context { * </ul> * <p> * 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. + * made available through the {@link RestException#getOccurrence()} method. * <p> * Applicable to servlet class only. */ @@ -181,18 +185,21 @@ public final class RestContext extends Context { * <p> * Possible values: * <ul class='spaced-list'> - * <li><js>"UON"</js> - URL-Encoded Object Notation.<br> - * This notation allows for request parameters to contain arbitrarily complex POJOs. - * <li><js>"PLAIN"</js> - Plain text.<br> - * This treats request parameters as plain text.<br> - * Only POJOs directly convertable from <l>Strings</l> can be represented in parameters when using this mode. + * <li> + * <js>"UON"</js> - URL-Encoded Object Notation. + * <br>This notation allows for request parameters to contain arbitrarily complex POJOs. + * <li> + * <js>"PLAIN"</js> - Plain text. + * <br>This treats request parameters as plain text. + * <br>Only POJOs directly convertible from <l>Strings</l> can be represented in parameters when using this + * mode. * </ul> * <p> * Note that the parameter value <js>"(foo)"</js> is interpreted as <js>"(foo)"</js> when using plain mode, but - * <js>"foo"</js> when using UON mode. + * <js>"foo"</js> when using UON mode. * <p> - * The format can also be specified per-parameter using the {@link FormData#format() @FormData.format()} and {@link Query#format() @Query.format()} - * annotations. + * The format can also be specified per-parameter using the {@link FormData#format() @FormData.format()} and + * {@link Query#format() @Query.format()} annotations. * <p> * Applicable to servlet class and methods. */ @@ -206,7 +213,8 @@ public final class RestContext extends Context { /** * The request servlet path. * <p> - * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and {@link ParserSession#getProperty(String)}. + * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and + * {@link ParserSession#getProperty(String)}. * <p> * Equivalent to the value returned by {@link RestRequest#getServletPath()} */ @@ -222,7 +230,8 @@ public final class RestContext extends Context { /** * The request URI path info. * <p> - * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and {@link ParserSession#getProperty(String)}. + * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and + * {@link ParserSession#getProperty(String)}. * <p> * Equivalent to the value returned by {@link RestRequest#getPathInfo()} */ @@ -231,7 +240,8 @@ public final class RestContext extends Context { /** * The request URI. * <p> - * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and {@link ParserSession#getProperty(String)}. + * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and + * {@link ParserSession#getProperty(String)}. * <p> * Equivalent to the value returned by {@link RestRequest#getRequestURI()} */ @@ -240,7 +250,8 @@ public final class RestContext extends Context { /** * The request method. * <p> - * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and {@link ParserSession#getProperty(String)}. + * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and + * {@link ParserSession#getProperty(String)}. * <p> * Equivalent to the value returned by {@link RestRequest#getMethod()} */ @@ -249,7 +260,8 @@ public final class RestContext extends Context { /** * The localized servlet title. * <p> - * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and {@link ParserSession#getProperty(String)}. + * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and + * {@link ParserSession#getProperty(String)}. * <p> * Equivalent to the value returned by {@link RestRequest#getServletTitle()} */ @@ -258,7 +270,8 @@ public final class RestContext extends Context { /** * The localized servlet description. * <p> - * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and {@link ParserSession#getProperty(String)}. + * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and + * {@link ParserSession#getProperty(String)}. * <p> * Equivalent to the value returned by {@link RestRequest#getServletDescription()} */ @@ -267,7 +280,8 @@ public final class RestContext extends Context { /** * The localized method summary. * <p> - * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and {@link ParserSession#getProperty(String)}. + * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and + * {@link ParserSession#getProperty(String)}. * <p> * Equivalent to the value returned by {@link RestRequest#getMethodSummary()} */ @@ -276,7 +290,8 @@ public final class RestContext extends Context { /** * The localized method description. * <p> - * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and {@link ParserSession#getProperty(String)}. + * Automatically added to properties returned by {@link SerializerSession#getProperty(String)} and + * {@link ParserSession#getProperty(String)}. * <p> * Equivalent to the value returned by {@link RestRequest#getMethodDescription()} */ @@ -766,7 +781,7 @@ public final class RestContext extends Context { * Returns the variable resolver for this servlet. * <p> * Variable resolvers are used to replace variables in property values. - * </p> + * * <h6 class='figure'>Example:</h6> * <p class='bcode'> * <ja>@RestResource</ja>( @@ -866,15 +881,14 @@ public final class RestContext extends Context { } /** - * Same as {@link Class#getResourceAsStream(String)} except if it doesn't find the resource - * on this class, searches up the parent hierarchy chain. + * Same as {@link Class#getResourceAsStream(String)} except if it doesn't find the resource on this class, searches + * up the parent hierarchy chain. * <p> - * If the resource cannot be found in the classpath, then an attempt is made to look in the - * JVM working directory. + * If the resource cannot be found in the classpath, then an attempt is made to look in the JVM working directory. * <p> * If the <code>locale</code> is specified, then we look for resources whose name matches that locale. - * For example, if looking for the resource <js>"MyResource.txt"</js> for the Japanese locale, we will - * look for files in the following order: + * For example, if looking for the resource <js>"MyResource.txt"</js> for the Japanese locale, we will look for + * files in the following order: * <ol> * <li><js>"MyResource_ja_JP.txt"</js> * <li><js>"MyResource_ja.txt"</js> @@ -931,8 +945,8 @@ public final class RestContext extends Context { } /** - * Reads the input stream from {@link #getResource(String, Locale)} and parses it into a POJO - * using the parser matched by the specified media type. + * Reads the input stream from {@link #getResource(String, Locale)} and parses it into a POJO using the parser + * matched by the specified media type. * <p> * Useful if you want to load predefined POJOs from JSON files in your classpath. * @@ -966,8 +980,8 @@ public final class RestContext extends Context { } /** - * Returns the path for this resource as defined by the {@link RestResource#path()} annotation or {@link RestConfig#setPath(String)} method - * concatenated with those on all parent classes. + * Returns the path for this resource as defined by the {@link RestResource#path()} annotation or + * {@link RestConfig#setPath(String)} method concatenated with those on all parent classes. * <p> * If path is not specified, returns <js>"/"</js>. * <p> @@ -1114,7 +1128,8 @@ public final class RestContext extends Context { /** * The HTML page no-results message. * <p> - * Defined by the {@link HtmlDoc#noResultsMessage()} annotation or {@link RestConfig#setHtmlNoResultsMessage(String)} method. + * Defined by the {@link HtmlDoc#noResultsMessage()} annotation or {@link RestConfig#setHtmlNoResultsMessage(String)} + * method. * * @return The HTML page no-results message. */ @@ -1195,7 +1210,7 @@ public final class RestContext extends Context { /** * Returns a map of HTTP method names to call routers. * - * @return A map with HTTP method names uppercased as the keys, and call routers as the values. + * @return A map with HTTP method names upper-cased as the keys, and call routers as the values. */ protected Map<String,CallRouter> getCallRouters() { return callRouters; @@ -1236,7 +1251,8 @@ public final class RestContext extends Context { /** * Returns the parent resource context (if this resource was initialized from a parent). * <p> - * From this object, you can get access to the parent resource class itself using {@link #getResource()} or {@link #getRestServlet()} + * From this object, you can get access to the parent resource class itself using {@link #getResource()} or + * {@link #getRestServlet()} * * @return The parent resource context, or <jk>null</jk> if there is no parent context. */ @@ -1261,7 +1277,7 @@ public final class RestContext extends Context { * <li>{@link RestResource#properties() @RestResource.properties()} annotation. * <li>{@link RestConfig#setProperty(String, Object)}/{@link RestConfig#setProperties(Map)} methods. * </ul> - * <p> + * * <h5 class='section'>Notes:</h5> * <ul> * <li>The returned {@code Map} is mutable. Therefore, subclasses are free to override @@ -1341,6 +1357,7 @@ public final class RestContext extends Context { /** * Returns the value of the {@link #REST_renderResponseStackTraces} setting. + * * @return The value of the {@link #REST_renderResponseStackTraces} setting. */ protected boolean isRenderResponseStackTraces() { @@ -1349,6 +1366,7 @@ public final class RestContext extends Context { /** * Returns the value of the {@link #REST_allowHeaderParams} setting. + * * @return The value of the {@link #REST_allowHeaderParams} setting. */ protected boolean isAllowHeaderParams() { @@ -1357,6 +1375,7 @@ public final class RestContext extends Context { /** * Returns the value of the {@link #REST_allowBodyParam} setting. + * * @return The value of the {@link #REST_allowBodyParam} setting. */ protected boolean isAllowBodyParam() { @@ -1365,6 +1384,7 @@ public final class RestContext extends Context { /** * Returns the value of the {@link #REST_defaultCharset} setting. + * * @return The value of the {@link #REST_defaultCharset} setting. */ protected String getDefaultCharset() { @@ -1373,6 +1393,7 @@ public final class RestContext extends Context { /** * Returns the value of the {@link #REST_paramFormat} setting. + * * @return The value of the {@link #REST_paramFormat} setting. */ protected String getParamFormat() { @@ -1399,7 +1420,7 @@ public final class RestContext extends Context { * Returns <jk>true</jk> if the specified <code>Method</code> GET parameter value can be used to override * the method name in the HTTP header. * - * @param m The method name, uppercased. + * @param m The method name, upper-cased. * @return <jk>true</jk> if this resource allows the specified method to be overridden. */ protected boolean allowMethodParam(String m) { @@ -1519,6 +1540,7 @@ public final class RestContext extends Context { /** * Returns the URL-encoding parser associated with this resource. + * * @return The URL-encoding parser associated with this resource. Never <jk>null</jk>. */ protected UrlEncodingParser getUrlEncodingParser() { @@ -1527,6 +1549,7 @@ public final class RestContext extends Context { /** * Returns the URL-encoding serializer associated with this resource. + * * @return The URL-encoding serializer associated with this resource. Never <jk>null</jk>. */ protected UrlEncodingSerializer getUrlEncodingSerializer() { @@ -1541,7 +1564,8 @@ public final class RestContext extends Context { * Encoders at the class level are defined via one of the following: * <ul> * <li>{@link RestResource#encoders() @RestResource.encoders()} annotation. - * <li>{@link RestConfig#addEncoders(Class...)}/{@link RestConfig#addEncoders(org.apache.juneau.encoders.Encoder...)} methods. + * <li>{@link RestConfig#addEncoders(Class...)}/{@link RestConfig#addEncoders(org.apache.juneau.encoders.Encoder...)} + * methods. * </ul> * * @return The encoders associated with this resource. Never <jk>null</jk>. @@ -1554,7 +1578,8 @@ public final class RestContext extends Context { * Returns the explicit list of supported accept types for this resource. * <p> * By default, this is simply the list of accept types supported by the registered parsers, but - * can be overridden via the {@link RestConfig#setSupportedAcceptTypes(MediaType...)}/{@link RestConfig#setSupportedAcceptTypes(String...)} methods. + * can be overridden via the {@link RestConfig#setSupportedAcceptTypes(MediaType...)}/{@link RestConfig#setSupportedAcceptTypes(String...)} + * methods. * * @return The supported <code>Accept</code> header values for this resource. Never <jk>null</jk>. */ @@ -1565,8 +1590,9 @@ public final class RestContext extends Context { /** * Returns the explicit list of supported content types for this resource. * <p> - * By default, this is simply the list of content types supported by the registered serializers, but - * can be overridden via the {@link RestConfig#setSupportedContentTypes(MediaType...)}/{@link RestConfig#setSupportedContentTypes(String...)} methods. + * By default, this is simply the list of content types supported by the registered serializers, but can be + * overridden via the {@link RestConfig#setSupportedContentTypes(MediaType...)}/{@link RestConfig#setSupportedContentTypes(String...)} + * methods. * * @return The supported <code>Content-Type</code> header values for this resource. Never <jk>null</jk>. */ @@ -1599,7 +1625,8 @@ public final class RestContext extends Context { * Default response headers are defined via one of the following: * <ul> * <li>{@link RestResource#defaultResponseHeaders() @RestResource.defaultResponseHeaders()} annotation. - * <li>{@link RestConfig#addDefaultResponseHeader(String, Object)}/{@link RestConfig#addDefaultResponseHeaders(String...)} methods. + * <li>{@link RestConfig#addDefaultResponseHeader(String, Object)}/{@link RestConfig#addDefaultResponseHeaders(String...)} + * methods. * </ul> * * @return The default response headers for this resource. Never <jk>null</jk>. @@ -1650,7 +1677,8 @@ public final class RestContext extends Context { * Response handlers are defined via one of the following: * <ul> * <li>{@link RestResource#responseHandlers() @RestResource.responseHandlers()} annotation. - * <li>{@link RestConfig#addResponseHandlers(Class...)}/{@link RestConfig#addResponseHandlers(ResponseHandler...)} methods. + * <li>{@link RestConfig#addResponseHandlers(Class...)}/{@link RestConfig#addResponseHandlers(ResponseHandler...)} + * methods. * </ul> * * @return The response handlers associated with this resource. Never <jk>null</jk>. @@ -1748,6 +1776,7 @@ public final class RestContext extends Context { /** * Returns <jk>true</jk> if this resource has any child resources associated with it. + * * @return <jk>true</jk> if this resource has any child resources associated with it. */ protected boolean hasChildResources() {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestConverter.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestConverter.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestConverter.java index 2d668d3..4f85306 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestConverter.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestConverter.java @@ -20,10 +20,11 @@ import org.apache.juneau.serializer.*; /** * REST method response converter. * <p> - * Implements a filter mechanism for REST method calls that allows response objects to be - * converted to some other POJO after invocation of the REST method. + * Implements a filter mechanism for REST method calls that allows response objects to be converted to some other POJO + * after invocation of the REST method. * <p> * Converters are associated with REST methods through the {@link RestMethod#converters()} annotation. + * * <h5 class='section'>Example:</h5> * <p class='bcode'> * <jk>public class</jk> RequestEchoResource <jk>extends</jk> RestServlet { @@ -42,8 +43,8 @@ import org.apache.juneau.serializer.*; * * <h6 class='topic'>How to implement</h6> * <p> - * Implementers should simply implement the {@link #convert(RestRequest, Object, ClassMeta)} and - * return back a 'converted' object. + * Implementers should simply implement the {@link #convert(RestRequest, Object, ClassMeta)} and return back a + * 'converted' object. * It's up to the implementer to decide what this means. * <p> * Converters must implement a no-args constructor. @@ -52,9 +53,12 @@ import org.apache.juneau.serializer.*; * <p> * The following converters are available by default. * <ul class='spaced-list'> - * <li>{@link Traversable} - Allows URL additional path info to address individual elements in a POJO tree. - * <li>{@link Queryable} - Allows query/view/sort functions to be performed on POJOs. - * <li>{@link Introspectable} - Allows Java public methods to be invoked on the returned POJOs. + * <li> + * {@link Traversable} - Allows URL additional path info to address individual elements in a POJO tree. + * <li> + * {@link Queryable} - Allows query/view/sort functions to be performed on POJOs. + * <li> + * {@link Introspectable} - Allows Java public methods to be invoked on the returned POJOs. * </ul> */ public interface RestConverter { http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java index 05fbd33..a8f4f6f 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java @@ -22,9 +22,8 @@ import org.apache.juneau.*; /** * Exception thrown to trigger an error HTTP status. * <p> - * REST methods on subclasses of {@link RestServlet} can throw - * this exception to trigger an HTTP status other than the automatically-generated - * <code>404</code>, <code>405</code>, and <code>500</code> statuses. + * REST methods on subclasses of {@link RestServlet} can throw this exception to trigger an HTTP status other than the + * automatically-generated <code>404</code>, <code>405</code>, and <code>500</code> statuses. */ public class RestException extends FormattedRuntimeException { @@ -76,6 +75,7 @@ public class RestException extends FormattedRuntimeException { * <li>{@link RestException} * <li>{@link InvocationTargetException} * </ul> + * * @return The root cause of this exception, or <jk>null</jk> if no root cause was found. */ public Throwable getRootCause() { http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestGuard.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestGuard.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestGuard.java index 7848bb2..f95b916 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestGuard.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestGuard.java @@ -21,21 +21,22 @@ import org.apache.juneau.rest.annotation.*; * * <h5 class='section'>Description:</h5> * <p> - * Implements a guard mechanism for REST method calls that allows requests to be - * rejected before invocation of the REST method. + * Implements a guard mechanism for REST method calls that allows requests to be rejected before invocation of the REST + * method. * For example, guards can be used to ensure that only administrators can call certain methods. * <p> - * Guards are applied to REST methods declaratively through the {@link RestResource#guards()} or {@link RestMethod#guards()} annotations. + * Guards are applied to REST methods declaratively through the {@link RestResource#guards()} or + * {@link RestMethod#guards()} annotations. * <p> * If multiple guards are specified, ALL guards must pass in order for the request to proceed. * * <h6 class='topic'>How to implement</h6> * <p> - * 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. + * 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. * <p> * Implementers should simply throw a {@link RestException} from the {@link #guard(RestRequest, RestResponse)} - * method to abort processing on the current request. + * method to abort processing on the current request. * <p> * Guards must implement a no-args constructor. * @@ -64,14 +65,12 @@ import org.apache.juneau.rest.annotation.*; public abstract class RestGuard { /** - * Checks the current HTTP request and throws a {@link RestException} if the guard - * does not permit the request. + * Checks the current HTTP request and throws a {@link RestException} if the guard does not permit the request. * <p> - * By default, throws an <jsf>SC_FORBIDDEN</jsf> exception if {@link #isRequestAllowed(RestRequest)} - * returns <jk>false</jk>. + * By default, throws an <jsf>SC_FORBIDDEN</jsf> exception if {@link #isRequestAllowed(RestRequest)} returns + * <jk>false</jk>. * <p> - * Subclasses are free to override this method to tailor the behavior of how to handle unauthorized - * requests. + * Subclasses are free to override this method to tailor the behavior of how to handle unauthorized requests. * * @param req The servlet request. * @param res The servlet response. http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestInfoProvider.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestInfoProvider.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestInfoProvider.java index 0254be6..b0aa412 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestInfoProvider.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestInfoProvider.java @@ -55,6 +55,7 @@ public class RestInfoProvider { /** * Constructor. + * * @param context The resource context. */ public RestInfoProvider(RestContext context) { @@ -186,10 +187,10 @@ public class RestInfoProvider { * </p> * <ol> * <li>{@link RestMethod#summary() @RestMethod.summary()} annotation on the method. - * <li><ck>[ClassName].[javaMethodName].summary</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. - * <li><ck>[javaMethodName].summary</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. + * <li><ck>[ClassName].[javaMethodName].summary</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. + * <li><ck>[javaMethodName].summary</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. * </ol> * * @param javaMethodName The name of the Java method whose description we're retrieving. @@ -212,10 +213,10 @@ public class RestInfoProvider { * </p> * <ol> * <li>{@link RestMethod#description() @RestMethod.description()} annotation on the method. - * <li><ck>[ClassName].[javaMethodName].description</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. - * <li><ck>[javaMethodName].description</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. + * <li><ck>[ClassName].[javaMethodName].description</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. + * <li><ck>[javaMethodName].description</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. * </ol> * * @param javaMethodName The name of the Java method whose description we're retrieving. @@ -238,8 +239,9 @@ public class RestInfoProvider { * <p> * <ol> * <li>{@link RestResource#title() @RestResourcel.title()} annotation on this class, and then any parent classes. - * <li><ck>[ClassName].title</ck> property in resource bundle identified by {@link RestResource#messages() @ResourceBundle.messages()} - * annotation for this class, then any parent classes. + * <li><ck>[ClassName].title</ck> property in resource bundle identified by + * {@link RestResource#messages() @ResourceBundle.messages()} annotation for this class, then any parent + * classes. * <li><ck>title</ck> in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} * annotation for this class, then any parent classes. * <li><ck>/info/title</ck> entry in swagger file. @@ -268,11 +270,12 @@ public class RestInfoProvider { * <p> * The default implementation returns the description from the following locations (whichever matches first): * <ol> - * <li>{@link RestResource#description() @RestResource.description()} annotation on this class, and then any parent classes. - * <li><ck>[ClassName].description</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. - * <li><ck>description</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. + * <li>{@link RestResource#description() @RestResource.description()} annotation on this class, and then any + * parent classes. + * <li><ck>[ClassName].description</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. + * <li><ck>description</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. * <li><ck>/info/description</ck> entry in swagger file. * </ol> * @@ -299,16 +302,18 @@ public class RestInfoProvider { * <p> * The default implementation returns the contact information from the following locations (whichever matches first): * <ol> - * <li>{@link ResourceSwagger#contact() @ResourceSwagger.contact()} annotation on this class, and then any parent classes. - * <li><ck>[ClassName].contact</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. - * <li><ck>contact</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. + * <li>{@link ResourceSwagger#contact() @ResourceSwagger.contact()} annotation on this class, and then any parent + * classes. + * <li><ck>[ClassName].contact</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. + * <li><ck>contact</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. * <li><ck>/info/contact</ck> entry in swagger file. * </ol> * * @param req The current request. - * @return The localized contact information of this REST resource, or <jk>null</jk> if no contact information was found. + * @return The localized contact information of this REST resource, or <jk>null</jk> if no contact information was + * found. */ public Contact getContact(RestRequest req) { VarResolverSession vr = req.getVarResolverSession(); @@ -335,16 +340,18 @@ public class RestInfoProvider { * <p> * The default implementation returns the license information from the following locations (whichever matches first): * <ol> - * <li>{@link ResourceSwagger#license() @ResourceSwagger.license()} annotation on this class, and then any parent classes. - * <li><ck>[ClassName].license</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. - * <li><ck>license</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. + * <li>{@link ResourceSwagger#license() @ResourceSwagger.license()} annotation on this class, and then any parent + * classes. + * <li><ck>[ClassName].license</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. + * <li><ck>license</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. * <li><ck>/info/license</ck> entry in swagger file. * </ol> * * @param req The current request. - * @return The localized contact information of this REST resource, or <jk>null</jk> if no contact information was found. + * @return The localized contact information of this REST resource, or <jk>null</jk> if no contact information was + * found. */ public License getLicense(RestRequest req) { VarResolverSession vr = req.getVarResolverSession(); @@ -369,18 +376,21 @@ public class RestInfoProvider { * <p> * Subclasses can override this method to provide their own terms-of-service information. * <p> - * The default implementation returns the terms-of-service information from the following locations (whichever matches first): + * The default implementation returns the terms-of-service information from the following locations (whichever + * matches first): * <ol> - * <li>{@link ResourceSwagger#termsOfService() @ResourceSwagger.termsOfService()} annotation on this class, and then any parent classes. - * <li><ck>[ClassName].termsOfService</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. - * <li><ck>termsOfService</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. + * <li>{@link ResourceSwagger#termsOfService() @ResourceSwagger.termsOfService()} annotation on this class, and + * then any parent classes. + * <li><ck>[ClassName].termsOfService</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. + * <li><ck>termsOfService</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. * <li><ck>/info/termsOfService</ck> entry in swagger file. * </ol> * * @param req The current request. - * @return The localized contact information of this REST resource, or <jk>null</jk> if no contact information was found. + * @return The localized contact information of this REST resource, or <jk>null</jk> if no contact information was + * found. */ public String getTermsOfService(RestRequest req) { VarResolverSession vr = req.getVarResolverSession(); @@ -402,16 +412,18 @@ public class RestInfoProvider { * <p> * The default implementation returns the version information from the following locations (whichever matches first): * <ol> - * <li>{@link ResourceSwagger#version() @ResourceSwagger.version()} annotation on this class, and then any parent classes. - * <li><ck>[ClassName].version</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. - * <li><ck>version</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. + * <li>{@link ResourceSwagger#version() @ResourceSwagger.version()} annotation on this class, and then any parent + * classes. + * <li><ck>[ClassName].version</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. + * <li><ck>version</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. * <li><ck>/info/version</ck> entry in swagger file. * </ol> * * @param req The current request. - * @return The localized contact information of this REST resource, or <jk>null</jk> if no contact information was found. + * @return The localized contact information of this REST resource, or <jk>null</jk> if no contact information was + * found. */ public String getVersion(RestRequest req) { VarResolverSession vr = req.getVarResolverSession(); @@ -433,16 +445,18 @@ public class RestInfoProvider { * <p> * The default implementation returns the version information from the following locations (whichever matches first): * <ol> - * <li>{@link ResourceSwagger#version() @ResourceSwagger.version()} annotation on this class, and then any parent classes. - * <li><ck>[ClassName].version</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. - * <li><ck>version</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. + * <li>{@link ResourceSwagger#version() @ResourceSwagger.version()} annotation on this class, and then any parent + * classes. + * <li><ck>[ClassName].version</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. + * <li><ck>version</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. * <li><ck>/info/version</ck> entry in swagger file. * </ol> * * @param req The current request. - * @return The localized contact information of this REST resource, or <jk>null</jk> if no contact information was found. + * @return The localized contact information of this REST resource, or <jk>null</jk> if no contact information was + * found. */ public List<Tag> getTags(RestRequest req) { VarResolverSession vr = req.getVarResolverSession(); @@ -469,16 +483,18 @@ public class RestInfoProvider { * <p> * The default implementation returns the version information from the following locations (whichever matches first): * <ol> - * <li>{@link ResourceSwagger#version() @ResourceSwagger.version()} annotation on this class, and then any parent classes. - * <li><ck>[ClassName].version</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. - * <li><ck>version</ck> property in resource bundle identified by {@link RestResource#messages() @RestResource.messages()} - * annotation for this class, then any parent classes. + * <li>{@link ResourceSwagger#version() @ResourceSwagger.version()} annotation on this class, and then any parent + * classes. + * <li><ck>[ClassName].version</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. + * <li><ck>version</ck> property in resource bundle identified by + * {@link RestResource#messages() @RestResource.messages()} annotation for this class, then any parent classes. * <li><ck>/info/version</ck> entry in swagger file. * </ol> * * @param req The current request. - * @return The localized contact information of this REST resource, or <jk>null</jk> if no contact information was found. + * @return The localized contact information of this REST resource, or <jk>null</jk> if no contact information was + * found. */ public ExternalDocumentation getExternalDocs(RestRequest req) { VarResolverSession vr = req.getVarResolverSession(); http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestLogger.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestLogger.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestLogger.java index e9810d6..bc577e8 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestLogger.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestLogger.java @@ -51,8 +51,8 @@ public abstract class RestLogger { /** * Log a message to the logger. * <p> - * Subclasses can override this method if they wish to log messages using a library other than - * Java Logging (e.g. Apache Commons Logging). + * Subclasses can override this method if they wish to log messages using a library other than Java Logging + * (e.g. Apache Commons Logging). * * @param level The log level. * @param cause The cause. @@ -75,9 +75,11 @@ public abstract class RestLogger { } /** - * Same as {@link #log(Level, String, Object...)} excepts runs the arguments through {@link JsonSerializer#DEFAULT_LAX_READABLE}. + * Same as {@link #log(Level, String, Object...)} excepts runs the arguments through + * {@link JsonSerializer#DEFAULT_LAX_READABLE}. * <p> - * Serialization of arguments do not occur if message is not logged, so it's safe to use this method from within debug log statements. + * Serialization of arguments do not occur if message is not logged, so it's safe to use this method from within + * debug log statements. * * <h5 class='section'>Example:</h5> * <p class='bcode'> @@ -150,7 +152,7 @@ public abstract class RestLogger { * Subclasses can override this method to provide their own logic for determining when exceptions are logged. * <p> * The default implementation will return <jk>false</jk> if <js>"noTrace=true"</js> is passed in the query string - * or <code>No-Trace: true</code> is specified in the header. + * or <code>No-Trace: true</code> is specified in the header. * * @param req The HTTP request. * @param res The HTTP response. @@ -168,8 +170,8 @@ public abstract class RestLogger { * <p> * Subclasses can override this method to provide their own logic for determining when stack traces are logged. * <p> - * The default implementation will only log a stack trace if {@link RestException#getOccurrence()} returns <code>1</code> - * and the exception is not one of the following: + * The default implementation will only log a stack trace if {@link RestException#getOccurrence()} returns + * <code>1</code> and the exception is not one of the following: * </p> * <ul> * <li>{@link HttpServletResponse#SC_UNAUTHORIZED} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcher.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcher.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcher.java index 236545f..612d9d1 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcher.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcher.java @@ -17,18 +17,17 @@ import org.apache.juneau.rest.annotation.*; /** * Class used for defining method-level matchers using the {@link RestMethod#matchers()} annotation. * <p> - * Matchers are used to allow multiple Java methods to handle requests assigned to the same - * URL path pattern, but differing based on some request attribute, such as a specific header value. - * For example, matchers can be used to provide two different methods for handling requests - * from two different client versions. + * Matchers are used to allow multiple Java methods to handle requests assigned to the same URL path pattern, but + * differing based on some request attribute, such as a specific header value. + * For example, matchers can be used to provide two different methods for handling requests from two different client + * versions. * <p> - * Java methods with matchers associated with them are always attempted before Java methods - * without matchers. + * Java methods with matchers associated with them are always attempted before Java methods without matchers. * This allows a 'default' method to be defined to handle requests where no matchers match. * <p> * When multiple matchers are specified on a method, only one matcher is required to match. - * This is opposite from the {@link RestMethod#guards()} annotation, where all guards - * are required to match in order to execute the method. + * This is opposite from the {@link RestMethod#guards()} annotation, where all guards are required to match in order to + * execute the method. * * <h5 class='section'>Example:</h5> * <p class='bcode'> http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcherReflecting.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcherReflecting.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcherReflecting.java index 2a1cc16..5678d1d 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcherReflecting.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestMatcherReflecting.java @@ -17,9 +17,8 @@ import java.lang.reflect.*; /** * Subclass of {@link RestMatcher} that gives access to the servlet/resource and Java method it's applied to. * <p> - * Essentially the same as {@link RestMatcher} except has a constructor where the - * Java method is passed in so that you can access annotations defined on it to tailor - * the behavior of the matcher. + * Essentially the same as {@link RestMatcher} except has a constructor where the Java method is passed in so that you + * can access annotations defined on it to tailor the behavior of the matcher. */ public abstract class RestMatcherReflecting extends RestMatcher { http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestParam.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestParam.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestParam.java index 4e834b4..840f9f7 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestParam.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestParam.java @@ -35,7 +35,7 @@ public abstract class RestParam { * * @param paramType The Swagger parameter type. * @param name The parameter name. - * Can be <jk>null</jk> if parameter doesn't have a name (e.g. the request body). + * Can be <jk>null</jk> if parameter doesn't have a name (e.g. the request body). * @param type The object type to convert the parameter to. */ protected RestParam(RestParamType paramType, String name, Type type) { @@ -56,6 +56,7 @@ public abstract class RestParam { /** * Returns the parameter class type that this parameter resolver is meant for. + * * @return The parameter class type, or <jk>null</jk> if the type passed in isn't an instance of {@link Class}. */ protected Class<?> forClass() { @@ -66,6 +67,7 @@ public abstract class RestParam { /** * Returns the swagger parameter type for this parameter as shown in the Swagger doc. + * * @return the swagger parameter type for this parameter. */ protected RestParamType getParamType() { @@ -74,6 +76,7 @@ public abstract class RestParam { /** * Returns the parameter name for this parameter as shown in the Swagger doc. + * * @return the parameter name for this parameter. */ protected String getName() { @@ -82,6 +85,7 @@ public abstract class RestParam { /** * Returns the parameter class type. + * * @return the parameter class type. */ public Type getType() { http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java index e631bbe..9a2f9d2 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java @@ -46,7 +46,7 @@ import org.apache.juneau.utils.*; * Equivalent to {@link HttpServletRequest} except with some additional convenience methods. * <p> * For reference, given the URL <js>"http://localhost:9080/contextRoot/servletPath/foo?bar=baz#qux"</js>, the - * following methods return the following values.... + * following methods return the following values.... * <table class='styled'> * <tr><th>Method</th><th>Value</th></tr> * <tr><td>{@code getContextPath()}</td><td>{@code /contextRoot}</td></tr> @@ -58,7 +58,8 @@ import org.apache.juneau.utils.*; * <tr><td>{@code getServletPath()}</td><td>{@code /servletPath}</td></tr> * </table> * <p> - * Refer to <a class="doclink" href="package-summary.html#TOC">REST Servlet API</a> for information about using this class. + * Refer to <a class="doclink" href="package-summary.html#TOC">REST Servlet API</a> for information about using this + * class. */ @SuppressWarnings("unchecked") public final class RestRequest extends HttpServletRequestWrapper { @@ -362,7 +363,8 @@ public final class RestRequest extends HttpServletRequestWrapper { /** * Equivalent to {@link #getParameterMap()}, but only looks for query parameters in the URL, not form posts. * <p> - * This method can be used to retrieve query parameters without triggering the underlying servlet API to load and parse the request body. + * This method can be used to retrieve query parameters without triggering the underlying servlet API to load and + * parse the request body. * <p> * This object is modifiable. * @@ -374,6 +376,7 @@ public final class RestRequest extends HttpServletRequestWrapper { /** * Shortcut for calling <code>getQuery().getString(name)</code>. + * * @param name The query parameter name. * @return The query parameter value, or <jk>null<jk> if not found. */ @@ -414,6 +417,7 @@ public final class RestRequest extends HttpServletRequestWrapper { /** * Shortcut for calling <code>getFormData().getString(name)</code>. + * * @param name The form data parameter name. * @return The form data parameter value, or <jk>null<jk> if not found. */ @@ -452,7 +456,8 @@ public final class RestRequest extends HttpServletRequestWrapper { /** * Returns the HTTP body content as a {@link Reader}. * <p> - * If {@code allowHeaderParams} init parameter is true, then first looks for {@code &body=xxx} in the URL query string. + * If {@code allowHeaderParams} init parameter is true, then first looks for {@code &body=xxx} in the URL query + * string. * <p> * Automatically handles GZipped input streams. */ @@ -467,8 +472,7 @@ public final class RestRequest extends HttpServletRequestWrapper { * Automatically handles GZipped input streams. * * @return The negotiated input stream. - * @throws IOException If any error occurred while trying to get the input stream or wrap it - * in the GZIP wrapper. + * @throws IOException If any error occurred while trying to get the input stream or wrap it in the GZIP wrapper. */ @Override /* ServletRequest */ public ServletInputStream getInputStream() throws IOException { @@ -487,8 +491,8 @@ public final class RestRequest extends HttpServletRequestWrapper { /** * Returns the URI context of the request. * <p> - * The URI context contains all the information about the URI of the request, such - * as the servlet URI, context path, etc... + * The URI context contains all the information about the URI of the request, such as the servlet URI, context + * path, etc... * * @return The URI context of the request. */ @@ -505,7 +509,7 @@ public final class RestRequest extends HttpServletRequestWrapper { } /** - * Returns a URI resolver that can be used to convert URIs to absolute or root-relative form.. + * Returns a URI resolver that can be used to convert URIs to absolute or root-relative form. * * @param resolution The URI resolution rule. * @param relativity The relative URI relativity rule. @@ -516,7 +520,8 @@ public final class RestRequest extends HttpServletRequestWrapper { } /** - * Shortcut for calling {@link #getUriResolver()} using {@link UriResolution#ROOT_RELATIVE} and {@link UriRelativity#RESOURCE} + * Shortcut for calling {@link #getUriResolver()} using {@link UriResolution#ROOT_RELATIVE} and + * {@link UriRelativity#RESOURCE} * * @return The URI resolver for this request. */ @@ -599,7 +604,8 @@ public final class RestRequest extends HttpServletRequestWrapper { /** * Returns the method of this request. * <p> - * If <code>allowHeaderParams</code> init parameter is <jk>true</jk>, then first looks for <code>&method=xxx</code> in the URL query string. + * If <code>allowHeaderParams</code> init parameter is <jk>true</jk>, then first looks for + * <code>&method=xxx</code> in the URL query string. */ @Override /* ServletRequest */ public String getMethod() { @@ -630,7 +636,7 @@ public final class RestRequest extends HttpServletRequestWrapper { * Returns <jk>true</jk> if <code>&plainText=true</code> was specified as a URL parameter. * <p> * This indicates that the <code>Content-Type</code> of the output should always be set to <js>"text/plain"</js> - * to make it easy to render in a browser. + * to make it easy to render in a browser. * <p> * This feature is useful for debugging. * @@ -663,8 +669,8 @@ public final class RestRequest extends HttpServletRequestWrapper { /** * Returns the servlet handling the request. * <p> - * Can be used to access servlet-init parameters or annotations during requests, - * such as in calls to {@link RestGuard#guard(RestRequest, RestResponse)}.. + * Can be used to access servlet-init parameters or annotations during requests, such as in calls to + * {@link RestGuard#guard(RestRequest, RestResponse)}.. * * @return The servlet handling the request. */ @@ -675,16 +681,16 @@ public final class RestRequest extends HttpServletRequestWrapper { /** * Returns the java method handling the request. * <p> - * Can be used to access the method name or method annotations during requests, such - * as in calls to {@link RestGuard#guard(RestRequest, RestResponse)}. - * <p> + * Can be used to access the method name or method annotations during requests, such as in calls to + * {@link RestGuard#guard(RestRequest, RestResponse)}. + * * <h5 class='section'>Notes:</h5> * <ul> - * <li>This returns null when evaluating servlet-level guards since the method has not been resolved at that point of execution. + * <li>This returns null when evaluating servlet-level guards since the method has not been resolved at that + * point of execution. * </ul> * - * @return The Java method handling the request, or <code>null</code> if the method - * has not yet been resolved. + * @return The Java method handling the request, or <code>null</code> if the method has not yet been resolved. */ public Method getJavaMethod() { return javaMethod; @@ -700,7 +706,8 @@ public final class RestRequest extends HttpServletRequestWrapper { } /** - * Returns the variable resolver session for this request using session objects created by {@link RestCallHandler#getSessionObjects(RestRequest)}. + * Returns the variable resolver session for this request using session objects created by + * {@link RestCallHandler#getSessionObjects(RestRequest)}. * * @return The variable resolver for this request. */ @@ -721,11 +728,12 @@ public final class RestRequest extends HttpServletRequestWrapper { } /** - * Returns an instance of a {@link ReaderResource} that represents the contents of a resource text file from the classpath. + * Returns an instance of a {@link ReaderResource} that represents the contents of a resource text file from the + * classpath. * * @param name The name of the resource (i.e. the value normally passed to {@link Class#getResourceAsStream(String)}. - * @param resolveVars If <jk>true</jk>, any {@link org.apache.juneau.rest.annotation.Parameter} variables will be resolved by the variable resolver returned - * by {@link #getVarResolverSession()}. + * @param resolveVars If <jk>true</jk>, any {@link org.apache.juneau.rest.annotation.Parameter} variables will be + * resolved by the variable resolver returned by {@link #getVarResolverSession()}. * @param mediaType The value to set as the <js>"Content-Type"</js> header for this object. * @return A new reader resource, or <jk>null</jk> if resource could not be found. * @throws IOException @@ -745,8 +753,8 @@ public final class RestRequest extends HttpServletRequestWrapper { * constructed using {@link RestConfig#addMimeTypes(String...)} to determine the media type. * * @param name The name of the resource (i.e. the value normally passed to {@link Class#getResourceAsStream(String)}. - * @param resolveVars If <jk>true</jk>, any {@link org.apache.juneau.rest.annotation.Parameter} variables will be resolved by the variable resolver returned - * by {@link #getVarResolverSession()}. + * @param resolveVars If <jk>true</jk>, any {@link org.apache.juneau.rest.annotation.Parameter} variables will be + * resolved by the variable resolver returned by {@link #getVarResolverSession()}. * @return A new reader resource, or <jk>null</jk> if resource could not be found. * @throws IOException */ @@ -768,7 +776,8 @@ public final class RestRequest extends HttpServletRequestWrapper { /** * Returns the config file associated with the servlet. * - * @return The config file associated with the servlet, or <jk>null</jk> if servlet does not have a config file associated with it. + * @return The config file associated with the servlet, or <jk>null</jk> if servlet does not have a config file + * associated with it. */ public ConfigFile getConfigFile() { if (cf == null) @@ -780,7 +789,7 @@ public final class RestRequest extends HttpServletRequestWrapper { * Returns the localized swagger associated with the servlet. * * @return The swagger associated with the servlet. - * Never <jk>null</jk>. + * Never <jk>null</jk>. */ public Swagger getSwagger() { if (swagger == null) @@ -792,7 +801,7 @@ public final class RestRequest extends HttpServletRequestWrapper { * Returns the widgets used for resolving <js>"$W{...}"</js> string variables. * * @return The widgets used for resolving <js>"$W{...}"</js> string variables. - * Never <jk>null</jk>. + * Never <jk>null</jk>. */ public Map<String,Widget> getWidgets() { return widgets; @@ -801,8 +810,8 @@ public final class RestRequest extends HttpServletRequestWrapper { /** * Returns the localized Swagger from the file system. * <p> - * Looks for a file called <js>"{ServletClass}_{locale}.json"</js> in the same package - * as this servlet and returns it as a parsed {@link Swagger} object. + * Looks for a file called <js>"{ServletClass}_{locale}.json"</js> in the same package as this servlet and returns + * it as a parsed {@link Swagger} object. * <p> * Returned objects are cached for later quick-lookup. * http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestResourceResolver.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestResourceResolver.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestResourceResolver.java index 057eb3b..ddbdf18 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestResourceResolver.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestResourceResolver.java @@ -27,7 +27,8 @@ import org.apache.juneau.rest.annotation.*; * These can be associated with REST resources in one of the following ways: * <ul> * <li>{@link RestResource#resourceResolver() @RestResource.resourceResolver()} annotation. - * <li>{@link RestConfig#setResourceResolver(Class)}/{@link RestConfig#setResourceResolver(RestResourceResolver)} methods. + * <li>{@link RestConfig#setResourceResolver(Class)}/{@link RestConfig#setResourceResolver(RestResourceResolver)} + * methods. * </ul> * <p> * The default implementation simply instantiates the class using one of the following constructors: http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestResponse.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestResponse.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestResponse.java index 34b3cc0..e0d2f69 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestResponse.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestResponse.java @@ -35,11 +35,11 @@ import org.apache.juneau.xml.*; /** * Represents an HTTP response for a REST resource. * <p> - * Essentially an extended {@link HttpServletResponse} with some special convenience methods - * that allow you to easily output POJOs as responses. + * Essentially an extended {@link HttpServletResponse} with some special convenience methods that allow you to easily + * output POJOs as responses. * <p> - * Since this class extends {@link HttpServletResponse}, developers are free to use these - * convenience methods, or revert to using lower level methods like any other servlet response. + * Since this class extends {@link HttpServletResponse}, developers are free to use these convenience methods, or + * revert to using lower level methods like any other servlet response. * * <h5 class='section'>Example:</h5> * <p class='bcode'> @@ -50,16 +50,17 @@ import org.apache.juneau.xml.*; * } * </p> * <p> - * Refer to <a class="doclink" href="package-summary.html#TOC">REST Servlet API</a> for information about using this class. + * Refer to <a class="doclink" href="package-summary.html#TOC">REST Servlet API</a> for information about using this + * class. */ public final class RestResponse extends HttpServletResponseWrapper { private final RestRequest request; - private Object output; // The POJO being sent to the output. - private boolean isNullOutput; // The output is null (as opposed to not being set at all) - private ObjectMap properties; // Response properties + private Object output; // The POJO being sent to the output. + private boolean isNullOutput; // The output is null (as opposed to not being set at all) + private ObjectMap properties; // Response properties SerializerGroup serializerGroup; - UrlEncodingSerializer urlEncodingSerializer; // The serializer used to convert arguments passed into Redirect objects. + UrlEncodingSerializer urlEncodingSerializer; // The serializer used to convert arguments passed into Redirect objects. private EncoderGroup encoders; private ServletOutputStream os; private PrintWriter w; @@ -138,7 +139,8 @@ public final class RestResponse extends HttpServletResponseWrapper { } /** - * Returns the codings that are valid for <code>Accept-Encoding</code> and <code>Content-Encoding</code> headers on the request. + * Returns the codings that are valid for <code>Accept-Encoding</code> and <code>Content-Encoding</code> headers on + * the request. * * @return The set of media types registered in the parser group of this request. * @throws RestServletException @@ -156,10 +158,12 @@ public final class RestResponse extends HttpServletResponseWrapper { * <ul> * <li> {@link InputStream} * <li> {@link Reader} - * <li> Any serializable type defined in <a class="doclink" href="../../../../overview-summary.html#Core.PojoCategories">POJO Categories</a> + * <li> Any serializable type defined in <a class="doclink" + * href="../../../../overview-summary.html#Core.PojoCategories">POJO Categories</a> * </ul> * <p> - * If it's an {@link InputStream} or {@link Reader}, you must also specify the <code>Content-Type</code> using the {@link #setContentType(String)} method. + * If it's an {@link InputStream} or {@link Reader}, you must also specify the <code>Content-Type</code> using the + * {@link #setContentType(String)} method. * * @param output The output to serialize to the connection. * @return This object (for method chaining). @@ -200,7 +204,7 @@ public final class RestResponse extends HttpServletResponseWrapper { } /** - * Shortcut method that allows you to use varargs to simplify setting array output. + * Shortcut method that allows you to use var-args to simplify setting array output. * * <h5 class='section'>Example:</h5> * <p class='bcode'> @@ -251,9 +255,8 @@ public final class RestResponse extends HttpServletResponseWrapper { } /** - * Equivalent to {@link HttpServletResponse#getOutputStream()}, except - * wraps the output stream if an {@link Encoder} was found that matched - * the <code>Accept-Encoding</code> header. + * Equivalent to {@link HttpServletResponse#getOutputStream()}, except wraps the output stream if an {@link Encoder} + * was found that matched the <code>Accept-Encoding</code> header. * * @return A negotiated output stream. * @throws IOException @@ -336,8 +339,8 @@ public final class RestResponse extends HttpServletResponseWrapper { /** * Convenience method meant to be used when rendering directly to a browser with no buffering. - * Sets the header <js>"x-content-type-options=nosniff"</js> so that output is rendered - * immediately on IE and Chrome without any buffering for content-type sniffing. + * Sets the header <js>"x-content-type-options=nosniff"</js> so that output is rendered immediately on IE and Chrome + * without any buffering for content-type sniffing. * * @param contentType The value to set as the <code>Content-Type</code> on the response. * @return The raw writer. @@ -350,10 +353,9 @@ public final class RestResponse extends HttpServletResponseWrapper { } /** - * Equivalent to {@link HttpServletResponse#getWriter()}, except - * wraps the output stream if an {@link Encoder} was found that matched - * the <code>Accept-Encoding</code> header and sets the <code>Content-Encoding</code> - * header to the appropriate value. + * Equivalent to {@link HttpServletResponse#getWriter()}, except wraps the output stream if an {@link Encoder} was + * found that matched the <code>Accept-Encoding</code> header and sets the <code>Content-Encoding</code> + * header to the appropriate value. * * @return The negotiated writer. * @throws IOException @@ -394,8 +396,7 @@ public final class RestResponse extends HttpServletResponseWrapper { * Redirects to the specified URI. * <p> * Relative URIs are always interpreted as relative to the context root. - * This is similar to how WAS handles redirect requests, and is different from how Tomcat - * handles redirect requests. + * This is similar to how WAS handles redirect requests, and is different from how Tomcat handles redirect requests. */ @Override /* ServletResponse */ public void sendRedirect(String uri) throws IOException { @@ -430,7 +431,7 @@ public final class RestResponse extends HttpServletResponseWrapper { * The format of this value is plain text. * <p> * It gets wrapped in a <code><xt><h3> <xa>class</xa>=<xs>'title'</xs>></xt></code> element and then added - * to the <code><xt><header></code> section on the page. + * to the <code><xt><header></code> section on the page. * <p> * If not specified, the page title is pulled from one of the following locations: * <ol> @@ -475,7 +476,7 @@ public final class RestResponse extends HttpServletResponseWrapper { * The format of this value is plain text. * <p> * It gets wrapped in a <code><xt><h5> <xa>class</xa>=<xs>'description'</xs>></xt></code> element and then - * added to the <code><xt><header></code> section on the page. + * added to the <code><xt><header></code> section on the page. * <p> * If not specified, the page title is pulled from one of the following locations: * <ol> @@ -530,7 +531,7 @@ public final class RestResponse extends HttpServletResponseWrapper { * This is the programmatic equivalent to the {@link HtmlDoc#branding() @HtmlDoc.branding()} annotation. * * @param value The HTML page branding. - * Object will be converted to a string using {@link Object#toString()}. + * Object will be converted to a string using {@link Object#toString()}. * @return This object (for method chaining). */ public RestResponse setHtmlBranding(Object value) { @@ -543,9 +544,10 @@ public final class RestResponse extends HttpServletResponseWrapper { * The format of this value is HTML. * <p> * The page header normally contains the title and description, but this value can be used to override the contents - * to be whatever you want. + * to be whatever you want. * <p> - * When a value is specified, the {@link #setHtmlTitle(Object)} and {@link #setHtmlDescription(Object)} values will be ignored. + * When a value is specified, the {@link #setHtmlTitle(Object)} and {@link #setHtmlDescription(Object)} values will + * be ignored. * <p> * A value of <js>"NONE"</js> can be used to force no header. * <p> @@ -554,13 +556,13 @@ public final class RestResponse extends HttpServletResponseWrapper { * This is the programmatic equivalent to the {@link HtmlDoc#header() @HtmlDoc.header()} annotation. * * @param value The HTML header section contents. - * Object will be converted to a string using {@link Object#toString()}. - * <p> - * <ul class='doctree'> - * <li class='info'> - * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to - * waste string concatenation cycles on non-HTML views. - * </ul> + * Object will be converted to a string using {@link Object#toString()}. + * <p> + * <ul class='doctree'> + * <li class='info'> + * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to + * waste string concatenation cycles on non-HTML views. + * </ul> * @return This object (for method chaining). */ public RestResponse setHtmlHeader(Object value) { @@ -571,7 +573,7 @@ public final class RestResponse extends HttpServletResponseWrapper { * Sets the links in the HTML nav section. * <p> * The format of this value is a lax-JSON map of key/value pairs where the keys are the link text and the values are - * relative (to the servlet) or absolute URLs. + * relative (to the servlet) or absolute URLs. * <p> * The page links are positioned immediately under the title and text. * <p> @@ -584,13 +586,13 @@ public final class RestResponse extends HttpServletResponseWrapper { * This is the programmatic equivalent to the {@link HtmlDoc#links() @HtmlDoc.links()} annotation. * * @param value The HTML nav section links links. - * Object will be converted to a string using {@link Object#toString()}. - * <p> - * <ul class='doctree'> - * <li class='info'> - * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to - * waste string concatenation cycles on non-HTML views. - * </ul> + * Object will be converted to a string using {@link Object#toString()}. + * <p> + * <ul class='doctree'> + * <li class='info'> + * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to + * waste string concatenation cycles on non-HTML views. + * </ul> * @return This object (for method chaining). */ public RestResponse setHtmlLinks(Object value) { @@ -616,13 +618,13 @@ public final class RestResponse extends HttpServletResponseWrapper { * This is the programmatic equivalent to the {@link HtmlDoc#nav() @HtmlDoc.nav()} annotation. * * @param value The HTML nav section contents. - * Object will be converted to a string using {@link Object#toString()}. - * <p> - * <ul class='doctree'> - * <li class='info'> - * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to - * waste string concatenation cycles on non-HTML views. - * </ul> + * Object will be converted to a string using {@link Object#toString()}. + * <p> + * <ul class='doctree'> + * <li class='info'> + * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to + * waste string concatenation cycles on non-HTML views. + * </ul> * @return This object (for method chaining). */ public RestResponse setHtmlNav(Object value) { @@ -644,13 +646,13 @@ public final class RestResponse extends HttpServletResponseWrapper { * This is the programmatic equivalent to the {@link HtmlDoc#aside() @HtmlDoc.aside()} annotation. * * @param value The HTML aside section contents. - * Object will be converted to a string using {@link Object#toString()}. - * <p> - * <ul class='doctree'> - * <li class='info'> - * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to - * waste string concatenation cycles on non-HTML views. - * </ul> + * Object will be converted to a string using {@link Object#toString()}. + * <p> + * <ul class='doctree'> + * <li class='info'> + * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to waste + * string concatenation cycles on non-HTML views. + * </ul> * @return This object (for method chaining). */ public RestResponse setHtmlAside(Object value) { @@ -672,13 +674,13 @@ public final class RestResponse extends HttpServletResponseWrapper { * This is the programmatic equivalent to the {@link HtmlDoc#footer() @HtmlDoc.footer()} annotation. * * @param value The HTML footer section contents. - * Object will be converted to a string using {@link Object#toString()}. - * <p> - * <ul class='doctree'> - * <li class='info'> - * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to - * waste string concatenation cycles on non-HTML views. - * </ul> + * Object will be converted to a string using {@link Object#toString()}. + * <p> + * <ul class='doctree'> + * <li class='info'> + * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to + * waste string concatenation cycles on non-HTML views. + * </ul> * @return This object (for method chaining). */ public RestResponse setHtmlFooter(Object value) { @@ -698,13 +700,13 @@ public final class RestResponse extends HttpServletResponseWrapper { * This is the programmatic equivalent to the {@link HtmlDoc#css() @HtmlDoc.css()} annotation. * * @param value The HTML CSS style section contents. - * Object will be converted to a string using {@link Object#toString()}. - * <p> - * <ul class='doctree'> - * <li class='info'> - * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to - * waste string concatenation cycles on non-HTML views. - * </ul> + * Object will be converted to a string using {@link Object#toString()}. + * <p> + * <ul class='doctree'> + * <li class='info'> + * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to + * waste string concatenation cycles on non-HTML views. + * </ul> * @return This object (for method chaining). */ public RestResponse setHtmlCss(Object value) { @@ -722,18 +724,18 @@ public final class RestResponse extends HttpServletResponseWrapper { * The format of this value is CSS. * <p> * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>) and can use URL protocols defined - * by {@link UriResolver}. + * by {@link UriResolver}. * <p> * This is the programmatic equivalent to the {@link HtmlDoc#cssUrl() @HtmlDoc.cssUrl()} annotation. * * @param value The CSS URL in the HTML CSS style section. - * Object will be converted to a string using {@link Object#toString()}. - * <p> - * <ul class='doctree'> - * <li class='info'> - * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to - * waste string concatenation cycles on non-HTML views. - * </ul> + * Object will be converted to a string using {@link Object#toString()}. + * <p> + * <ul class='doctree'> + * <li class='info'> + * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to + * waste string concatenation cycles on non-HTML views. + * </ul> * @return This object (for method chaining). */ public RestResponse setHtmlCssUrl(Object value) { @@ -757,7 +759,8 @@ public final class RestResponse extends HttpServletResponseWrapper { /** * Specifies the text to display when serializing an empty array or collection. * <p> - * This is the programmatic equivalent to the {@link HtmlDoc#noResultsMessage() @HtmlDoc.noResultsMessage()} annotation. + * This is the programmatic equivalent to the {@link HtmlDoc#noResultsMessage() @HtmlDoc.noResultsMessage()} + * annotation. * * @param value The text to display when serializing an empty array or collection. * @return This object (for method chaining). @@ -770,9 +773,8 @@ public final class RestResponse extends HttpServletResponseWrapper { /** * Specifies the template class to use for rendering the HTML page. * <p> - * By default, uses {@link HtmlDocTemplateBasic} to render the contents, although you can provide - * your own custom renderer or subclasses from the basic class to have full control over how the page is - * rendered. + * By default, uses {@link HtmlDocTemplateBasic} to render the contents, although you can provide your own custom + * renderer or subclasses from the basic class to have full control over how the page is rendered. * <p> * This is the programmatic equivalent to the {@link HtmlDoc#template() @HtmlDoc.template()} annotation. * @@ -787,9 +789,8 @@ public final class RestResponse extends HttpServletResponseWrapper { /** * Specifies the template class to use for rendering the HTML page. * <p> - * By default, uses {@link HtmlDocTemplateBasic} to render the contents, although you can provide - * your own custom renderer or subclasses from the basic class to have full control over how the page is - * rendered. + * By default, uses {@link HtmlDocTemplateBasic} to render the contents, although you can provide your own custom + * renderer or subclasses from the basic class to have full control over how the page is rendered. * <p> * This is the programmatic equivalent to the {@link HtmlDoc#template() @HtmlDoc.template()} annotation. * http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java index 1cd2506..37db4e0 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java @@ -29,7 +29,8 @@ import org.apache.juneau.utils.*; /** * Servlet implementation of a REST resource. * <p> - * Refer to <a class="doclink" href="package-summary.html#TOC">REST Servlet API</a> for information about using this class. + * Refer to <a class="doclink" href="package-summary.html#TOC">REST Servlet API</a> for information about using this + * class. */ @SuppressWarnings("hiding") public abstract class RestServlet extends HttpServlet { @@ -53,7 +54,7 @@ public abstract class RestServlet extends HttpServlet { super.init(servletConfig); } } catch (RestException e) { - // Thrown RestExceptions are simply caught and rethrown on subsequent calls to service(). + // Thrown RestExceptions are simply caught and re-thrown on subsequent calls to service(). initException = e; log(SEVERE, e, "Servlet init error on class ''{0}''", getClass().getName()); } catch (ServletException e) { @@ -76,17 +77,16 @@ public abstract class RestServlet extends HttpServlet { /** * Resource initialization method. * <p> - * Identical to {@link Servlet#init(ServletConfig)} except the config object provides - * access to the external config file, configuration properties, and variable resolver - * defined for this resource. + * Identical to {@link Servlet#init(ServletConfig)} except the config object provides access to the external config + * file, configuration properties, and variable resolver defined for this resource. * <p> - * Classes can also use {@link HttpServlet#init()} and {@link RestServlet#getServletConfig()} - * as well to perform initialization. + * Classes can also use {@link HttpServlet#init()} and {@link RestServlet#getServletConfig()} as well to perform + * initialization. * <p> * Note that if you override this method, you must first call <code><jk>super</jk>.init(servletConfig)</code>! * <p> - * Resource classes that don't extend from {@link RestServlet} can add this method to their class - * to get access to the config object. + * Resource classes that don't extend from {@link RestServlet} can add this method to their class to get access to + * the config object. * * @param config The servlet configuration. * @throws Exception Any exception can be thrown to signal an initialization failure. @@ -157,11 +157,11 @@ public abstract class RestServlet extends HttpServlet { /** * Returns the read-only context object that contains all the configuration information about this resource. * <p> - * This object is <jk>null</jk> during the call to {@link #init(RestConfig)} but is populated - * by the time {@link #init()} is called. + * This object is <jk>null</jk> during the call to {@link #init(RestConfig)} but is populated by the time + * {@link #init()} is called. * <p> - * Resource classes that don't extend from {@link RestServlet} can add the following method to their - * class to get access to this context object: + * Resource classes that don't extend from {@link RestServlet} can add the following method to their class to get + * access to this context object: * <p class='bcode'> * <jk>public void</jk> init(RestServletContext context) <jk>throws</jk> Exception; * </p> @@ -179,8 +179,8 @@ public abstract class RestServlet extends HttpServlet { * <p> * The default implementation does nothing. * <p> - * Resources that don't extend from {@link RestServlet} can implement an equivalent method by - * overriding the {@link RestCallHandler#onSuccess(RestRequest, RestResponse, long)} method. + * Resources that don't extend from {@link RestServlet} can implement an equivalent method by overriding the + * {@link RestCallHandler#onSuccess(RestRequest, RestResponse, long)} method. * * @param req The HTTP request. * @param res The HTTP response. @@ -191,11 +191,11 @@ public abstract class RestServlet extends HttpServlet { /** * Callback method that gets invoked right before the REST Java method is invoked. * <p> - * Subclasses can override this method to override request headers or set request-duration properties - * before the Java method is invoked. + * Subclasses can override this method to override request headers or set request-duration properties before the + * Java method is invoked. * <p> - * Resources that don't extend from {@link RestServlet} can implement an equivalent method by - * overriding the {@link RestCallHandler#onPreCall(RestRequest)} method. + * Resources that don't extend from {@link RestServlet} can implement an equivalent method by overriding the + * {@link RestCallHandler#onPreCall(RestRequest)} method. * * @param req The HTTP servlet request object. * @throws RestException If any error occurs. @@ -203,14 +203,14 @@ public abstract class RestServlet extends HttpServlet { protected void onPreCall(RestRequest req) throws RestException {} /** - * Callback method that gets invoked right after the REST Java method is invoked, but before - * the serializer is invoked. + * Callback method that gets invoked right after the REST Java method is invoked, but before the serializer is + * invoked. * <p> - * Subclasses can override this method to override request and response headers, or - * set/override properties used by the serializer. + * Subclasses can override this method to override request and response headers, or set/override properties used by + * the serializer. * <p> - * Resources that don't extend from {@link RestServlet} can implement an equivalent method by - * overriding the {@link RestCallHandler#onPostCall(RestRequest,RestResponse)} method. + * Resources that don't extend from {@link RestServlet} can implement an equivalent method by overriding the + * {@link RestCallHandler#onPostCall(RestRequest,RestResponse)} method. * * @param req The HTTP servlet request object. * @param res The HTTP servlet response object. @@ -263,6 +263,7 @@ public abstract class RestServlet extends HttpServlet { /** * Convenience method for calling <code>getContext().getMessages();</code> + * * @return The resource bundle for this resource. Never <jk>null</jk>. * @see RestContext#getProperties() */ @@ -272,6 +273,7 @@ public abstract class RestServlet extends HttpServlet { /** * Convenience method for calling <code>getContext().getProperties();</code> + * * @return The resource properties as an {@link ObjectMap}. * @see RestContext#getProperties() */ @@ -281,6 +283,7 @@ public abstract class RestServlet extends HttpServlet { /** * Convenience method for calling <code>getContext().getBeanContext();</code> + * * @return The bean context used for parsing path variables and header values. * @see RestContext#getBeanContext() */
