http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/62afb533/content/site/apidocs/overview-summary.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/overview-summary.html b/content/site/apidocs/overview-summary.html index 6ff8830..92f2522 100644 --- a/content/site/apidocs/overview-summary.html +++ b/content/site/apidocs/overview-summary.html @@ -434,7 +434,7 @@ <li><p><a class='doclink' href='#Core.Transforms'>Transforms</a></p> <ol> <li><p><a class='doclink' href='#Core.PojoSwaps'>PojoSwaps</a></p> - <li><p><a class='doclink' href='#Core.PojoAnnotation'>@Pojo annotation</a></p> + <li><p><a class='doclink' href='#Core.SwapAnnotation'>@Swap annotation</a></p> <li><p><a class='doclink' href='#Core.SwapMethods'>Swap methods</a></p> <li><p><a class='doclink' href='#Core.BeanFilters'>BeanFilters and @Bean annotations</a></p> <li><p><a class='doclink' href='#Core.SerializingReadersAndInputStreams'>Serializing Readers and InputStreams</a></p> @@ -1123,7 +1123,7 @@ </p> <ul class='doctree'> <li class='ja'> - <a href="org/apache/juneau/annotation/Pojo.html" title="annotation in org.apache.juneau.annotation"><code>@Pojo</code></a> + <a href="org/apache/juneau/annotation/Swap.html" title="annotation in org.apache.juneau.annotation"><code>@Swap</code></a> - Used to tailor how non-bean POJOs get interpreted by the framework. <li class='ja'> <a href="org/apache/juneau/annotation/Bean.html" title="annotation in org.apache.juneau.annotation"><code>@Bean</code></a> @@ -1250,17 +1250,17 @@ </div> <!-- ======================================================================================================== --> - <a id="Core.PojoAnnotation"></a> - <h4 class='topic' onclick='toggle(this)'>2.6.2 - @Pojo annotation</h4> + <a id="Core.SwapAnnotation"></a> + <h4 class='topic' onclick='toggle(this)'>2.6.2 - @Swap annotation</h4> <div class='topic'> <p> - <a href="org/apache/juneau/annotation/Pojo.html" title="annotation in org.apache.juneau.annotation"><code>@Pojo</code></a> can be used to associate a swap class using an + <a href="org/apache/juneau/annotation/Swap.html" title="annotation in org.apache.juneau.annotation"><code>@Swap</code></a> can be used to associate a swap class using an annotation. This is often cleaner than using the builder <code>pojoSwaps()</code> method since you can keep your swap class near your POJO class. </p> <p class='bcode'> - <ja>@Pojo</ja>(swap=MyPojoSwap.<jk>class</jk>) + <ja>@Swap</ja>(MyPojoSwap.<jk>class</jk>) <jk>public class</jk> MyPojo { ... } @@ -1531,7 +1531,7 @@ all other renditions as-is: </p> <p class='bcode'> - <ja>@Pojo</ja>(swap=MyBeanSwap.<jk>class</jk>) + <ja>@Swap</ja>(MyBeanSwap.<jk>class</jk>) <jk>public class</jk> MyBean {...} <jk>public class</jk> MyBeanSwap <jk>extends</jk> PojoSwap<MyBean,Object> { @@ -2440,8 +2440,7 @@ </td> <td> Juneau uses swaps to convert non-serializable object to serializable forms: - <br><a href="org/apache/juneau/annotation/BeanProperty.html#swap--"><code>@BeanProperty(swap=...)</code></a> - <br><a href="org/apache/juneau/annotation/Pojo.html#swap--"><code>@Pojo(swap=...)</code></a> + <br><a href="org/apache/juneau/annotation/Swap.html" title="annotation in org.apache.juneau.annotation"><code>@Swap</code></a> </td> </tr> <tr> @@ -7090,7 +7089,7 @@ <h5 class='toc'>What's new in each release</h5> <ul class='toc'> - <li><p><a class='doclink' href='#6.3.2'>6.3.2 (TBD)</a></p> + <li><p><a class='doclink' href='#6.4.0'>6.4.0 (TBD)</a></p> <li><p><a class='doclink' href='#6.3.1'>6.3.1 (Aug 1, 2017)</a></p> <li><p><a class='doclink' href='#6.3.0'>6.3.0 (Jun 30, 2017)</a></p> <li><p><a class='doclink' href='#6.2.0'>6.2.0 (Apr 28, 2017)</a></p> @@ -7160,8 +7159,8 @@ </ul> <!-- ======================================================================================================== --> - <a id="6.3.2"></a> - <h3 class='topic' onclick='toggle(this)'>6.3.2 (TBD)</h3> + <a id="6.4.0"></a> + <h3 class='topic' onclick='toggle(this)'>6.4.0 (TBD)</h3> <div class='topic'> <p> The major change in this release is the project structure @@ -7174,8 +7173,8 @@ <th>Category</th><th>Maven Artifacts</th><th>Description</th><th>Prereqs</th> </tr> <tr class='dark bb'> - <td rowspan="5" style='text-align:center;font-weight:bold;padding:20px;'><a class='doclink' href='#JuneauCore'>Juneau Core</a></td> - <td class='code'><a class='doclink' href='#juneau-marshall'>juneau-marshall</a></td> + <td rowspan="5" style='text-align:center;font-weight:bold;padding:20px;'>Juneau Core</td> + <td class='code'>juneau-marshall</td> <td>Serializers and parsers for: <ul style='margin:0px 10px;'> <li>JSON @@ -7198,7 +7197,7 @@ </td> </tr> <tr class='dark bb'> - <td class='code'><a class='doclink' href='#juneau-marshall-rdf'>juneau-marshall-rdf</a></td> + <td class='code'>juneau-marshall-rdf</td> <td> Serializers and parsers for: <ul style='margin:0px 10px;'> @@ -7217,7 +7216,7 @@ </td> </tr> <tr class='dark bb'> - <td class='code'><a class='doclink' href='#juneau-dto'>juneau-dto</a></td> + <td class='code'>juneau-dto</td> <td> Data Transfer Objects for: <ul style='margin:0px 10px;'> @@ -7231,22 +7230,22 @@ <td><ul style='margin:0px 10px;'><li>Java 6</li></ul></td> </tr> <tr class='dark bb'> - <td class='code'><a class='doclink' href='#juneau-svl'>juneau-svl</a></td> + <td class='code'>juneau-svl</td> <td> Simple Variable Language API </td> <td><ul style='margin:0px 10px;'><li>Java 6</li></ul></td> </tr> <tr class='dark bb'> - <td class='code'><a class='doclink' href='#juneau-config'>juneau-config</a></td> + <td class='code'>juneau-config</td> <td> Configuration file API </td> <td><ul style='margin:0px 10px;'><li>Java 6</li></ul></td> </tr> <tr class='light bb'> - <td rowspan="5" style='text-align:center;font-weight:bold;padding:20px;'><a class='doclink' href='#JuneauRest'>Juneau REST</a></td> - <td class='code'><a class='doclink' href='#juneau-rest-server'>juneau-rest-server</a></td> + <td rowspan="3" style='text-align:center;font-weight:bold;padding:20px;'>Juneau REST</td> + <td class='code'>juneau-rest-server</td> <td> REST Servlet API </td> @@ -7258,7 +7257,7 @@ </td> </tr> <tr class='light bb'> - <td class='code'><a class='doclink' href='#juneau-rest-server-jaxrs'>juneau-rest-server-jaxrs</a></td> + <td class='code'>juneau-rest-server-jaxrs</td> <td> Optional JAX-RS support </td> @@ -7270,7 +7269,7 @@ </td> </tr> <tr class='light bb'> - <td class='code'><a class='doclink' href='#juneau-rest-client'>juneau-rest-client</a></td> + <td class='code'>juneau-rest-client</td> <td> REST Client API </td> @@ -7281,10 +7280,11 @@ </ul> </td> </tr> - <tr class='light bb'> - <td class='code'><a class='doclink' href='#juneau-microservice'>juneau-microservice</a></td> + <tr class='dark bb'> + <td rowspan="2" style='text-align:center;font-weight:bold;padding:20px;'>Juneau Microservice</td> + <td class='code'>juneau-microservice-server</td> <td> - REST Microservice API + REST Microservice Server API </td> <td> <ul style='margin:0px 10px;'> @@ -7293,8 +7293,8 @@ </ul> </td> </tr> - <tr class='light bb'> - <td class='code'><a class='doclink' href='#juneau-microservice-template'>juneau-microservice-template</a></td> + <tr class='dark bb'> + <td class='code'>juneau-microservice-template</td> <td> Developer template project </td> @@ -7305,23 +7305,23 @@ </ul> </td> </tr> - <tr class='dark bb'> - <td rowspan="2" style='text-align:center;font-weight:bold;padding:20px;'><a class='doclink' href='#Examples'>Examples</a></td> + <tr class='light bb'> + <td rowspan="2" style='text-align:center;font-weight:bold;padding:20px;'>Examples</td> <td class='code'><code>juneau-examples-core</code></td> <td> Core code examples </td> <td></td> </tr> - <tr class='dark bb'> + <tr class='light bb'> <td class='code'><code>juneau-examples-rest</code></td> <td> REST code examples </td> <td></td> </tr> - <tr class='light bb'> - <td rowspan="1" style='text-align:center;font-weight:bold;padding:20px;'><a class='doclink' href='#JuneauAll'>Juneau All</a></td> + <tr class='dark bb'> + <td rowspan="1" style='text-align:center;font-weight:bold;padding:20px;'>Juneau All</td> <td class='code'><code>juneau-all</code></td> <td> Combination of the following: @@ -7347,6 +7347,72 @@ <h6 class='topic'>juneau-marshall</h6> <ul class='spaced-list'> <li> + Improvements to swap support. + <ul> + <li>New <a href="org/apache/juneau/annotation/Swap.html" title="annotation in org.apache.juneau.annotation"><code>@Swap</code></a> annotation. + <br>Replaces the <code>@Pojo</code> and <code>@BeanProperty.swap()</code> annotations. + <li>Support for per-media-type swaps. + <br>Programmatic example: + <p class='bcode'> + <ja>@Swap</ja>(MyJsonOnlySwap.<jk>class</jk>) + <jk>public class</jk> MyPojo {} + + <jk>public class</jk> MyJsonOnlySwap <jk>extends</jk> PojoSwap<MyPojo,String> { + + <jk>public</jk> MediaType[] forMediaTypes() { + <jk>return</jk> MediaType.<jsm>forStrings</jsm>(<js>"*/json"</js>); + } + + <jk>public</jk> String swap(BeanSession session, MyPojo o) <jk>throws</jk> Exception { + <jk>return</jk> <js>"It's JSON!"</js>; + } + </p> + <br>Annotated example: + <p class='bcode'> + <ja>@Swap</ja>(impl=ToStringSwap.<jk>class</jk>, mediaTypes=<js>"*/json"</js>) + <jk>public class</jk> MyBean { ... } + + <jk>public class</jk> ToStringSwap <jk>extends</jk> PojoSwap<Object,String> { + <jk>public</jk> String swap(BeanSession session, Object o) <jk>throws</jk> Exception { + <jk>return</jk> o.toString(); + } + } + </p> + <li>Support for templated swaps which provide additional context information for a swap. + <br>The following is an example of a templated swap class used to serialize POJOs to HTML using FreeMarker: + <p class='bcode'> + <jc>// Our abstracted templated swap class.</jc> + <jk>public abstract class</jk> FreeMarkerSwap <jk>extends</jk> PojoSwap<Object,Reader> { + + <jk>public</jk> MediaType[] forMediaTypes() { + <jk>return</jk> MediaType.<jsm>forStrings</jsm>(<js>"*/html"</js>); + } + + <jk>public</jk> Reader swap(BeanSession session, Object o, String template) <jk>throws</jk> Exception { + <jk>return</jk> getFreeMarkerReader(template, o); <jc>// Some method that creates raw HTML.</jc> + } + } + </p> + <p class='bcode'> + <ja>@Swap</ja>(impl=FreeMarkerSwap.<jk>class</jk>, template=<js>"MyPojo.div.ftl"</js>) + <jk>public class</jk> MyPojo {} + </p> + <li>New <a href="org/apache/juneau/annotation/Swaps.html" title="annotation in org.apache.juneau.annotation"><code>@Swaps</code></a> annotation for defining multiple swaps + against the same POJO when they're differentiated by media types: + <p class='bcode'> + <ja>@Swaps</ja>( + { + <ja>@Swap</ja>(MyJsonSwap.<jk>class</jk>), + <ja>@Swap</ja>(MyXmlSwap.<jk>class</jk>), + <ja>@Swap</ja>(MyOtherSwap.<jk>class</jk>) + } + ) + <jk>public class</jk> MyPojo {} + </p> + </ul> + <li> + New <a href="org/apache/juneau/transform/Surrogate.html" title="interface in org.apache.juneau.transform"><code>Surrogate</code></a> interface for identifying surrogate classes. + <li> Serializers can now serialize to <a href="http://docs.oracle.com/javase/7/docs/api/java/util/StringBuilder.html?is-external=true" title="class or interface in java.util"><code>StringBuilders</code></a>. <li> Serializers now serialize the contents of <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io"><code>Readers</code></a> and <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStreams</code></a> @@ -7382,10 +7448,10 @@ <jc>// Same, but using a session object</jc> SerializerSession session = JsonSerializer.<jsf>DEFAULT</jsf>.createSession(); <jk>try</jk> { - session.serialize(writer1, pojo1); - session.serialize(writer2, pojo2); + session.serialize(writer1, pojo1); + session.serialize(writer2, pojo2); } <jk>finally</jk> { - session.close(); + session.close(); } </p> This is mostly an internal change and doesn't affect the existing APIs. @@ -8822,7 +8888,7 @@ <li><a href="org/apache/juneau/BeanPropertyMetaExtended.html" title="class in org.apache.juneau"><code>BeanPropertyMetaExtended</code></a> / <a href="org/apache/juneau/BeanPropertyMeta.html#getExtendedMeta-java.lang.Class-"><code>BeanPropertyMeta.getExtendedMeta(Class)</code></a> </ul> </li> - <li>Renamed <code>@Transform</code> annotation to <a href="org/apache/juneau/annotation/Pojo.html" title="annotation in org.apache.juneau.annotation"><code>@Pojo</code></a> so that it can be used for various POJO-related behavior, not just associating transforms. + <li>Renamed <code>@Transform</code> annotation to <code><del>@Pojo</del></code> so that it can be used for various POJO-related behavior, not just associating transforms. <li>Introduced <a href="org/apache/juneau/dto/swagger/package-summary.html"><code>Swagger DTOs</code></a>. </ul>
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/62afb533/content/site/apidocs/overview-tree.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/overview-tree.html b/content/site/apidocs/overview-tree.html index 6f1ac6b..83a05fa 100644 --- a/content/site/apidocs/overview-tree.html +++ b/content/site/apidocs/overview-tree.html @@ -1408,6 +1408,7 @@ <li type="circle">org.apache.juneau.rest.<a href="org/apache/juneau/rest/RestResourceResolver.html" title="interface in org.apache.juneau.rest"><span class="typeNameLink">RestResourceResolver</span></a></li> <li type="circle">org.apache.juneau.<a href="org/apache/juneau/Setter.html" title="interface in org.apache.juneau"><span class="typeNameLink">Setter</span></a></li> <li type="circle">org.apache.juneau.<a href="org/apache/juneau/Streamable.html" title="interface in org.apache.juneau"><span class="typeNameLink">Streamable</span></a></li> +<li type="circle">org.apache.juneau.transform.<a href="org/apache/juneau/transform/Surrogate.html" title="interface in org.apache.juneau.transform"><span class="typeNameLink">Surrogate</span></a></li> <li type="circle">org.apache.juneau.<a href="org/apache/juneau/Writable.html" title="interface in org.apache.juneau"><span class="typeNameLink">Writable</span></a></li> <li type="circle">org.apache.juneau.utils.<a href="org/apache/juneau/utils/ZipFileList.ZipFileEntry.html" title="interface in org.apache.juneau.utils"><span class="typeNameLink">ZipFileList.ZipFileEntry</span></a></li> </ul> @@ -1415,7 +1416,8 @@ <ul> <li type="circle">org.apache.juneau.annotation.<a href="org/apache/juneau/annotation/URI.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">URI</span></a> (implements java.lang.annotation.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>)</li> <li type="circle">org.apache.juneau.annotation.<a href="org/apache/juneau/annotation/ThreadSafe.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">ThreadSafe</span></a> (implements java.lang.annotation.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>)</li> -<li type="circle">org.apache.juneau.annotation.<a href="org/apache/juneau/annotation/Pojo.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">Pojo</span></a> (implements java.lang.annotation.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>)</li> +<li type="circle">org.apache.juneau.annotation.<a href="org/apache/juneau/annotation/Swaps.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">Swaps</span></a> (implements java.lang.annotation.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>)</li> +<li type="circle">org.apache.juneau.annotation.<a href="org/apache/juneau/annotation/Swap.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">Swap</span></a> (implements java.lang.annotation.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>)</li> <li type="circle">org.apache.juneau.annotation.<a href="org/apache/juneau/annotation/ParentProperty.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">ParentProperty</span></a> (implements java.lang.annotation.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>)</li> <li type="circle">org.apache.juneau.annotation.<a href="org/apache/juneau/annotation/Overrideable.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">Overrideable</span></a> (implements java.lang.annotation.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>)</li> <li type="circle">org.apache.juneau.annotation.<a href="org/apache/juneau/annotation/NameProperty.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">NameProperty</span></a> (implements java.lang.annotation.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>)</li>