http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/1b5bde65/content/site/apidocs/org/apache/juneau/UriContext.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/org/apache/juneau/UriContext.html b/content/site/apidocs/org/apache/juneau/UriContext.html index 4720001..120c281 100644 --- a/content/site/apidocs/org/apache/juneau/UriContext.html +++ b/content/site/apidocs/org/apache/juneau/UriContext.html @@ -109,9 +109,10 @@ var activeTableTab = "activeTableTab"; <hr> <br> <pre><a href="../../../org/apache/juneau/annotation/Bean.html" title="annotation in org.apache.juneau.annotation">@Bean</a> -public class <a href="../../../src-html/org/apache/juneau/UriContext.html#line.33">UriContext</a> +public class <a href="../../../src-html/org/apache/juneau/UriContext.html#line.35">UriContext</a> extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> <div class="block">Represents a URL broken into authority/context-root/servlet-path/path-info parts. + <p> A typical request against a URL takes the following form: <p class='bcode'> @@ -119,6 +120,7 @@ extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html? | authority | context | resource | path | +--------------------------------------------------+ </p> + <p> This class allows you to convert URL strings to absolute (e.g. <js>"http://host:port/foo/bar"</js>) or root-relative (e.g. <js>"/foo/bar"</js>) URLs.</div> @@ -282,8 +284,10 @@ extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html? <ul class="blockListLast"> <li class="blockList"> <h4>DEFAULT</h4> -<pre>public static final <a href="../../../org/apache/juneau/UriContext.html" title="class in org.apache.juneau">UriContext</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.39">DEFAULT</a></pre> +<pre>public static final <a href="../../../org/apache/juneau/UriContext.html" title="class in org.apache.juneau">UriContext</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.43">DEFAULT</a></pre> <div class="block">Default URI context. + + <p> No information about authority, servlet-root, context-root, or path-info is known.</div> </li> </ul> @@ -302,22 +306,23 @@ extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html? <li class="blockList"> <h4>UriContext</h4> <pre><a href="../../../org/apache/juneau/annotation/BeanConstructor.html" title="annotation in org.apache.juneau.annotation">@BeanConstructor</a>(<a href="../../../org/apache/juneau/annotation/BeanConstructor.html#properties--">properties</a>="authority,contextRoot,servletPath,pathInfo") -public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60">UriContext</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> authority, +public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.69">UriContext</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> authority, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> contextRoot, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> servletPath, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> pathInfo)</pre> <div class="block">Constructor. + <p> Leading and trailing slashes are trimmed of all parameters. + <p> Any parameter can be <jk>null</jk>. Blanks and nulls are equivalent.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> -<dd><code>authority</code> - - The authority portion of URL (e.g. <js>"http://hostname:port"</js>)</dd> -<dd><code>contextRoot</code> - - The context root of the application (e.g. <js>"/context-root"</js>, or - <js>"context-root"</js>)</dd> -<dd><code>servletPath</code> - - The servlet path (e.g. <js>"/servlet-path"</js>, or <js>"servlet-path"</js>)</dd> -<dd><code>pathInfo</code> - - The path info (e.g. <js>"/path-info"</js>, or <js>"path-info"</js>)</dd> +<dd><code>authority</code> - The authority portion of URL (e.g. <js>"http://hostname:port"</js>)</dd> +<dd><code>contextRoot</code> - The context root of the application (e.g. <js>"/context-root"</js>, or <js>"context-root"</js>)</dd> +<dd><code>servletPath</code> - The servlet path (e.g. <js>"/servlet-path"</js>, or <js>"servlet-path"</js>)</dd> +<dd><code>pathInfo</code> - The path info (e.g. <js>"/path-info"</js>, or <js>"path-info"</js>)</dd> </dl> </li> </ul> @@ -327,8 +332,10 @@ public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60 <ul class="blockListLast"> <li class="blockList"> <h4>UriContext</h4> -<pre>public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.73">UriContext</a>()</pre> +<pre>public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.84">UriContext</a>()</pre> <div class="block">Default constructor. + + <p> All <jk>null</jk> values.</div> </li> </ul> @@ -346,10 +353,12 @@ public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60 <ul class="blockList"> <li class="blockList"> <h4>getAbsoluteAuthority</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.87">getAbsoluteAuthority</a>()</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.101">getAbsoluteAuthority</a>()</pre> <div class="block">Returns the absolute URI of just the authority portion of this URI context. + <p> Example: <js>"http://hostname:port"</js> + <p> If the authority is null/empty, returns <js>"/"</js>.</div> <dl> @@ -365,8 +374,9 @@ public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60 <ul class="blockList"> <li class="blockList"> <h4>getAbsoluteContextRoot</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.99">getAbsoluteContextRoot</a>()</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.115">getAbsoluteContextRoot</a>()</pre> <div class="block">Returns the absolute URI of the context-root portion of this URI context. + <p> Example: <js>"http://hostname:port/context-root"</js></div> <dl> @@ -382,8 +392,9 @@ public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60 <ul class="blockList"> <li class="blockList"> <h4>getRootRelativeContextRoot</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.121">getRootRelativeContextRoot</a>()</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.139">getRootRelativeContextRoot</a>()</pre> <div class="block">Returns the root-relative URI of the context portion of this URI context. + <p> Example: <js>"/context-root"</js></div> <dl> @@ -399,8 +410,9 @@ public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60 <ul class="blockList"> <li class="blockList"> <h4>getAbsoluteServletPath</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.135">getAbsoluteServletPath</a>()</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.155">getAbsoluteServletPath</a>()</pre> <div class="block">Returns the absolute URI of the resource portion of this URI context. + <p> Example: <js>"http://hostname:port/context-root/servlet-path"</js></div> <dl> @@ -416,8 +428,9 @@ public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60 <ul class="blockList"> <li class="blockList"> <h4>getRootRelativeServletPath</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.165">getRootRelativeServletPath</a>()</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.187">getRootRelativeServletPath</a>()</pre> <div class="block">Returns the root-relative URI of the resource portion of this URI context. + <p> Example: <js>"/context-root/servlet-path"</js></div> <dl> @@ -433,7 +446,7 @@ public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60 <ul class="blockList"> <li class="blockList"> <h4>getAbsoluteServletPathParent</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.188">getAbsoluteServletPathParent</a>()</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.210">getAbsoluteServletPathParent</a>()</pre> <div class="block">Returns the parent of the URL returned by <a href="../../../org/apache/juneau/UriContext.html#getAbsoluteServletPath--"><code>getAbsoluteServletPath()</code></a>.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> @@ -447,7 +460,7 @@ public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60 <ul class="blockList"> <li class="blockList"> <h4>getRootRelativeServletPathParent</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.197">getRootRelativeServletPathParent</a>()</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.219">getRootRelativeServletPathParent</a>()</pre> <div class="block">Returns the parent of the URL returned by <a href="../../../org/apache/juneau/UriContext.html#getRootRelativeServletPath--"><code>getRootRelativeServletPath()</code></a>.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> @@ -461,8 +474,9 @@ public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60 <ul class="blockList"> <li class="blockList"> <h4>getAbsolutePathInfo</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.209">getAbsolutePathInfo</a>()</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.233">getAbsolutePathInfo</a>()</pre> <div class="block">Returns the absolute URI of the path portion of this URI context. + <p> Example: <js>"http://hostname:port/context-root/servlet-path/path-info"</js></div> <dl> @@ -478,8 +492,9 @@ public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60 <ul class="blockList"> <li class="blockList"> <h4>getRootRelativePathInfo</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.253">getRootRelativePathInfo</a>()</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.279">getRootRelativePathInfo</a>()</pre> <div class="block">Returns the root-relative URI of the path portion of this URI context. + <p> Example: <js>"/context-root/servlet-path/path-info"</js></div> <dl> @@ -495,7 +510,7 @@ public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60 <ul class="blockList"> <li class="blockList"> <h4>getAbsolutePathInfoParent</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.291">getAbsolutePathInfoParent</a>()</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.317">getAbsolutePathInfoParent</a>()</pre> <div class="block">Returns the parent of the URL returned by <a href="../../../org/apache/juneau/UriContext.html#getAbsolutePathInfo--"><code>getAbsolutePathInfo()</code></a>.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> @@ -509,7 +524,7 @@ public <a href="../../../src-html/org/apache/juneau/UriContext.html#line.60 <ul class="blockListLast"> <li class="blockList"> <h4>getRootRelativePathInfoParent</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.300">getRootRelativePathInfoParent</a>()</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriContext.html#line.326">getRootRelativePathInfoParent</a>()</pre> <div class="block">Returns the parent of the URL returned by <a href="../../../org/apache/juneau/UriContext.html#getRootRelativePathInfo--"><code>getRootRelativePathInfo()</code></a>.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt>
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/1b5bde65/content/site/apidocs/org/apache/juneau/UriResolver.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/org/apache/juneau/UriResolver.html b/content/site/apidocs/org/apache/juneau/UriResolver.html index 15000a4..aedd49d 100644 --- a/content/site/apidocs/org/apache/juneau/UriResolver.html +++ b/content/site/apidocs/org/apache/juneau/UriResolver.html @@ -108,19 +108,21 @@ var activeTableTab = "activeTableTab"; <li class="blockList"> <hr> <br> -<pre>public class <a href="../../../src-html/org/apache/juneau/UriResolver.html#line.51">UriResolver</a> +<pre>public class <a href="../../../src-html/org/apache/juneau/UriResolver.html#line.53">UriResolver</a> extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> <div class="block">Class used to create absolute and root-relative URIs based on your current URI 'location' and rules about how to make such resolutions. + <p> Combines a <a href="../../../org/apache/juneau/UriContext.html" title="class in org.apache.juneau"><code>UriContext</code></a> instance with rules for resolution (<a href="../../../org/apache/juneau/UriResolution.html" title="enum in org.apache.juneau"><code>UriResolution</code></a> and relativity - (<a href="../../../org/apache/juneau/UriRelativity.html" title="enum in org.apache.juneau"><code>UriRelativity</code></a>) to define simple <a href="../../../org/apache/juneau/UriResolver.html#resolve-java.lang.Object-"><code>resolve(Object)</code></a> and <a href="../../../org/apache/juneau/UriResolver.html#append-java.lang.Appendable-java.lang.Object-"><code>append(Appendable, Object)</code></a> - methods. + (<a href="../../../org/apache/juneau/UriRelativity.html" title="enum in org.apache.juneau"><code>UriRelativity</code></a>) to define simple <a href="../../../org/apache/juneau/UriResolver.html#resolve-java.lang.Object-"><code>resolve(Object)</code></a> and <a href="../../../org/apache/juneau/UriResolver.html#append-java.lang.Appendable-java.lang.Object-"><code>append(Appendable, Object)</code></a> methods. + <p> Three special protocols are used to represent context-root-relative, servlet-relative, and request-path-relative URIs: <js>"context:/"</js>, <js>"servlet:/"</js>, and <js>"request:/"</js>. + <p> The following list shows the protocols of URLs that can be resolved with this class: <ul> <li><js>"foo://foo"</js> - Absolute URI. @@ -222,7 +224,7 @@ extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html? <ul class="blockListLast"> <li class="blockList"> <h4>UriResolver</h4> -<pre>public <a href="../../../src-html/org/apache/juneau/UriResolver.html#line.64">UriResolver</a>(<a href="../../../org/apache/juneau/UriResolution.html" title="enum in org.apache.juneau">UriResolution</a> resolution, +<pre>public <a href="../../../src-html/org/apache/juneau/UriResolver.html#line.66">UriResolver</a>(<a href="../../../org/apache/juneau/UriResolution.html" title="enum in org.apache.juneau">UriResolution</a> resolution, <a href="../../../org/apache/juneau/UriRelativity.html" title="enum in org.apache.juneau">UriRelativity</a> relativity, <a href="../../../org/apache/juneau/UriContext.html" title="class in org.apache.juneau">UriContext</a> uriContext)</pre> <div class="block">Constructor.</div> @@ -248,7 +250,7 @@ extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html? <ul class="blockList"> <li class="blockList"> <h4>resolve</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriResolver.html#line.100">resolve</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> uri)</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriResolver.html#line.103">resolve</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> uri)</pre> <div class="block">Converts the specified URI to absolute form based on values in this context.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> @@ -284,12 +286,14 @@ extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html? <ul class="blockList"> <li class="blockList"> <h4>relativize</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriResolver.html#line.131">relativize</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> relativeTo, +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../src-html/org/apache/juneau/UriResolver.html#line.136">relativize</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> relativeTo, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> uri)</pre> <div class="block">Relativizes a URI. + <p> - Similar to <a href="http://docs.oracle.com/javase/7/docs/api/java/net/URI.html?is-external=true#relativize-java.net.URI-" title="class or interface in java.net"><code>URI.relativize(URI)</code></a>, except supports special protocols (e.g. <js>"servlet:/"</js>) for - both the <code>relativeTo</code> and <code>uri</code> parameters. + Similar to <a href="http://docs.oracle.com/javase/7/docs/api/java/net/URI.html?is-external=true#relativize-java.net.URI-" title="class or interface in java.net"><code>URI.relativize(URI)</code></a>, except supports special protocols (e.g. <js>"servlet:/"</js>) for both + the <code>relativeTo</code> and <code>uri</code> parameters. + <p> For example, to relativize a URI to its servlet-relative form: <p class='bcode'> @@ -311,7 +315,7 @@ extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html? <ul class="blockListLast"> <li class="blockList"> <h4>append</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</a> <a href="../../../src-html/org/apache/juneau/UriResolver.html#line.144">append</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</a> a, +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</a> <a href="../../../src-html/org/apache/juneau/UriResolver.html#line.149">append</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</a> a, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o)</pre> <div class="block">Same as <a href="../../../org/apache/juneau/UriResolver.html#resolve-java.lang.Object-"><code>resolve(Object)</code></a> except appends result to the specified appendable.</div> <dl> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/1b5bde65/content/site/apidocs/org/apache/juneau/Visibility.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/org/apache/juneau/Visibility.html b/content/site/apidocs/org/apache/juneau/Visibility.html index 1de8dc6..37c91fc 100644 --- a/content/site/apidocs/org/apache/juneau/Visibility.html +++ b/content/site/apidocs/org/apache/juneau/Visibility.html @@ -117,11 +117,14 @@ var activeTableTab = "activeTableTab"; </dl> <hr> <br> -<pre>public enum <a href="../../../src-html/org/apache/juneau/Visibility.html#line.29">Visibility</a> +<pre>public enum <a href="../../../src-html/org/apache/juneau/Visibility.html#line.32">Visibility</a> extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a><<a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a>></pre> <div class="block">Defines class/field/method visibilities. + <p> Used to specify minimum levels of visibility when detecting bean classes, methods, and fields. + + <p> Used in conjunction with the following bean context properties: <ul> <li><a href="../../../org/apache/juneau/BeanContext.html#BEAN_beanConstructorVisibility"><code>BeanContext.BEAN_beanConstructorVisibility</code></a> @@ -294,7 +297,7 @@ the order they are declared.</div> <ul class="blockList"> <li class="blockList"> <h4>NONE</h4> -<pre>public static final <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.32">NONE</a></pre> +<pre>public static final <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.35">NONE</a></pre> <div class="block">Ignore all</div> </li> </ul> @@ -304,7 +307,7 @@ the order they are declared.</div> <ul class="blockList"> <li class="blockList"> <h4>PUBLIC</h4> -<pre>public static final <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.35">PUBLIC</a></pre> +<pre>public static final <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.38">PUBLIC</a></pre> <div class="block">Include only <jk>public</jk> classes/fields/methods.</div> </li> </ul> @@ -314,7 +317,7 @@ the order they are declared.</div> <ul class="blockList"> <li class="blockList"> <h4>PROTECTED</h4> -<pre>public static final <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.38">PROTECTED</a></pre> +<pre>public static final <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.41">PROTECTED</a></pre> <div class="block">Include only <jk>public</jk> or <jk>protected</jk> classes/fields/methods.</div> </li> </ul> @@ -324,7 +327,7 @@ the order they are declared.</div> <ul class="blockList"> <li class="blockList"> <h4>DEFAULT</h4> -<pre>public static final <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.41">DEFAULT</a></pre> +<pre>public static final <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.44">DEFAULT</a></pre> <div class="block">Include all but <jk>private</jk> classes/fields/methods.</div> </li> </ul> @@ -334,7 +337,7 @@ the order they are declared.</div> <ul class="blockListLast"> <li class="blockList"> <h4>PRIVATE</h4> -<pre>public static final <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.44">PRIVATE</a></pre> +<pre>public static final <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.47">PRIVATE</a></pre> <div class="block">Include all classes/fields/methods.</div> </li> </ul> @@ -352,7 +355,7 @@ the order they are declared.</div> <ul class="blockList"> <li class="blockList"> <h4>values</h4> -<pre>public static <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a>[] <a href="../../../src-html/org/apache/juneau/Visibility.html#line.21">values</a>()</pre> +<pre>public static <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a>[] <a href="../../../src-html/org/apache/juneau/Visibility.html#line.22">values</a>()</pre> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows: @@ -372,7 +375,7 @@ for (Visibility c : Visibility.values()) <ul class="blockList"> <li class="blockList"> <h4>valueOf</h4> -<pre>public static <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.21">valueOf</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</pre> +<pre>public static <a href="../../../org/apache/juneau/Visibility.html" title="enum in org.apache.juneau">Visibility</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.22">valueOf</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</pre> <div class="block">Returns the enum constant of this type with the specified name. The string must match <i>exactly</i> an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are @@ -394,7 +397,7 @@ not permitted.)</div> <ul class="blockList"> <li class="blockList"> <h4>isVisible</h4> -<pre>public boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.60">isVisible</a>(int mod)</pre> +<pre>public boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.63">isVisible</a>(int mod)</pre> <div class="block">Identifies if the specified mod matches this visibility. <h5 class='section'>Example:</h5> @@ -418,7 +421,7 @@ not permitted.)</div> <ul class="blockList"> <li class="blockList"> <h4>isVisible</h4> -<pre>public boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.76">isVisible</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Constructor.html?is-external=true" title="class or interface in java.lang.reflect">Constructor</a><?> x)</pre> +<pre>public boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.79">isVisible</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Constructor.html?is-external=true" title="class or interface in java.lang.reflect">Constructor</a><?> x)</pre> <div class="block">Shortcut for <code>isVisible(x.getModifiers());</code></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> @@ -434,7 +437,7 @@ not permitted.)</div> <ul class="blockList"> <li class="blockList"> <h4>isVisible</h4> -<pre>public boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.86">isVisible</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> x)</pre> +<pre>public boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.89">isVisible</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> x)</pre> <div class="block">Shortcut for <code>isVisible(x.getModifiers());</code></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> @@ -450,7 +453,7 @@ not permitted.)</div> <ul class="blockList"> <li class="blockList"> <h4>isVisible</h4> -<pre>public boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.96">isVisible</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Field.html?is-external=true" title="class or interface in java.lang.reflect">Field</a> x)</pre> +<pre>public boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.99">isVisible</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Field.html?is-external=true" title="class or interface in java.lang.reflect">Field</a> x)</pre> <div class="block">Shortcut for <code>isVisible(x.getModifiers());</code></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> @@ -466,8 +469,10 @@ not permitted.)</div> <ul class="blockList"> <li class="blockList"> <h4>transform</h4> -<pre>public <T> <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Constructor.html?is-external=true" title="class or interface in java.lang.reflect">Constructor</a><T> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.108">transform</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Constructor.html?is-external=true" title="class or interface in java.lang.reflect">Constructor</a><T> x)</pre> +<pre>public <T> <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Constructor.html?is-external=true" title="class or interface in java.lang.reflect">Constructor</a><T> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.114">transform</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Constructor.html?is-external=true" title="class or interface in java.lang.reflect">Constructor</a><T> x)</pre> <div class="block">Makes constructor accessible if it matches the visibility requirements, or returns <jk>null</jk> if it doesn't. + + <p> Security exceptions thrown on the call to <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/AccessibleObject.html?is-external=true#setAccessible-boolean-" title="class or interface in java.lang.reflect"><code>AccessibleObject.setAccessible(boolean)</code></a> are quietly ignored.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> @@ -484,8 +489,10 @@ not permitted.)</div> <ul class="blockList"> <li class="blockList"> <h4>transform</h4> -<pre>public <T> <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.125">transform</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> x)</pre> +<pre>public <T> <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.134">transform</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> x)</pre> <div class="block">Makes method accessible if it matches the visibility requirements, or returns <jk>null</jk> if it doesn't. + + <p> Security exceptions thrown on the call to <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/AccessibleObject.html?is-external=true#setAccessible-boolean-" title="class or interface in java.lang.reflect"><code>AccessibleObject.setAccessible(boolean)</code></a> are quietly ignored.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> @@ -502,8 +509,10 @@ not permitted.)</div> <ul class="blockList"> <li class="blockList"> <h4>transform</h4> -<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Field.html?is-external=true" title="class or interface in java.lang.reflect">Field</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.142">transform</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Field.html?is-external=true" title="class or interface in java.lang.reflect">Field</a> x)</pre> +<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Field.html?is-external=true" title="class or interface in java.lang.reflect">Field</a> <a href="../../../src-html/org/apache/juneau/Visibility.html#line.154">transform</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Field.html?is-external=true" title="class or interface in java.lang.reflect">Field</a> x)</pre> <div class="block">Makes field accessible if it matches the visibility requirements, or returns <jk>null</jk> if it doesn't. + + <p> Security exceptions thrown on the call to <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/AccessibleObject.html?is-external=true#setAccessible-boolean-" title="class or interface in java.lang.reflect"><code>AccessibleObject.setAccessible(boolean)</code></a> are quietly ignored.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> @@ -520,7 +529,7 @@ not permitted.)</div> <ul class="blockList"> <li class="blockList"> <h4>setAccessible</h4> -<pre>public static boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.157">setAccessible</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Constructor.html?is-external=true" title="class or interface in java.lang.reflect">Constructor</a><?> x)</pre> +<pre>public static boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.169">setAccessible</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Constructor.html?is-external=true" title="class or interface in java.lang.reflect">Constructor</a><?> x)</pre> <div class="block">Attempts to call <code>x.setAccessible(<jk>true</jk>)</code> and quietly ignores security exceptions.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> @@ -536,7 +545,7 @@ not permitted.)</div> <ul class="blockList"> <li class="blockList"> <h4>setAccessible</h4> -<pre>public static boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.173">setAccessible</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> x)</pre> +<pre>public static boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.185">setAccessible</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a> x)</pre> <div class="block">Attempts to call <code>x.setAccessible(<jk>true</jk>)</code> and quietly ignores security exceptions.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> @@ -552,7 +561,7 @@ not permitted.)</div> <ul class="blockListLast"> <li class="blockList"> <h4>setAccessible</h4> -<pre>public static boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.189">setAccessible</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Field.html?is-external=true" title="class or interface in java.lang.reflect">Field</a> x)</pre> +<pre>public static boolean <a href="../../../src-html/org/apache/juneau/Visibility.html#line.201">setAccessible</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Field.html?is-external=true" title="class or interface in java.lang.reflect">Field</a> x)</pre> <div class="block">Attempts to call <code>x.setAccessible(<jk>true</jk>)</code> and quietly ignores security exceptions.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/1b5bde65/content/site/apidocs/org/apache/juneau/Writable.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/org/apache/juneau/Writable.html b/content/site/apidocs/org/apache/juneau/Writable.html index 6a96f27..041fde6 100644 --- a/content/site/apidocs/org/apache/juneau/Writable.html +++ b/content/site/apidocs/org/apache/juneau/Writable.html @@ -106,9 +106,9 @@ var activeTableTab = "activeTableTab"; <br> <pre>public interface <a href="../../../src-html/org/apache/juneau/Writable.html#line.25">Writable</a></pre> <div class="block">Interface that identifies that an object can be serialized directly to a writer. + <p> - Instances must identify the media type of the content by implementing the - <a href="../../../org/apache/juneau/Writable.html#getMediaType--"><code>getMediaType()</code></a> method.</div> + Instances must identify the media type of the content by implementing the <a href="../../../org/apache/juneau/Writable.html#getMediaType--"><code>getMediaType()</code></a> method.</div> </li> </ul> </div> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/1b5bde65/content/site/apidocs/org/apache/juneau/annotation/Bean.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/org/apache/juneau/annotation/Bean.html b/content/site/apidocs/org/apache/juneau/annotation/Bean.html index a4ad573..fe29cab 100644 --- a/content/site/apidocs/org/apache/juneau/annotation/Bean.html +++ b/content/site/apidocs/org/apache/juneau/annotation/Bean.html @@ -96,15 +96,20 @@ <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation">@Target</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Target.html?is-external=true#value--" title="class or interface in java.lang.annotation">value</a>=<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/ElementType.html?is-external=true#TYPE" title="class or interface in java.lang.annotation">TYPE</a>) <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation">@Retention</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Retention.html?is-external=true#value--" title="class or interface in java.lang.annotation">value</a>=<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation">RUNTIME</a>) <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Inherited.html?is-external=true" title="class or interface in java.lang.annotation">@Inherited</a> -public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.40">Bean</a></pre> +public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.45">Bean</a></pre> <div class="block">Used to tailor how beans get interpreted by the framework. + <p> Can be used to do the following: <ul class='spaced-list'> - <li>Explicitly specify the set and order of properties on a bean. - <li>Associate a <a href="../../../../org/apache/juneau/PropertyNamer.html" title="interface in org.apache.juneau"><code>PropertyNamer</code></a> with a class. - <li>Specify subtypes of a bean differentiated by a sub type property. + <li> + Explicitly specify the set and order of properties on a bean. + <li> + Associate a <a href="../../../../org/apache/juneau/PropertyNamer.html" title="interface in org.apache.juneau"><code>PropertyNamer</code></a> with a class. + <li> + Specify subtypes of a bean differentiated by a sub type property. </ul> + <p> This annotation can be applied to classes and interfaces.</div> </li> @@ -128,8 +133,8 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <tr class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?>[]</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/juneau/annotation/Bean.html#beanDictionary--">beanDictionary</a></span></code> -<div class="block">The list of classes that make up the bean dictionary for all properties of this bean - or for subclasses of this bean.</div> +<div class="block">The list of classes that make up the bean dictionary for all properties of this bean or for subclasses of this + bean.</div> </td> </tr> <tr class="rowColor"> @@ -201,17 +206,21 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>typeName</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.92">typeName</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.101">typeName</a></pre> <div class="block">An identifying name for this class. + <p> The name is used to identify the class type during parsing when it cannot be inferred through reflection. For example, if a bean property is of type <code>Object</code>, then the serializer will add the name to the - output so that the class can be determined during parsing. + output so that the class can be determined during parsing. It is also used to specify element names in XML. + <p> The name is used in combination with the bean dictionary defined through <a href="../../../../org/apache/juneau/annotation/BeanProperty.html#beanDictionary--"><code>BeanProperty.beanDictionary()</code></a> or - <a href="../../../../org/apache/juneau/BeanContext.html#BEAN_beanDictionary"><code>BeanContext.BEAN_beanDictionary</code></a>. Together, they make up a simple name/value mapping of names to classes. - Names do not need to be universally unique. However, they must be unique within a dictionary. + <a href="../../../../org/apache/juneau/BeanContext.html#BEAN_beanDictionary"><code>BeanContext.BEAN_beanDictionary</code></a>. + Together, they make up a simple name/value mapping of names to classes. + Names do not need to be universally unique. + However, they must be unique within a dictionary. <h5 class='section'>Example:</h5> <p class='bcode'> @@ -228,9 +237,9 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ja>@Bean</ja>(typeName=<js>"baz"</js>) <jk>public class</jk> Baz {} </p> + <p> When serialized as XML, the bean is rendered as: - </p> <p class='bcode'> <xt><foo></xt> <xt><x></xt> @@ -239,9 +248,9 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <xt></x></xt> <xt></foo></xt> </p> + <p> When serialized as JSON, <js>'n'</js> attributes would be added when needed to infer the type during parsing: - </p> <p class='bcode'> { x: [ @@ -265,11 +274,13 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>typePropertyName</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.129">typePropertyName</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.141">typePropertyName</a></pre> <div class="block">The property name to use for representing the type name. + <p> This can be used to override the name used for the <js>"_type"</js> property designated above. Typically, you'll define this on an interface class so that it can apply to all subclasses. + <p class='bcode'> <ja>@Bean</ja>(typePropertyName=<js>"mytype"</js>, beanDictionary={MyClass1.<jk>class</jk>,MyClass2.<jk>class</jk>}) <jk>public interface</jk> MyInterface {...} @@ -285,6 +296,7 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <jc>// Produces "[{mytype:'C1',...},{mytype:'C2',...}]"</jc> String json = JsonSerializer.<jsf>DEFAULT_LAX</jsf>.serialize(x); </p> + <p> This is similar in concept to the <a href="../../../../org/apache/juneau/BeanContext.html#BEAN_beanTypePropertyName"><code>BeanContext.BEAN_beanTypePropertyName</code></a> setting except this annotation applies only to the annotated class and subclasses whereas the bean context property applies globally on @@ -313,11 +325,13 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>properties</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.149">properties</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.163">properties</a></pre> <div class="block">The set and order of names of properties associated with a bean class. + <p> The order specified is the same order that the entries will be returned by the <a href="../../../../org/apache/juneau/BeanMap.html#entrySet--"><code>BeanMap.entrySet()</code></a> and related methods. + <p> This annotation is an alternative to using the <a href="../../../../org/apache/juneau/transform/BeanFilter.html" title="class in org.apache.juneau.transform"><code>BeanFilter</code></a> class with an implemented <a href="../../../../org/apache/juneau/transform/BeanFilter.html#getProperties--"><code>BeanFilter.getProperties()</code></a> method. @@ -345,21 +359,23 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>sort</h4> -<pre>public abstract boolean <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.167">sort</a></pre> +<pre>public abstract boolean <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.183">sort</a></pre> <div class="block">Sort bean properties in alphabetical order. + <p> When <jk>true</jk>, all bean properties will be serialized and access in alphabetical order. - Otherwise, the natural order of the bean properties is used which is dependent on the - JVM vendor. + Otherwise, the natural order of the bean properties is used which is dependent on the JVM vendor. On IBM JVMs, the bean properties are ordered based on their ordering in the Java file. On Oracle JVMs, the bean properties are not ordered (which follows the official JVM specs). + <p> This property is disabled by default so that IBM JVM users don't have to use <a href="../../../../org/apache/juneau/annotation/Bean.html" title="annotation in org.apache.juneau.annotation"><code>@Bean</code></a> annotations to force bean properties to be in a particular order and can just alter the order of the fields/methods in the Java file. + <p> - This annotation is equivalent to using the <a href="../../../../org/apache/juneau/BeanContext.html#BEAN_sortProperties"><code>BeanContext.BEAN_sortProperties</code></a> property, but - applied to individual classes instead of globally at the serializer or parser level.</div> + This annotation is equivalent to using the <a href="../../../../org/apache/juneau/BeanContext.html#BEAN_sortProperties"><code>BeanContext.BEAN_sortProperties</code></a> property, but applied to + individual classes instead of globally at the serializer or parser level.</div> <dl> <dt>Default:</dt> <dd>false</dd> @@ -375,8 +391,9 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>excludeProperties</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.184">excludeProperties</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.201">excludeProperties</a></pre> <div class="block">Specifies a list of properties that should be excluded from <a href="../../../../org/apache/juneau/BeanMap.html#entrySet--"><code>BeanMap.entrySet()</code></a>. + <p> This annotation is an alternative to using the <a href="../../../../org/apache/juneau/transform/BeanFilter.html" title="class in org.apache.juneau.transform"><code>BeanFilter</code></a> class with an implemented <a href="../../../../org/apache/juneau/transform/BeanFilter.html#getExcludeProperties--"><code>BeanFilter.getExcludeProperties()</code></a> method. @@ -404,12 +421,14 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>propertyNamer</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><? extends <a href="../../../../org/apache/juneau/PropertyNamer.html" title="interface in org.apache.juneau">PropertyNamer</a>> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.205">propertyNamer</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><? extends <a href="../../../../org/apache/juneau/PropertyNamer.html" title="interface in org.apache.juneau">PropertyNamer</a>> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.224">propertyNamer</a></pre> <div class="block">Associates a <a href="../../../../org/apache/juneau/PropertyNamer.html" title="interface in org.apache.juneau"><code>PropertyNamer</code></a> with this bean to tailor the names of the bean properties. + <p> Property namers are used to transform bean property names from standard form to some other form. For example, the <a href="../../../../org/apache/juneau/PropertyNamerDLC.html" title="class in org.apache.juneau"><code>PropertyNamerDLC</code></a> will convert property names to dashed-lowercase, and these will be used as attribute names in JSON, and element names in XML. + <p> This annotation is an alternative to using the <a href="../../../../org/apache/juneau/transform/BeanFilter.html" title="class in org.apache.juneau.transform"><code>BeanFilter</code></a> class with an implemented <a href="../../../../org/apache/juneau/transform/BeanFilter.html#getPropertyNamer--"><code>BeanFilter.getPropertyNamer()</code></a> method. @@ -437,11 +456,13 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>interfaceClass</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.236">interfaceClass</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.259">interfaceClass</a></pre> <div class="block">Identifies a class to be used as the interface class for this and all subclasses. + <p> When specified, only the list of properties defined on the interface class will be used during serialization. Additional properties on subclasses will be ignored. + <p class='bcode'> <jc>// Parent class</jc> <ja>@Bean</ja>(interfaceClass=A.<jk>class</jk>) @@ -459,9 +480,11 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea String r = s.serialize(a1); <jsm>assertEquals</jsm>(<js>"{f0:'f0'}"</js>, r); // Note f1 is not serialized. </p> + <p> Note that this annotation can be used on the parent class so that it filters to all child classes, - or can be set individually on the child classes. + or can be set individually on the child classes. + <p> This annotation is an alternative to using the <a href="../../../../org/apache/juneau/transform/BeanFilter.html" title="class in org.apache.juneau.transform"><code>BeanFilter</code></a> class with an implemented <a href="../../../../org/apache/juneau/transform/BeanFilter.html#getInterfaceClass--"><code>BeanFilter.getInterfaceClass()</code></a> method.</div> @@ -480,11 +503,13 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>stopClass</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.261">stopClass</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.286">stopClass</a></pre> <div class="block">Identifies a stop class for the annotated class. + <p> Identical in purpose to the stop class specified by <a href="http://docs.oracle.com/javase/7/docs/api/java/beans/Introspector.html?is-external=true#getBeanInfo-java.lang.Class-java.lang.Class-" title="class or interface in java.beans"><code>Introspector.getBeanInfo(Class, Class)</code></a>. Any properties in the stop class or in its base classes will be ignored during analysis. + <p> For example, in the following class hierarchy, instances of <code>C3</code> will include property <code>p3</code>, but not <code>p1</code> or <code>p2</code>. @@ -517,11 +542,13 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockListLast"> <li class="blockList"> <h4>beanDictionary</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?>[] <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.279">beanDictionary</a></pre> -<div class="block">The list of classes that make up the bean dictionary for all properties of this bean - or for subclasses of this bean. +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?>[] <a href="../../../../src-html/org/apache/juneau/annotation/Bean.html#line.306">beanDictionary</a></pre> +<div class="block">The list of classes that make up the bean dictionary for all properties of this bean or for subclasses of this + bean. + <p> This is a shorthand for setting the <a href="../../../../org/apache/juneau/annotation/BeanProperty.html#beanDictionary--"><code>BeanProperty.beanDictionary()</code></a> on all properties of the bean. + <p> This list can consist of the following class types: <ul> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/1b5bde65/content/site/apidocs/org/apache/juneau/annotation/BeanConstructor.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/org/apache/juneau/annotation/BeanConstructor.html b/content/site/apidocs/org/apache/juneau/annotation/BeanConstructor.html index 746da3c..8ee058f 100644 --- a/content/site/apidocs/org/apache/juneau/annotation/BeanConstructor.html +++ b/content/site/apidocs/org/apache/juneau/annotation/BeanConstructor.html @@ -96,14 +96,15 @@ <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation">@Target</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Target.html?is-external=true#value--" title="class or interface in java.lang.annotation">value</a>=<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/ElementType.html?is-external=true#CONSTRUCTOR" title="class or interface in java.lang.annotation">CONSTRUCTOR</a>) <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation">@Retention</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Retention.html?is-external=true#value--" title="class or interface in java.lang.annotation">value</a>=<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation">RUNTIME</a>) <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Inherited.html?is-external=true" title="class or interface in java.lang.annotation">@Inherited</a> -public @interface <a href="../../../../src-html/org/apache/juneau/annotation/BeanConstructor.html#line.77">BeanConstructor</a></pre> +public @interface <a href="../../../../src-html/org/apache/juneau/annotation/BeanConstructor.html#line.82">BeanConstructor</a></pre> <div class="block">Maps constructor arguments to property names on beans with read-only properties. + <p> This annotation can be used in the case of beans with properties whose values can only be set by passing them in through a constructor on the class. - <br> - Since method parameter names are lost during compilation, this annotation essentially redefines them so that they + <br>Since method parameter names are lost during compilation, this annotation essentially redefines them so that they are available at runtime. + <p> The definition of a read-only bean is a bean with properties with only getters, like shown below... <p class='bcode'> @@ -133,17 +134,21 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea String name = p.getName(); <jc>// "John Smith"</jc> <jk>int</jk> age = p.getAge(); <jc>// 45</jc> </p> + <p> This annotation can only be applied to constructors and can only be applied to one constructor per class. + <p> When present, bean instantiation is delayed until the call to <a href="../../../../org/apache/juneau/BeanMap.html#getBean--"><code>BeanMap.getBean()</code></a>. Until then, bean property values are stored in a local cache until <code>getBean()</code> is called. - Because of this additional caching step, parsing into read-only beans tends to be slower and use - more memory than parsing into beans with writable properties. + Because of this additional caching step, parsing into read-only beans tends to be slower and use more memory than + parsing into beans with writable properties. + <p> Attempting to call <a href="../../../../org/apache/juneau/BeanMap.html#put-java.lang.String-java.lang.Object-"><code>BeanMap.put(String,Object)</code></a> on a read-only property after calling <a href="../../../../org/apache/juneau/BeanMap.html#getBean--"><code>BeanMap.getBean()</code></a> will result in a <a href="../../../../org/apache/juneau/BeanRuntimeException.html" title="class in org.apache.juneau"><code>BeanRuntimeException</code></a> being thrown. Multiple calls to <a href="../../../../org/apache/juneau/BeanMap.html#getBean--"><code>BeanMap.getBean()</code></a> will return the same bean instance. + <p> Beans can be defined with a combination of read-only and read-write properties.</div> </li> @@ -191,8 +196,9 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockListLast"> <li class="blockList"> <h4>properties</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/BeanConstructor.html#line.84">properties</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/BeanConstructor.html#line.90">properties</a></pre> <div class="block">The names of the properties of the constructor arguments. + <p> The number of properties listed must match the number of arguments in the constructor.</div> <dl> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/1b5bde65/content/site/apidocs/org/apache/juneau/annotation/BeanIgnore.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/org/apache/juneau/annotation/BeanIgnore.html b/content/site/apidocs/org/apache/juneau/annotation/BeanIgnore.html index d8d7a3e..50ba574 100644 --- a/content/site/apidocs/org/apache/juneau/annotation/BeanIgnore.html +++ b/content/site/apidocs/org/apache/juneau/annotation/BeanIgnore.html @@ -96,14 +96,17 @@ <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation">@Target</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Target.html?is-external=true#value--" title="class or interface in java.lang.annotation">value</a>={<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/ElementType.html?is-external=true#FIELD" title="class or interface in java.lang.annotation">FIELD</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/ElementType.html?is-external=true#METHOD" title="class or interface in java.lang.annotation">METHOD</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/ElementType.html?is-external=true#TYPE" title="class or interface in java.lang.annotation">TYPE</a>}) <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation">@Retention</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Retention.html?is-external=true#value--" title="class or interface in java.lang.annotation">value</a>=<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation">RUNTIME</a>) <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Inherited.html?is-external=true" title="class or interface in java.lang.annotation">@Inherited</a> -public @interface <a href="../../../../src-html/org/apache/juneau/annotation/BeanIgnore.html#line.35">BeanIgnore</a></pre> +public @interface <a href="../../../../src-html/org/apache/juneau/annotation/BeanIgnore.html#line.38">BeanIgnore</a></pre> <div class="block">Ignore classes, fields, and methods from being interpreted as bean or bean components. + <p> Applied to classes that may look like beans, but you want to be treated as non-beans. For example, if you want to force a bean to be converted to a string using the <code>toString()</code> method, use this annotation on the class. + <p> Applies to fields that should not be interpreted as bean property fields. + <p> Applies to getters or setters that should not be interpreted as bean property getters or setters.</div> </li> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/1b5bde65/content/site/apidocs/org/apache/juneau/annotation/BeanParam.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/org/apache/juneau/annotation/BeanParam.html b/content/site/apidocs/org/apache/juneau/annotation/BeanParam.html index dd2af23..2407eb5 100644 --- a/content/site/apidocs/org/apache/juneau/annotation/BeanParam.html +++ b/content/site/apidocs/org/apache/juneau/annotation/BeanParam.html @@ -93,7 +93,7 @@ <hr> <br> <pre>public @interface <a href="../../../../src-html/org/apache/juneau/annotation/BeanParam.html#line.19">BeanParam</a></pre> -<div class="block">TODO</div> +<div class="block">Future support for defining bean properties on constructor args.</div> </li> </ul> </div> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/1b5bde65/content/site/apidocs/org/apache/juneau/annotation/BeanProperty.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/org/apache/juneau/annotation/BeanProperty.html b/content/site/apidocs/org/apache/juneau/annotation/BeanProperty.html index 0b744a2..ee29c2f 100644 --- a/content/site/apidocs/org/apache/juneau/annotation/BeanProperty.html +++ b/content/site/apidocs/org/apache/juneau/annotation/BeanProperty.html @@ -96,23 +96,34 @@ <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation">@Target</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Target.html?is-external=true#value--" title="class or interface in java.lang.annotation">value</a>={<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/ElementType.html?is-external=true#FIELD" title="class or interface in java.lang.annotation">FIELD</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/ElementType.html?is-external=true#METHOD" title="class or interface in java.lang.annotation">METHOD</a>}) <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation">@Retention</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Retention.html?is-external=true#value--" title="class or interface in java.lang.annotation">value</a>=<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation">RUNTIME</a>) <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Inherited.html?is-external=true" title="class or interface in java.lang.annotation">@Inherited</a> -public @interface <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.48">BeanProperty</a></pre> +public @interface <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.59">BeanProperty</a></pre> <div class="block">Used tailor how bean properties get interpreted by the framework. + <p> Can be used to do the following: <ul class='spaced-list'> - <li>Override the name of a property. - <li>Identify a getter or setter with a non-standard naming convention. - <li>Identify a specific subclass for a property with a general class type. - <li>Identify class types of elements in properties of type <code>Collection</code> or <code>Map</code>. - <li>Hide properties during serialization. - <li>Associate transforms with bean property values, such as a POJO swap to convert a <code>Calendar</code> field + <li> + Override the name of a property. + <li> + Identify a getter or setter with a non-standard naming convention. + <li> + Identify a specific subclass for a property with a general class type. + <li> + Identify class types of elements in properties of type <code>Collection</code> or <code>Map</code>. + <li> + Hide properties during serialization. + <li> + Associate transforms with bean property values, such as a POJO swap to convert a <code>Calendar</code> field to a string. - <li>Override the list of properties during serialization on child elements of a property of type + <li> + Override the list of properties during serialization on child elements of a property of type <code>Collection</code> or <code>Map</code>. - <li>Identify a property as the URL for a bean. - <li>Identify a property as the ID for a bean. + <li> + Identify a property as the URL for a bean. + <li> + Identify a property as the ID for a bean. </ul> + <p> This annotation is applied to public fields and public getter/setter methods of beans.</div> </li> @@ -204,23 +215,26 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>name</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.135">name</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.150">name</a></pre> <div class="block">Identifies the name of the property. + <p> - Normally, this is automatically inferred from the field name or getter method name - of the property. However, this property can be used to assign a different - property name from the automatically inferred value. + Normally, this is automatically inferred from the field name or getter method name of the property. + However, this property can be used to assign a different property name from the automatically inferred value. + <p> If the <a href="../../../../org/apache/juneau/BeanContext.html#BEAN_beanFieldVisibility"><code>BeanContext.BEAN_beanFieldVisibility</code></a> setting on the bean context excludes this field (e.g. the visibility is set to PUBLIC, but the field is PROTECTED), this annotation can be used to force the field to be identified as a property. - <p> + <h6 class='topic'>Dynamic beans</h6> + <p> The bean property named <js>"*"</js> is the designated "dynamic property" which allows for "extra" bean properties not otherwise defined. This is similar in concept to the Jackson <ja>@JsonGetterAll</ja> and <ja>@JsonSetterAll</ja> annotations. The primary purpose is for backwards compatibility in parsing newer streams with addition information into older beans. + <p> The following examples show how to define dynamic bean properties. <p class='bcode'> @@ -259,9 +273,10 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea } } </p> - <p> - Similar rules apply for value types and swaps. The property values optionally can be any serializable type or - use swaps. + +<p> + Similar rules apply for value types and swaps. + The property values optionally can be any serializable type or use swaps. <p class='bcode'> <jc>// A serializable type other than Object.</jc> <jk>public class</jk> BeanWithDynaFieldWithListValues { @@ -281,7 +296,7 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea } } </p> - <p> + <ul class='doctree'> <li class='info'> Note that if you're not interested in these additional properties, you can also use the @@ -303,11 +318,12 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>value</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.148">value</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.164">value</a></pre> <div class="block">A synonym for <a href="../../../../org/apache/juneau/annotation/BeanProperty.html#name--"><code>name()</code></a>. + <p> The following annotations are equivalent: - <p> + <p class='bcode'> <ja>@BeanProperty</ja>(name=<js>"foo"</js>) @@ -328,13 +344,15 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>type</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.170">type</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.188">type</a></pre> <div class="block">Identifies a specialized class type for the property. + <p> Normally this can be inferred through reflection of the field type or getter return type. However, you'll want to specify this value if you're parsing beans where the bean property class is an interface or abstract class to identify the bean type to instantiate. Otherwise, you may cause an <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/InstantiationException.html?is-external=true" title="class or interface in java.lang"><code>InstantiationException</code></a> when trying to set these fields. + <p> This property must denote a concrete bean class with a no-arg constructor. @@ -362,7 +380,7 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>params</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?>[] <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.186">params</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?>[] <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.204">params</a></pre> <div class="block">For bean properties of maps and collections, this annotation can be used to identify the class types of the contents of the bean property object when the generic parameter types are interfaces or abstract classes. @@ -390,11 +408,13 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>swap</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.206">swap</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.226">swap</a></pre> <div class="block">Associates a <a href="../../../../org/apache/juneau/transform/PojoSwap.html" title="class in org.apache.juneau.transform"><code>PojoSwap</code></a> or <a href="../../../../org/apache/juneau/transform/SurrogateSwap.html" title="class in org.apache.juneau.transform"><code>SurrogateSwap</code></a> with this bean property that will swap the value object with another object during serialization and parsing. + <p> This annotation supersedes any swaps associated with the bean property type class itself. + <p> Typically used for rendering <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Dates</code></a> and <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><code>Calendars</code></a> as a particular string format. @@ -422,8 +442,9 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>properties</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.237">properties</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.258">properties</a></pre> <div class="block">Used to limit which child properties are rendered by the serializers. + <p> Can be used on any of the following bean property types: <ul class='spaced-list'> @@ -465,12 +486,14 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockList"> <li class="blockList"> <h4>beanDictionary</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?>[] <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.255">beanDictionary</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?>[] <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.278">beanDictionary</a></pre> <div class="block">The list of classes that make up the bean dictionary for this bean property. + <p> The dictionary is a name/class mapping used to find class types during parsing when they cannot be inferred through reflection. The names are defined through the <a href="../../../../org/apache/juneau/annotation/Bean.html#typeName--"><code>Bean.typeName()</code></a> annotation defined on the bean class. + <p> This list can consist of the following class types: <ul> @@ -495,10 +518,12 @@ public @interface <a href="../../../../src-html/org/apache/juneau/annotation/Bea <ul class="blockListLast"> <li class="blockList"> <h4>format</h4> -<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.271">format</a></pre> +<pre>public abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/juneau/annotation/BeanProperty.html#line.296">format</a></pre> <div class="block">Specifies a String format for converting the bean property value to a formatted string. + <p> Note that this is usually a one-way conversion during serialization. + <p> During parsing, we will attempt to convert the value to the original form by using the <a href="../../../../org/apache/juneau/BeanSession.html#convertToType-java.lang.Object-java.lang.Class-"><code>BeanSession.convertToType(Object, Class)</code></a> but there is no guarantee that this will succeed.
