Repository: incubator-juneau Updated Branches: refs/heads/master b59ffb4f3 -> 0d913b38f
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServiceProperties.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServiceProperties.java b/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServiceProperties.java index b37a785..8c92777 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServiceProperties.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServiceProperties.java @@ -19,16 +19,19 @@ import org.apache.juneau.rest.annotation.*; /** * Configurable properties for the {@link RemoteableServlet} class. * <p> - * Properties can be set on the {@link RestServlet} class using the {@link RestResource#properties} or {@link RestMethod#properties} annotations. + * Properties can be set on the {@link RestServlet} class using the {@link RestResource#properties} or + * {@link RestMethod#properties} annotations. * <p> * These properties can also be passed in as servlet init parameters. * <p> - * These properties are only valid at the class level, not the method level. Setting them on {@link RestMethod#properties()} has no effect. + * These properties are only valid at the class level, not the method level. + * Setting them on {@link RestMethod#properties()} has no effect. */ public final class RemoteableServiceProperties { /** - * Only expose interfaces and methods annotated with {@link Remoteable @Remoteable} ({@link Boolean}, default=<jk>false</jk>). + * Only expose interfaces and methods annotated with {@link Remoteable @Remoteable} ({@link Boolean}, + * default=<jk>false</jk>). * <p> * When enabled, the {@link RemoteableServlet} class will only work with annotated remoteable interfaces and methods. * Otherwise, all public methods can be executed through the service. http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java b/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java index 2d173f5..5df35db 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java @@ -28,8 +28,8 @@ import org.apache.juneau.rest.annotation.*; * <p> * Remoteable services are POJOs whose methods can be invoked remotely through proxy interfaces. * <p> - * To implement a remoteable service, developers must simply subclass from this class and implement the {@link #getServiceMap()} method that - * maps java interfaces to POJO instances. + * To implement a remoteable service, developers must simply subclass from this class and implement the + * {@link #getServiceMap()} method that maps java interfaces to POJO instances. * * See <a class='doclink' href='package-summary.html#TOC'>org.apache.juneau.rest.remoteable</a> for details. */ @@ -69,7 +69,7 @@ public abstract class RemoteableServlet extends RestServletDefault { boolean useAll = ! useOnlyAnnotated(); for (Class<?> c : getServiceMap().keySet()) { if (useAll || getContext().getBeanContext().getClassMeta(c).isRemoteable()) - l.add(new Link(c.getName(), "{0}/{1}", req.getRequestURI(), c.getName())); //$NON-NLS-1$ + l.add(new Link(c.getName(), "{0}/{1}", req.getRequestURI(), c.getName())); } return l; } @@ -101,18 +101,18 @@ public abstract class RemoteableServlet extends RestServletDefault { // Find the parser. ReaderParser p = req.getBody().getReaderParser(); if (p == null) - throw new RestException(SC_UNSUPPORTED_MEDIA_TYPE, "Could not find parser for media type ''{0}''", req.getHeaders().getContentType()); //$NON-NLS-1$ + throw new RestException(SC_UNSUPPORTED_MEDIA_TYPE, "Could not find parser for media type ''{0}''", req.getHeaders().getContentType()); Class<?> c = getInterfaceClass(javaInterface); // Find the service. Object service = getServiceMap().get(c); if (service == null) - throw new RestException(SC_NOT_FOUND, "Service not found"); //$NON-NLS-1$ + throw new RestException(SC_NOT_FOUND, "Service not found"); // Find the method. java.lang.reflect.Method m = getMethods(javaInterface).get(javaMethod); if (m == null) - throw new RestException(SC_NOT_FOUND, "Method not found"); //$NON-NLS-1$ + throw new RestException(SC_NOT_FOUND, "Method not found"); // Parse the args and invoke the method. Object[] params = p.parseArgs(req.getReader(), m.getGenericParameterTypes()); http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/package.html ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/package.html b/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/package.html index 661ab91..206cf18 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/package.html +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/package.html @@ -73,17 +73,19 @@ <h2 class='topic' onclick='toggle(this)'>1 - Remoteable Services</h2> <div class='topic'> <p> - The Remoteable Service API allows for client side code to use interface proxies for - calling methods on POJOs on the server side. + The Remoteable Service API allows for client side code to use interface proxies for calling methods on POJOs on + the server side. </p> <p> - Proxy interfaces are retrieved using the {@link org.apache.juneau.rest.client.RestClient#getRemoteableProxy(Class)} method. - The remoteable servlet is a specialized subclass of {@link org.apache.juneau.rest.RestServlet} that provides a full-blown - REST interface for calling remoteable services (e.g. POJOs) remotely. + Proxy interfaces are retrieved using the {@link org.apache.juneau.rest.client.RestClient#getRemoteableProxy(Class)} + method. + The remoteable servlet is a specialized subclass of {@link org.apache.juneau.rest.RestServlet} that provides a + full-blown REST interface for calling remoteable services (e.g. POJOs) remotely. </p> <p> The following simplified example shows how a method on a POJO on a server can be called through an interface - on a client... + on a client... + </p> <p class='bcode'> <jk>public interface</jk> IAddressBook { Person createPerson(CreatePerson cp) <jk>throws</jk> Exception; @@ -115,8 +117,10 @@ The requirements for a method to be callable through the remoteable service are: </p> <ul class='spaced-list'> - <li>The method must be public. - <li>The parameter and return types must be <a href='../../../../../overview-summary.html#Core.PojoCategories'>serializable and parsable</a>. + <li> + The method must be public. + <li> + The parameter and return types must be <a href='../../../../../overview-summary.html#Core.PojoCategories'>serializable and parsable</a>. </ul> </div> @@ -125,12 +129,13 @@ <h2 class='topic' onclick='toggle(this)'>2 - Client Side</h2> <div class='topic'> <p> - Remoteable interface proxies are retrieved through the existing {@link org.apache.juneau.rest.client.RestClient} class. + Remoteable interface proxies are retrieved through the existing {@link org.apache.juneau.rest.client.RestClient} + class. </p> <p> It may seem that the client-side code would need to be complex. - In reality, it builds upon existing serializing, parsing, and REST capabilities in Juneau resulting - in very little additional code. + In reality, it builds upon existing serializing, parsing, and REST capabilities in Juneau resulting in very + little additional code. The entire code for the <code>RestClient.getRemoteableProxy(Class)</code> method is shown below: </p> <p class='bcode'> @@ -153,10 +158,9 @@ </p> <p> Since we build upon the existing <code>RestClient</code> API, we inherit all of it's features. - For example, convenience methods for setting POJO filters and properties to customize - the behavior of the serializers and parsers, and the ability to provide your own - customized Apache <code>HttpClient</code> for handling various scenarios involving - authentication and internet proxies. + For example, convenience methods for setting POJO filters and properties to customize the behavior of the + serializers and parsers, and the ability to provide your own customized Apache <code>HttpClient</code> for + handling various scenarios involving authentication and Internet proxies. </p> </div> @@ -168,16 +172,16 @@ The server side is only slightly more complex, but boasts useful debugging and discovery capabilities. </p> <p> - The {@link org.apache.juneau.rest.remoteable.RemoteableServlet} class is an implementation of {@link org.apache.juneau.rest.RestServlet} - that provides a REST interface for invoking calls on POJOs. - The <code>RemoteableServlet</code> class is abstract and must implement a single method for providing - the set of POJOs to expose as remote interfaces. + The {@link org.apache.juneau.rest.remoteable.RemoteableServlet} class is an implementation of + {@link org.apache.juneau.rest.RestServlet} that provides a REST interface for invoking calls on POJOs. + The <code>RemoteableServlet</code> class is abstract and must implement a single method for providing the set + of POJOs to expose as remote interfaces. </p> <p> - The samples bundle includes a sample implementation of a remotable service that can be used to interact with the - address book POJO also included in the bundle. + The samples bundle includes a sample implementation of a remoteable service that can be used to interact with + the address book POJO also included in the bundle. The method that must be implemented is {@link org.apache.juneau.rest.remoteable.RemoteableServlet#getServiceMap()} - that simply returns a mapping of Java interfaces (or classes) to POJO instances. + that simply returns a mapping of Java interfaces (or classes) to POJO instances. </p> <p class='bcode'> <ja>@RestResource</ja>( @@ -213,16 +217,16 @@ <p> Clicking the hyperlinks on each shows you the list of methods that can be invoked on that service. Note that the <code>IAddressBook</code> link shows that you can only invoke methods defined on that - interface, whereas the <code>AddressBook</code> link shows ALL public methods defined on that class. + interface, whereas the <code>AddressBook</code> link shows ALL public methods defined on that class. Since <code>AddressBook</code> extends from <code>LinkedList</code>, you may notice familiar collections - framework methods listed. + framework methods listed. </p> <img class='bordered' src="doc-files/2.png"> <img class='bordered' src="doc-files/3.png"> <p> - Let's see how we can interact with this interface through nothing more than REST calls - to get a better idea on how this works. - We'll use the same method call as in the introduction. + Let's see how we can interact with this interface through nothing more than REST calls to get a better idea on + how this works. + We'll use the same method call as in the introduction. First, we need to create the serialized form of the arguments: </p> <p class='bcode'> @@ -264,12 +268,13 @@ Methods are invoked by POSTing the serialized object array to the URI of the interface method. In this case, we want to POST our JSON to <code>/juneau/sample/remoteable/org.apache.juneau.examples.addressbook.IAddressBook/createPerson(org.apache.juneau.examples.addressbook.CreatePerson)</code>. Make sure that we specify the <code>Content-Type</code> of the body as <code>text/json</code>. - We also want the results to be returned as JSON, so we set the <code>Accept</code> header to <code>text/json</code> as well. + We also want the results to be returned as JSON, so we set the <code>Accept</code> header to + <code>text/json</code> as well. </p> <img class='bordered' src="doc-files/4.png"> <p> - When we execute the POST, we should see the following successful response whose body contains the returned <code>Person</code> bean - serialized to JSON: + When we execute the POST, we should see the following successful response whose body contains the returned + <code>Person</code> bean serialized to JSON: </p> <img class='bordered' src="doc-files/5.png"> <p> @@ -280,7 +285,8 @@ Person p = JsonParser.<jsf>DEFAULT</jsf>.parse(response, Person.<jk>class</jk>); </p> <p> - If we alter our servlet to allow overloaded GET requests, we can invoke methods using nothing more than a browser... + If we alter our servlet to allow overloaded GET requests, we can invoke methods using nothing more than a + browser... </p> <p class='bcode'> <ja>@RestResource</ja>( @@ -293,15 +299,18 @@ <jk>public class</jk> SampleRemoteableServlet <jk>extends</jk> RemoteableServlet { </p> <p> - For example, here we call the <code>findPerson(<jk>int</jk>)</code> method to retrieve a person and get the returned POJO - (in this case as HTML since that's what's in the <code>Accept</code> header when calling from a browser): + For example, here we call the <code>findPerson(<jk>int</jk>)</code> method to retrieve a person and get the + returned POJO (in this case as HTML since that's what's in the <code>Accept</code> header when calling from a + browser): </p> <img class='bordered' src="doc-files/6.png"> <p> - When specifying the POST body as a <code>&content</code> parameter, the method arguments should be in UON notation. + When specifying the POST body as a <code>&content</code> parameter, the method arguments should be in UON + notation. See {@link org.apache.juneau.uon.UonSerializer} for more information about this encoding. Usually you can also pass in JSON if you specify <code>&Content-Type=text/json</code> in the URL parameters - but passing in unencoded JSON in a URL may not work in all browsers. Therefore, UON is preferred. + but passing in unencoded JSON in a URL may not work in all browsers. + Therefore, UON is preferred. </p> </div> @@ -310,7 +319,8 @@ <h2 class='topic' onclick='toggle(this)'>4 - @Remoteable Annotation</h2> <div class='topic'> <p> - What if you want fine-tuned control over which methods are exposed in an interface instead of just all public methods? + What if you want fine-tuned control over which methods are exposed in an interface instead of just all public + methods? For this, the {@link org.apache.juneau.remoteable.Remoteable @Remoteable} annotation is provided. It can be applied to individual interface methods to only expose those methods through the remoteable servlet. </p> @@ -339,7 +349,8 @@ <jk>public class</jk> SampleRemoteableServlet <jk>extends</jk> RemoteableServlet { </p> <p> - The <ja>@Remoteable</ja> annotation can also be applied to the interface class to expose all public methods defined on that interface. + The <ja>@Remoteable</ja> annotation can also be applied to the interface class to expose all public methods + defined on that interface. </p> <p class='bcode'> <ja>@Remoteable</ja> http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/response/DefaultHandler.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/response/DefaultHandler.java b/juneau-rest/src/main/java/org/apache/juneau/rest/response/DefaultHandler.java index fad726e..57ecc18 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/response/DefaultHandler.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/response/DefaultHandler.java @@ -30,8 +30,8 @@ import org.apache.juneau.serializer.*; * <p> * The {@link Serializer} used is based on the <code>Accept</code> header on the request. * <p> - * The <code>Content-Type</code> header is set to the mime-type defined on the selected - * serializer based on the {@link Produces#contentType() @Produces.contentType} annotation. + * The <code>Content-Type</code> header is set to the mime-type defined on the selected serializer based on the + * {@link Produces#contentType() @Produces.contentType} annotation. */ public class DefaultHandler implements ResponseHandler { http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/response/InputStreamHandler.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/response/InputStreamHandler.java b/juneau-rest/src/main/java/org/apache/juneau/rest/response/InputStreamHandler.java index 78d3948..96ae45f 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/response/InputStreamHandler.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/response/InputStreamHandler.java @@ -22,7 +22,8 @@ import org.apache.juneau.utils.*; * <p> * Simply pipes the contents of the {@link InputStream} to {@link RestResponse#getNegotiatedOutputStream()}. * <p> - * Sets the <code>Content-Type</code> response header to whatever was set via {@link RestResponse#setContentType(String)}. + * Sets the <code>Content-Type</code> response header to whatever was set via + * {@link RestResponse#setContentType(String)}. */ public final class InputStreamHandler implements ResponseHandler { http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/response/StreamableHandler.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/response/StreamableHandler.java b/juneau-rest/src/main/java/org/apache/juneau/rest/response/StreamableHandler.java index 4eed2fe..f454fa6 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/response/StreamableHandler.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/response/StreamableHandler.java @@ -22,7 +22,8 @@ import org.apache.juneau.rest.*; /** * Response handler for {@link Writable} and {@link ReaderResource} objects. * <p> - * Uses the {@link Writable#writeTo(Writer)} method to send the contents to the {@link RestResponse#getNegotiatedWriter()} writer. + * Uses the {@link Writable#writeTo(Writer)} method to send the contents to the + * {@link RestResponse#getNegotiatedWriter()} writer. */ public final class StreamableHandler implements ResponseHandler { http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/response/WritableHandler.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/response/WritableHandler.java b/juneau-rest/src/main/java/org/apache/juneau/rest/response/WritableHandler.java index 927fb82..4f1e9e7 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/response/WritableHandler.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/response/WritableHandler.java @@ -22,7 +22,8 @@ import org.apache.juneau.rest.*; /** * Response handler for {@link Writable} and {@link ReaderResource} objects. * <p> - * Uses the {@link Writable#writeTo(Writer)} method to send the contents to the {@link RestResponse#getNegotiatedWriter()} writer. + * Uses the {@link Writable#writeTo(Writer)} method to send the contents to the + * {@link RestResponse#getNegotiatedWriter()} writer. */ public final class WritableHandler implements ResponseHandler { http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/response/ZipFileListResponseHandler.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/response/ZipFileListResponseHandler.java b/juneau-rest/src/main/java/org/apache/juneau/rest/response/ZipFileListResponseHandler.java index 32c8742..bdbf32e 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/response/ZipFileListResponseHandler.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/response/ZipFileListResponseHandler.java @@ -27,9 +27,11 @@ import org.apache.juneau.utils.ZipFileList.*; * <p> * Sets the following headers: * <ul class='spaced-list'> - * <li><code>Content-Type</code> - <code>application/zip</code> - * <li><code>Content-Disposition=attachment;filename=X</code> - Sets X to the file name passed in through - * the constructor {@link ZipFileList#ZipFileList(String)}. + * <li> + * <code>Content-Type</code> - <code>application/zip</code> + * <li> + * <code>Content-Disposition=attachment;filename=X</code> - Sets X to the file name passed in through the + * constructor {@link ZipFileList#ZipFileList(String)}. * </ul> */ public class ZipFileListResponseHandler implements ResponseHandler { @@ -38,8 +40,8 @@ public class ZipFileListResponseHandler implements ResponseHandler { public boolean handle(RestRequest req, RestResponse res, Object output) throws IOException, RestException { if (output.getClass() == ZipFileList.class) { ZipFileList m = (ZipFileList)output; - res.setContentType("application/zip"); //$NON-NLS-1$ - res.setHeader("Content-Disposition", "attachment;filename=" + m.fileName); //$NON-NLS-1$ //$NON-NLS-2$ + res.setContentType("application/zip"); + res.setHeader("Content-Disposition", "attachment;filename=" + m.fileName); //$NON-NLS-2$ OutputStream os = res.getOutputStream(); try { ZipOutputStream zos = new ZipOutputStream(os); http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/vars/LocalizationVar.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/LocalizationVar.java b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/LocalizationVar.java index 341c3cf..c7ecad1 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/LocalizationVar.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/LocalizationVar.java @@ -23,7 +23,7 @@ import org.apache.juneau.svl.*; * The format for this var is <js>"$L{key}"</js> or <js>"$L{key,args...}"</js>. * <p> * This variable resolver requires that a {@link RestRequest} object be set as a context object on the resolver or a - * session object on the resolver session. + * session object on the resolver session. * <p> * Values are pulled from the {@link RestRequest#getMessage(String,Object[])} method. * These in turn are pulled from the resource bundle associated with the servlet class where the request was made. http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/vars/RequestVar.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/RequestVar.java b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/RequestVar.java index 3764cf8..c6e8e22 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/RequestVar.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/RequestVar.java @@ -37,7 +37,7 @@ import org.apache.juneau.svl.*; * </ul> * <p> * This variable resolver requires that a {@link RestRequest} object be set as a context object on the resolver or a - * session object on the resolver session. + * session object on the resolver session. * <p> * Since this is a {@link SimpleVar}, any variables contained in the result will be recursively resolved. * Likewise, if the arguments contain any variables, those will be resolved before they are passed to this var. http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/vars/ServletInitParamVar.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/ServletInitParamVar.java b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/ServletInitParamVar.java index b141695..017d69a 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/ServletInitParamVar.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/ServletInitParamVar.java @@ -21,7 +21,7 @@ import org.apache.juneau.svl.*; * The format for this var is <js>"$I{key}"</js> or <js>"$I{key,defaultValue}"</js>. * <p> * This variable resolver requires that a {@link RestRequest} object be set as a context object on the resolver or a - * session object on the resolver session. + * session object on the resolver session. * <p> * Values are pulled from the {@link RestServlet#getInitParameter(String)} method. * <p> http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/vars/UrlEncodeVar.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/UrlEncodeVar.java b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/UrlEncodeVar.java index 6fa7f5f..13cc05b 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/UrlEncodeVar.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/UrlEncodeVar.java @@ -22,7 +22,8 @@ import org.apache.juneau.svl.*; * <p> * The format for this var is <js>"$UE{innerValue}"</js>. * <p> - * This variable takes the contents inside the variable and replaces it with a value returned by calling {@link StringUtils#urlEncode(String)}). + * This variable takes the contents inside the variable and replaces it with a value returned by calling + * {@link StringUtils#urlEncode(String)}). * <p> * Since this is a {@link SimpleVar}, any variables contained in the result will be recursively resolved. * Likewise, if the arguments contain any variables, those will be resolved before they are passed to this var. http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/vars/UrlVar.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/UrlVar.java b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/UrlVar.java index 065978b..5e3692d 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/UrlVar.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/UrlVar.java @@ -20,7 +20,8 @@ import org.apache.juneau.svl.*; /** * Resolver for resolving URL variables <js>"$U{name}"</js>. * <p> - * The advantage of using this variable is that you can resolve URLs with special protocols such as <js>"servlet:/xxx"</js>. + * The advantage of using this variable is that you can resolve URLs with special protocols such as + * <js>"servlet:/xxx"</js>. * <p> * See {@link UriResolver} for the kinds of URIs that can be resolved. * <ul> @@ -30,7 +31,7 @@ import org.apache.juneau.svl.*; * </ul> * <p> * Uses the URI resolver returned by {@link RestRequest#getUriResolver(UriResolution, UriRelativity)} with resolution - * {@link UriResolution#ROOT_RELATIVE} and relativity {@link UriRelativity#RESOURCE}. + * {@link UriResolution#ROOT_RELATIVE} and relativity {@link UriRelativity#RESOURCE}. * * @see org.apache.juneau.svl */ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/vars/WidgetVar.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/WidgetVar.java b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/WidgetVar.java index 3c73f8d..96b16d8 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/WidgetVar.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/WidgetVar.java @@ -38,7 +38,9 @@ public class WidgetVar extends SimpleVar { */ public static final String SESSION_req = "req"; - /** The name of this variable. */ + /** + * The name of this variable. + */ public static final String NAME = "W"; /** http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/widget/QueryWidget.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/widget/QueryWidget.java b/juneau-rest/src/main/java/org/apache/juneau/rest/widget/QueryWidget.java index c21aa21..fcfba72 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/widget/QueryWidget.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/widget/QueryWidget.java @@ -20,7 +20,7 @@ import org.apache.juneau.rest.converters.*; * Adds a <code>QUERY</code> link to the page that allows you to perform search/view/sort/paging on the page data. * <p> * A typical usage of the query widget is to include it as a navigation link as shown in the example below - * pulled from the <code>PetStoreResource</code> example: + * pulled from the <code>PetStoreResource</code> example: * <p class='bcode'> * <ja>@RestResource</ja>( * widgets={ @@ -32,8 +32,8 @@ import org.apache.juneau.rest.converters.*; * ) * </p> * <p> - * In the above example, this adds a <code>QUERY</code> that displays a search popup that can be used for - * filtering the page results... + * In the above example, this adds a <code>QUERY</code> that displays a search popup that can be used for filtering the + * page results... * <p> * <img class='bordered' src='doc-files/PetStore_Query.png'> * <p> @@ -47,7 +47,7 @@ import org.apache.juneau.rest.converters.*; * The search arguments can be retrieved programmatically using {@link RequestQuery#getSearchArgs()}. * <p> * Typically, the search functionality is implemented by applying the predefined {@link Queryable} converter on the - * method that's returning a 2-dimensional table of POJOs that you wish to filter: + * method that's returning a 2-dimensional table of POJOs that you wish to filter: * <p class='bcode'> * <ja>@RestMethod</ja>( * name=<js>"GET"</js>, http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/0d913b38/juneau-rest/src/main/java/org/apache/juneau/rest/widget/Widget.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/widget/Widget.java b/juneau-rest/src/main/java/org/apache/juneau/rest/widget/Widget.java index ec52998..281636a 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/widget/Widget.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/widget/Widget.java @@ -29,13 +29,15 @@ public abstract class Widget { /** * The widget key (i.e. The contents of the <js>"$W{...}"</js> variable). + * * @return The widget key. - * Must not be <jk>null</jk>. + * Must not be <jk>null</jk>. */ public abstract String getName(); /** * Resolves the value for the variable. + * * @param req The HTTP request object. * @return The resolved value. * @throws Exception
