You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2019/08/10 13:10:37 UTC
[juneau] branch master updated: Javadocs.
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new 5e5813d Javadocs.
5e5813d is described below
commit 5e5813dfcfdc84da52d552a3c30028416a737a04
Author: JamesBognar <ja...@apache.org>
AuthorDate: Sat Aug 10 09:10:14 2019 -0400
Javadocs.
---
...ojoSwaps.html => 04.PerMediaTypePojoSwaps.html} | 0
...neWayPojoSwaps.html => 05.OneWayPojoSwaps.html} | 0
....SwapAnnotation.html => 06.SwapAnnotation.html} | 0
....TemplatedSwaps.html => 07.TemplatedSwaps.html} | 0
juneau-doc/src/main/javadoc/overview.html | 349 +++++++++++----------
juneau-doc/src/main/javadoc/resources/docs.txt | 2 +-
.../src/main/javadoc/resources/fragments/toc.html | 4 +-
.../org/apache/juneau/rest/RequestProperties.java | 2 +-
.../apache/juneau/rest/RestContextProperties.java | 2 +-
.../apache/juneau/rest/RestMethodProperties.java | 2 +-
.../java/org/apache/juneau/rest/RestRequest.java | 2 +-
.../java/org/apache/juneau/rest/RestResponse.java | 2 +-
.../apache/juneau/rest/annotation/Property.java | 2 +-
13 files changed, 184 insertions(+), 183 deletions(-)
diff --git a/juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/03.PerMediaTypePojoSwaps.html b/juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/04.PerMediaTypePojoSwaps.html
similarity index 100%
rename from juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/03.PerMediaTypePojoSwaps.html
rename to juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/04.PerMediaTypePojoSwaps.html
diff --git a/juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/04.OneWayPojoSwaps.html b/juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/05.OneWayPojoSwaps.html
similarity index 100%
rename from juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/04.OneWayPojoSwaps.html
rename to juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/05.OneWayPojoSwaps.html
diff --git a/juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/05.SwapAnnotation.html b/juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/06.SwapAnnotation.html
similarity index 100%
rename from juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/05.SwapAnnotation.html
rename to juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/06.SwapAnnotation.html
diff --git a/juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/06.TemplatedSwaps.html b/juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/07.TemplatedSwaps.html
similarity index 100%
rename from juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/06.TemplatedSwaps.html
rename to juneau-doc/docs/Topics/02.juneau-marshall/11.Transforms/07.TemplatedSwaps.html
diff --git a/juneau-doc/src/main/javadoc/overview.html b/juneau-doc/src/main/javadoc/overview.html
index 6ee5b96..bc84e73 100644
--- a/juneau-doc/src/main/javadoc/overview.html
+++ b/juneau-doc/src/main/javadoc/overview.html
@@ -95,12 +95,12 @@
<li><p class=''><a class='doclink' href='#juneau-marshall.Transforms'>Transforms</a></p>
<ol>
<li><p class='updated'><a class='doclink' href='#juneau-marshall.Transforms.PojoSwaps'>PojoSwaps</a></p>
- <li><p class='new'><a class='doclink' href='#juneau-marshall.Transforms.DefaultPojoSwaps'>Default PojoSwaps</a></p>
+ <li><p class=''><a class='doclink' href='#juneau-marshall.Transforms.DefaultPojoSwaps'>Default PojoSwaps</a></p>
+ <li><p class='new'><a class='doclink' href='#juneau-marshall.Transforms.AutoPojoSwaps'>Auto-detected POJO swaps</a></p>
<li><p class='updated'><a class='doclink' href='#juneau-marshall.Transforms.PerMediaTypePojoSwaps'>Per-media-type PojoSwaps</a></p>
<li><p class=''><a class='doclink' href='#juneau-marshall.Transforms.OneWayPojoSwaps'>One-way PojoSwaps</a></p>
<li><p class=''><a class='doclink' href='#juneau-marshall.Transforms.SwapAnnotation'>@Swap Annotation</a></p>
<li><p class=''><a class='doclink' href='#juneau-marshall.Transforms.TemplatedSwaps'>Templated Swaps</a></p>
- <li><p class='updated'><a class='doclink' href='#juneau-marshall.Transforms.SwapMethods'>Swap Methods</a></p>
<li><p class=''><a class='doclink' href='#juneau-marshall.Transforms.SurrogateClasses'>Surrogate Classes</a></p>
<li><p class=''><a class='doclink' href='#juneau-marshall.Transforms.BeanAnnotation'>@Bean Annotation</a></p>
<li><p class='updated'><a class='doclink' href='#juneau-marshall.Transforms.BeanPropertyAnnotation'>@BeanProperty Annotation</a></p>
@@ -2074,7 +2074,7 @@
<!-- ==================================================================================================== -->
-<h4 class='topic new' onclick='toggle(this)'><a href='#juneau-marshall.Transforms.DefaultPojoSwaps' id='juneau-marshall.Transforms.DefaultPojoSwaps'>2.11.2 - Default PojoSwaps</a></h4>
+<h4 class='topic ' onclick='toggle(this)'><a href='#juneau-marshall.Transforms.DefaultPojoSwaps' id='juneau-marshall.Transforms.DefaultPojoSwaps'>2.11.2 - Default PojoSwaps</a></h4>
<div class='topic'><!-- START: 2.11.2 - juneau-marshall.Transforms.DefaultPojoSwaps -->
<p>
By default, all serializers and parsers have built in <c>PojoSwaps</c> defined for the following common data types:
@@ -2083,6 +2083,7 @@
<li class='jc'>{@link java.util.Enumeration}
<li class='jc'>{@link java.util.Iterator}
<li class='jc'>{@link java.util.Locale}
+ <li class='jc'>{@link java.util.Class}
<li class='jc'>{@link java.util.Calendar} - ISO offset date-time.
<li class='jc'>{@link java.util.Date} - Local date-time
<li class='jc'>{@link java.time.Instant} - ISO instant.
@@ -2181,8 +2182,167 @@
<!-- ==================================================================================================== -->
-<h4 class='topic updated' onclick='toggle(this)'><a href='#juneau-marshall.Transforms.PerMediaTypePojoSwaps' id='juneau-marshall.Transforms.PerMediaTypePojoSwaps'>2.11.3 - Per-media-type PojoSwaps</a></h4>
-<div class='topic'><!-- START: 2.11.3 - juneau-marshall.Transforms.PerMediaTypePojoSwaps -->
+<h4 class='topic new' onclick='toggle(this)'><a href='#juneau-marshall.Transforms.AutoPojoSwaps' id='juneau-marshall.Transforms.AutoPojoSwaps'>2.11.3 - Auto-detected POJO swaps</a></h4>
+<div class='topic'><!-- START: 2.11.3 - juneau-marshall.Transforms.AutoPojoSwaps -->
+<p>
+ Various methods can be defined on a class directly to affect how it gets serialized.
+ This can often be simpler than using <c>PojoSwaps</c>.
+</p>
+<p>
+ Objects serialized as <c>Strings</c> can be parsed back into their original objects by
+ implementing one of the following methods on the class:
+</p>
+<ul class='spaced-list'>
+ <li>
+ <c><jk>public static</jk> T fromString(String)</c> method.
+ <br>Any of the following method names also work:
+ <ul>
+ <li><c>valueOf(String)</c>
+ <li><c>parse(String)</c>
+ <li><c>parseString(String)</c>
+ <li><c>forName(String)</c>
+ <li><c>forString(String)</c>
+ </ul>
+ <li>
+ <c><jk>public</jk> T(String)</c> constructor.
+</ul>
+<p>
+ Note that these methods cover conversion from several built-in Java types, meaning the parsers can
+ automatically construct these objects from strings:
+</p>
+<ul>
+ <li><c>fromString(String)</c> - {@link java.util.UUID}
+ <li><c>valueOf(String)</c> - {@link java.lang.Boolean}, {@link java.lang.Byte},
+ {@link java.lang.Double}, {@link java.lang.Float},
+ {@link java.lang.Integer}, {@link java.lang.Long}, {@link java.lang.Short}, {@link java.sql.Date},
+ {@link java.sql.Time}, {@link java.sql.Timestamp}
+ <li><c>parse(String)</c> - {@link java.text.DateFormat}, {@link java.text.MessageFormat},
+ {@link java.text.NumberFormat}, {@link java.util.Date}, {@link java.util.logging.Level}
+ <li><c>parseString(String)</c> - {@link javax.xml.bind.DatatypeConverter}
+ <li><c>forName(String)</c> - {@link java.lang.Class}
+</ul>
+<p>
+ If you want to force a bean-like class to be serialized as a string, you can use the
+ {@link org.apache.juneau.annotation.BeanIgnore @BeanIgnore} annotation on the class to force it to be
+ serialized to a string using the <c>toString()</c> method.
+</p>
+<p>
+ Serializing to other intermediate objects can be accomplished by defining a swap method directly on the
+ class:
+</p>
+<ul>
+ <li><c><jk>public</jk> X swap()</c> method, where <c>X</c> is any serializable object.
+ <li><c><jk>public</jk> X swap(BeanSession)</c> method, where <c>X</c> is any serializable object.
+ <li><c><jk>public static</jk> MyPojo unswap(X)</c> method, where <c>X</c> is any serializable object.
+ <li><c><jk>public static</jk> MyPojo swap(X,BeanSession)</c> method, where <c>X</c> is any serializable object.
+</ul>
+<p>
+ Serializing to and from Maps can be accomplished by defining any of the following methods:
+</p>
+<ul>
+ <li><c><jk>public</jk> Map toMap()</c> method. Can be any type of map with string keys and object vals.
+ <li><c><jk>public</jk> ObjectMap toMap()</c> method.
+ <li><c><jk>public</jk> Map toMap(BeanSession)</c> method. Can be any type of map with string keys and object vals.
+ <li><c><jk>public</jk> ObjectMap toMap(BeanSession)</c> method.
+ <li><c><jk>public static</jk> MyPojo fromMap(Map)</c> method. Can be any type of map with string keys and object vals.
+ <li><c><jk>public static</jk> MyPojo fromMap(ObjectMap)</c> method.
+ <li><c><jk>public static</jk> MyPojo fromMap(Map,BeanSession)</c> method. Can be any type of map with string keys and object vals.
+ <li><c><jk>public static</jk> MyPojo fromMap(ObjectMap,BeanSession)</c> method.
+</ul>
+<p>
+ The <c>BeanSession</c> parameter allows you access to various information about the current
+ serialization session.
+ For example, you could provide customized results based on the media type being produced
+ ({@link org.apache.juneau.BeanSession#getMediaType()}).
+</p>
+<p>
+ The following example shows how an HTML5 form template object can be created that gets serialized as a
+ populated HTML5 {@link org.apache.juneau.dto.html5.Form} bean.
+</p>
+<p class='bpcode w800'>
+ <jk>import static</jk> org.apache.juneau.dto.html5.HtmlBuilder.*;
+
+ <jd>/**
+ * A simple HTML form template whose serialized form is an HTML5 Form object.
+ */</jd>
+ <jk>public class</jk> FormTemplate {
+
+ <jk>private</jk> String <jf>action</jf>;
+ <jk>private int</jk> <jf>value1</jf>;
+ <jk>private boolean</jk> <jf>value2</jf>;
+
+ <jc>// Some constructor that initializes our fields. </jc>
+ <jk>public</jk> FormTemplate(String action, <jk>int</jk> value1, <jk>boolean</jk> value2) {
+ <jk>this</jk>.<jf>action</jf> = action;
+ <jk>this</jk>.<jf>value1</jf> = value1;
+ <jk>this</jk>.<jf>value2</jf> = value2;
+ }
+
+ <jc>// Special swap method that converts this template to a serializable bean</jc>
+ <jk>public</jk> Form swap(BeanSession session) {
+ <jk>return</jk> <jsm>form</jsm>(<jf>action</jf>,
+ <jsm>input</jsm>(<js>"text"</js>).name(<js>"v1"</js>).value(<jf>value1</jf>),
+ <jsm>input</jsm>(<js>"text"</js>).name(<js>"v2"</js>).value(<jf>value2</jf>)
+ );
+ }
+ }
+</p>
+<p>
+ Swapped objects can be converted back into their original form by the parsers by specifying one of the
+ following methods:
+</p>
+<ul>
+ <li><c><jk>public static</jk> T unswap(BeanSession, X)</c> method where <c>X</c> is the
+ swap class type.
+ <li><c><jk>public</jk> T(X)</c> constructor where <c>X</c> is the swap class type.
+</ul>
+<p>
+ The following shows how our form template class can be modified to allow the parsers to reconstruct our
+ original object:
+</p>
+<p class='bpcode w800'>
+ <jk>import static</jk> org.apache.juneau.dto.html5.HtmlBuilder.*;
+
+ <jd>/**
+ * A simple HTML form template whose serialized form is an HTML5 Form object.
+ * This time with parsing support.
+ */</jd>
+ <ja>@Bean</ja>(beanDictionary=HtmlBeanDictionary.<jk>class</jk>)
+ <jk>public class</jk> FormTemplate {
+
+ <jk>private</jk> String <jf>action</jf>;
+ <jk>private int</jk> <jf>value1</jf>;
+ <jk>private boolean</jk> <jf>value2</jf>;
+
+ <jc>// Our 'unswap' constructor</jc>
+ <jk>public</jk> FormTemplate(Form f) {
+ <jk>this</jk>.<jf>action</jf> = f.getAttr(<js>"action"</js>);
+ <jk>this</jk>.<jf>value1</jf> = f.getChild(Input.<jk>class</jk>, 0)
+ .getAttr(<jk>int</jk>.<jk>class</jk>, <js>"value"</js>);
+ <jk>this</jk>.<jf>value2</jf> = f.getChild(Input.<jk>class</jk>, 1)
+ .getAttr(<jk>boolean</jk>.<jk>class</jk>, <js>"value"</js>);
+ }
+
+ <jk>public</jk> FormTemplate(String action, <jk>int</jk> value1, <jk>boolean</jk> value2) {
+ <jk>this</jk>.<jf>action</jf> = action;
+ <jk>this</jk>.<jf>value1</jf> = value1;
+ <jk>this</jk>.<jf>value2</jf> = value2;
+ }
+
+ <jk>public</jk> Form swap(BeanSession session) {
+ <jk>return</jk> <jsm>form</jsm>(<jf>action</jf>,
+ <jsm>input</jsm>(<js>"text"</js>).name(<js>"v1"</js>).value(<jf>value1</jf>),
+ <jsm>input</jsm>(<js>"text"</js>).name(<js>"v2"</js>).value(<jf>value2</jf>)
+ );
+ }
+ }
+</p>
+</div><!-- END: 2.11.3 - juneau-marshall.Transforms.AutoPojoSwaps -->
+
+<!-- ==================================================================================================== -->
+
+<h4 class='topic updated' onclick='toggle(this)'><a href='#juneau-marshall.Transforms.PerMediaTypePojoSwaps' id='juneau-marshall.Transforms.PerMediaTypePojoSwaps'>2.11.4 - Per-media-type PojoSwaps</a></h4>
+<div class='topic'><!-- START: 2.11.4 - juneau-marshall.Transforms.PerMediaTypePojoSwaps -->
<p>
Swaps can also be defined per-media-type.
</p>
@@ -2277,12 +2437,12 @@
<ja>@Swap</ja>(mediaTypes=<js>"*/*"</js>)
<jk>public static class</jk> MyOtherSwap <jk>extends</jk> PojoSwap<MyPojo,String> {...}
</p>
-</div><!-- END: 2.11.3 - juneau-marshall.Transforms.PerMediaTypePojoSwaps -->
+</div><!-- END: 2.11.4 - juneau-marshall.Transforms.PerMediaTypePojoSwaps -->
<!-- ==================================================================================================== -->
-<h4 class='topic ' onclick='toggle(this)'><a href='#juneau-marshall.Transforms.OneWayPojoSwaps' id='juneau-marshall.Transforms.OneWayPojoSwaps'>2.11.4 - One-way PojoSwaps</a></h4>
-<div class='topic'><!-- START: 2.11.4 - juneau-marshall.Transforms.OneWayPojoSwaps -->
+<h4 class='topic ' onclick='toggle(this)'><a href='#juneau-marshall.Transforms.OneWayPojoSwaps' id='juneau-marshall.Transforms.OneWayPojoSwaps'>2.11.5 - One-way PojoSwaps</a></h4>
+<div class='topic'><!-- START: 2.11.5 - juneau-marshall.Transforms.OneWayPojoSwaps -->
<p>
In the previous sections, we defined two-way swaps, meaning swaps where the original objects could be
reconstructing during parsing.
@@ -2329,12 +2489,12 @@
ReaderParser p = JsonParser.<jsm>create</jsm>().pojoSwaps(IteratorSwap.<jk>class</jk>).build();
i = p.parse(s, Iterator.<jk>class</jk>); <jc>// Throws ParseException!!!</jc>
</p>
-</div><!-- END: 2.11.4 - juneau-marshall.Transforms.OneWayPojoSwaps -->
+</div><!-- END: 2.11.5 - juneau-marshall.Transforms.OneWayPojoSwaps -->
<!-- ==================================================================================================== -->
-<h4 class='topic ' onclick='toggle(this)'><a href='#juneau-marshall.Transforms.SwapAnnotation' id='juneau-marshall.Transforms.SwapAnnotation'>2.11.5 - @Swap Annotation</a></h4>
-<div class='topic'><!-- START: 2.11.5 - juneau-marshall.Transforms.SwapAnnotation -->
+<h4 class='topic ' onclick='toggle(this)'><a href='#juneau-marshall.Transforms.SwapAnnotation' id='juneau-marshall.Transforms.SwapAnnotation'>2.11.6 - @Swap Annotation</a></h4>
+<div class='topic'><!-- START: 2.11.6 - juneau-marshall.Transforms.SwapAnnotation -->
<p>
{@link org.apache.juneau.annotation.Swap @Swap} can be used to associate a swap class using an
annotation.
@@ -2422,12 +2582,12 @@
}
}
</p>
-</div><!-- END: 2.11.5 - juneau-marshall.Transforms.SwapAnnotation -->
+</div><!-- END: 2.11.6 - juneau-marshall.Transforms.SwapAnnotation -->
<!-- ==================================================================================================== -->
-<h4 class='topic ' onclick='toggle(this)'><a href='#juneau-marshall.Transforms.TemplatedSwaps' id='juneau-marshall.Transforms.TemplatedSwaps'>2.11.6 - Templated Swaps</a></h4>
-<div class='topic'><!-- START: 2.11.6 - juneau-marshall.Transforms.TemplatedSwaps -->
+<h4 class='topic ' onclick='toggle(this)'><a href='#juneau-marshall.Transforms.TemplatedSwaps' id='juneau-marshall.Transforms.TemplatedSwaps'>2.11.7 - Templated Swaps</a></h4>
+<div class='topic'><!-- START: 2.11.7 - juneau-marshall.Transforms.TemplatedSwaps -->
<p>
The {@link org.apache.juneau.annotation.Swap#template() @Swap(template)} annotation allows you to associate
arbitrary contextual strings with swaps.
@@ -2461,166 +2621,7 @@
}
}
</p>
-</div><!-- END: 2.11.6 - juneau-marshall.Transforms.TemplatedSwaps -->
-
-<!-- ==================================================================================================== -->
-
-<h4 class='topic updated' onclick='toggle(this)'><a href='#juneau-marshall.Transforms.SwapMethods' id='juneau-marshall.Transforms.SwapMethods'>2.11.7 - Swap Methods</a></h4>
-<div class='topic'><!-- START: 2.11.7 - juneau-marshall.Transforms.SwapMethods -->
-<p>
- Various methods can be defined on a class directly to affect how it gets serialized.
- This can often be simpler than using <c>PojoSwaps</c>.
-</p>
-<p>
- Objects serialized as <c>Strings</c> can be parsed back into their original objects by
- implementing one of the following methods on the class:
-</p>
-<ul class='spaced-list'>
- <li>
- <c><jk>public static</jk> T fromString(String)</c> method.
- <br>Any of the following method names also work:
- <ul>
- <li><c>valueOf(String)</c>
- <li><c>parse(String)</c>
- <li><c>parseString(String)</c>
- <li><c>forName(String)</c>
- <li><c>forString(String)</c>
- </ul>
- <li>
- <c><jk>public</jk> T(String)</c> constructor.
-</ul>
-<p>
- Note that these methods cover conversion from several built-in Java types, meaning the parsers can
- automatically construct these objects from strings:
-</p>
-<ul>
- <li><c>fromString(String)</c> - {@link java.util.UUID}
- <li><c>valueOf(String)</c> - {@link java.lang.Boolean}, {@link java.lang.Byte},
- {@link java.lang.Double}, {@link java.lang.Float},
- {@link java.lang.Integer}, {@link java.lang.Long}, {@link java.lang.Short}, {@link java.sql.Date},
- {@link java.sql.Time}, {@link java.sql.Timestamp}
- <li><c>parse(String)</c> - {@link java.text.DateFormat}, {@link java.text.MessageFormat},
- {@link java.text.NumberFormat}, {@link java.util.Date}, {@link java.util.logging.Level}
- <li><c>parseString(String)</c> - {@link javax.xml.bind.DatatypeConverter}
- <li><c>forName(String)</c> - {@link java.lang.Class}
-</ul>
-<p>
- If you want to force a bean-like class to be serialized as a string, you can use the
- {@link org.apache.juneau.annotation.BeanIgnore @BeanIgnore} annotation on the class to force it to be
- serialized to a string using the <c>toString()</c> method.
-</p>
-<p>
- Serializing to other intermediate objects can be accomplished by defining a swap method directly on the
- class:
-</p>
-<ul>
- <li><c><jk>public</jk> X swap()</c> method, where <c>X</c> is any serializable object.
- <li><c><jk>public</jk> X swap(BeanSession)</c> method, where <c>X</c> is any serializable object.
- <li><c><jk>public static</jk> MyPojo unswap(X)</c> method, where <c>X</c> is any serializable object.
- <li><c><jk>public static</jk> MyPojo swap(X,BeanSession)</c> method, where <c>X</c> is any serializable object.
-</ul>
-<p>
- Serializing to and from Maps can be accomplished by defining any of the following methods:
-</p>
-<ul>
- <li><c><jk>public</jk> Map toMap()</c> method. Can be any type of map with string keys and object vals.
- <li><c><jk>public</jk> ObjectMap toMap()</c> method.
- <li><c><jk>public</jk> Map toMap(BeanSession)</c> method. Can be any type of map with string keys and object vals.
- <li><c><jk>public</jk> ObjectMap toMap(BeanSession)</c> method.
- <li><c><jk>public static</jk> MyPojo fromMap(Map)</c> method. Can be any type of map with string keys and object vals.
- <li><c><jk>public static</jk> MyPojo fromMap(ObjectMap)</c> method.
- <li><c><jk>public static</jk> MyPojo fromMap(Map,BeanSession)</c> method. Can be any type of map with string keys and object vals.
- <li><c><jk>public static</jk> MyPojo fromMap(ObjectMap,BeanSession)</c> method.
-</ul>
-<p>
- The <c>BeanSession</c> parameter allows you access to various information about the current
- serialization session.
- For example, you could provide customized results based on the media type being produced
- ({@link org.apache.juneau.BeanSession#getMediaType()}).
-</p>
-<p>
- The following example shows how an HTML5 form template object can be created that gets serialized as a
- populated HTML5 {@link org.apache.juneau.dto.html5.Form} bean.
-</p>
-<p class='bpcode w800'>
- <jk>import static</jk> org.apache.juneau.dto.html5.HtmlBuilder.*;
-
- <jd>/**
- * A simple HTML form template whose serialized form is an HTML5 Form object.
- */</jd>
- <jk>public class</jk> FormTemplate {
-
- <jk>private</jk> String <jf>action</jf>;
- <jk>private int</jk> <jf>value1</jf>;
- <jk>private boolean</jk> <jf>value2</jf>;
-
- <jc>// Some constructor that initializes our fields. </jc>
- <jk>public</jk> FormTemplate(String action, <jk>int</jk> value1, <jk>boolean</jk> value2) {
- <jk>this</jk>.<jf>action</jf> = action;
- <jk>this</jk>.<jf>value1</jf> = value1;
- <jk>this</jk>.<jf>value2</jf> = value2;
- }
-
- <jc>// Special swap method that converts this template to a serializable bean</jc>
- <jk>public</jk> Form swap(BeanSession session) {
- <jk>return</jk> <jsm>form</jsm>(<jf>action</jf>,
- <jsm>input</jsm>(<js>"text"</js>).name(<js>"v1"</js>).value(<jf>value1</jf>),
- <jsm>input</jsm>(<js>"text"</js>).name(<js>"v2"</js>).value(<jf>value2</jf>)
- );
- }
- }
-</p>
-<p>
- Swapped objects can be converted back into their original form by the parsers by specifying one of the
- following methods:
-</p>
-<ul>
- <li><c><jk>public static</jk> T unswap(BeanSession, X)</c> method where <c>X</c> is the
- swap class type.
- <li><c><jk>public</jk> T(X)</c> constructor where <c>X</c> is the swap class type.
-</ul>
-<p>
- The following shows how our form template class can be modified to allow the parsers to reconstruct our
- original object:
-</p>
-<p class='bpcode w800'>
- <jk>import static</jk> org.apache.juneau.dto.html5.HtmlBuilder.*;
-
- <jd>/**
- * A simple HTML form template whose serialized form is an HTML5 Form object.
- * This time with parsing support.
- */</jd>
- <ja>@Bean</ja>(beanDictionary=HtmlBeanDictionary.<jk>class</jk>)
- <jk>public class</jk> FormTemplate {
-
- <jk>private</jk> String <jf>action</jf>;
- <jk>private int</jk> <jf>value1</jf>;
- <jk>private boolean</jk> <jf>value2</jf>;
-
- <jc>// Our 'unswap' constructor</jc>
- <jk>public</jk> FormTemplate(Form f) {
- <jk>this</jk>.<jf>action</jf> = f.getAttr(<js>"action"</js>);
- <jk>this</jk>.<jf>value1</jf> = f.getChild(Input.<jk>class</jk>, 0)
- .getAttr(<jk>int</jk>.<jk>class</jk>, <js>"value"</js>);
- <jk>this</jk>.<jf>value2</jf> = f.getChild(Input.<jk>class</jk>, 1)
- .getAttr(<jk>boolean</jk>.<jk>class</jk>, <js>"value"</js>);
- }
-
- <jk>public</jk> FormTemplate(String action, <jk>int</jk> value1, <jk>boolean</jk> value2) {
- <jk>this</jk>.<jf>action</jf> = action;
- <jk>this</jk>.<jf>value1</jf> = value1;
- <jk>this</jk>.<jf>value2</jf> = value2;
- }
-
- <jk>public</jk> Form swap(BeanSession session) {
- <jk>return</jk> <jsm>form</jsm>(<jf>action</jf>,
- <jsm>input</jsm>(<js>"text"</js>).name(<js>"v1"</js>).value(<jf>value1</jf>),
- <jsm>input</jsm>(<js>"text"</js>).name(<js>"v2"</js>).value(<jf>value2</jf>)
- );
- }
- }
-</p>
-</div><!-- END: 2.11.7 - juneau-marshall.Transforms.SwapMethods -->
+</div><!-- END: 2.11.7 - juneau-marshall.Transforms.TemplatedSwaps -->
<!-- ==================================================================================================== -->
diff --git a/juneau-doc/src/main/javadoc/resources/docs.txt b/juneau-doc/src/main/javadoc/resources/docs.txt
index 9fe1251..06c0958 100644
--- a/juneau-doc/src/main/javadoc/resources/docs.txt
+++ b/juneau-doc/src/main/javadoc/resources/docs.txt
@@ -172,6 +172,7 @@ juneau-marshall.ReadingContinuousStreams = #juneau-marshall.ReadingContinuousStr
juneau-marshall.Recursion = #juneau-marshall.Recursion, Overview > juneau-marshall > Non-Tree Models and Recursion Detection
juneau-marshall.Serializers = #juneau-marshall.Serializers, Overview > juneau-marshall > Serializers
juneau-marshall.Transforms = #juneau-marshall.Transforms, Overview > juneau-marshall > Transforms
+juneau-marshall.Transforms.AutoPojoSwaps = #juneau-marshall.Transforms.AutoPojoSwaps, Overview > juneau-marshall > Transforms > Auto-detected POJO swaps
juneau-marshall.Transforms.BeanAnnotation = #juneau-marshall.Transforms.BeanAnnotation, Overview > juneau-marshall > Transforms > @Bean Annotation
juneau-marshall.Transforms.BeanConstructorAnnotation = #juneau-marshall.Transforms.BeanConstructorAnnotation, Overview > juneau-marshall > Transforms > @BeanConstructor Annotation
juneau-marshall.Transforms.BeanFilters = #juneau-marshall.Transforms.BeanFilters, Overview > juneau-marshall > Transforms > BeanFilter Class
@@ -189,7 +190,6 @@ juneau-marshall.Transforms.PojoSwaps = #juneau-marshall.Transforms.PojoSwaps, Ov
juneau-marshall.Transforms.StopClasses = #juneau-marshall.Transforms.StopClasses, Overview > juneau-marshall > Transforms > Stop Classes
juneau-marshall.Transforms.SurrogateClasses = #juneau-marshall.Transforms.SurrogateClasses, Overview > juneau-marshall > Transforms > Surrogate Classes
juneau-marshall.Transforms.SwapAnnotation = #juneau-marshall.Transforms.SwapAnnotation, Overview > juneau-marshall > Transforms > @Swap Annotation
-juneau-marshall.Transforms.SwapMethods = #juneau-marshall.Transforms.SwapMethods, Overview > juneau-marshall > Transforms > Swap Methods
juneau-marshall.Transforms.TemplatedSwaps = #juneau-marshall.Transforms.TemplatedSwaps, Overview > juneau-marshall > Transforms > Templated Swaps
juneau-marshall.URIs = #juneau-marshall.URIs, Overview > juneau-marshall > URIs
juneau-marshall.UonDetails = #juneau-marshall.UonDetails, Overview > juneau-marshall > UON Details
diff --git a/juneau-doc/src/main/javadoc/resources/fragments/toc.html b/juneau-doc/src/main/javadoc/resources/fragments/toc.html
index 6e4864f..41c7c83 100644
--- a/juneau-doc/src/main/javadoc/resources/fragments/toc.html
+++ b/juneau-doc/src/main/javadoc/resources/fragments/toc.html
@@ -38,12 +38,12 @@
<li><p class=''><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms'>Transforms</a></p>
<ol>
<li><p class='updated'><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms.PojoSwaps'>PojoSwaps</a></p>
- <li><p class='new'><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms.DefaultPojoSwaps'>Default PojoSwaps</a></p>
+ <li><p class=''><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms.DefaultPojoSwaps'>Default PojoSwaps</a></p>
+ <li><p class='new'><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms.AutoPojoSwaps'>Auto-detected POJO swaps</a></p>
<li><p class='updated'><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms.PerMediaTypePojoSwaps'>Per-media-type PojoSwaps</a></p>
<li><p class=''><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms.OneWayPojoSwaps'>One-way PojoSwaps</a></p>
<li><p class=''><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms.SwapAnnotation'>@Swap Annotation</a></p>
<li><p class=''><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms.TemplatedSwaps'>Templated Swaps</a></p>
- <li><p class='updated'><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms.SwapMethods'>Swap Methods</a></p>
<li><p class=''><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms.SurrogateClasses'>Surrogate Classes</a></p>
<li><p class=''><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms.BeanAnnotation'>@Bean Annotation</a></p>
<li><p class='updated'><a class='doclink' href='{OVERVIEW_URL}#juneau-marshall.Transforms.BeanPropertyAnnotation'>@BeanProperty Annotation</a></p>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestProperties.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestProperties.java
index d75acc2..be23b63 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestProperties.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestProperties.java
@@ -29,7 +29,7 @@ import org.apache.juneau.svl.*;
*
* <h5 class='section'>See Also:</h5>
* <ul>
- * <li class='link'>{@doc juneau-rest-server.Properties}
+ * <li class='link'>{@doc juneau-rest-server.ConfigurableProperties}
* </ul>
* @deprecated Use {@link RequestAttributes}
*/
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextProperties.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextProperties.java
index 9260f3f..bcc2548 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextProperties.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextProperties.java
@@ -30,7 +30,7 @@ import org.apache.juneau.rest.annotation.*;
*
* <h5 class='section'>See Also:</h5>
* <ul>
- * <li class='link'>{@doc juneau-rest-server.Properties}
+ * <li class='link'>{@doc juneau-rest-server.ConfigurableProperties}
* </ul>
*/
@SuppressWarnings("serial")
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodProperties.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodProperties.java
index 35d0fb8..a5f723e 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodProperties.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodProperties.java
@@ -27,7 +27,7 @@ import org.apache.juneau.rest.annotation.*;
*
* <h5 class='section'>See Also:</h5>
* <ul>
- * <li class='link'>{@doc juneau-rest-server.Properties}
+ * <li class='link'>{@doc juneau-rest-server.ConfigurableProperties}
* </ul>
* @deprecated Use {@link RequestAttributes}
*/
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestRequest.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestRequest.java
index 3f97b3c..cf9cb00 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestRequest.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestRequest.java
@@ -276,7 +276,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
* <h5 class='section'>See Also:</h5>
* <ul>
* <li class='jm'>{@link #prop(String, Object)}
- * <li class='link'>{@doc juneau-rest-server.Properties}
+ * <li class='link'>{@doc juneau-rest-server.ConfigurableProperties}
* </ul>
*
* @return The properties active for this request.
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResponse.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResponse.java
index b6eee16..72a51eb 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResponse.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResponse.java
@@ -287,7 +287,7 @@ public final class RestResponse extends HttpServletResponseWrapper {
* <h5 class='section'>See Also:</h5>
* <ul>
* <li class='jm'>{@link #prop(String, Object)}
- * <li class='link'>{@doc juneau-rest-server.Properties}
+ * <li class='link'>{@doc juneau-rest-server.ConfigurableProperties}
* </ul>
*
* @return The properties active for this request.
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Property.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Property.java
index 1f127b9..9f865f9 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Property.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Property.java
@@ -29,7 +29,7 @@ import java.lang.annotation.*;
*
* <h5 class='section'>See Also:</h5>
* <ul>
- * <li class='link'>{@doc juneau-rest-server.Properties}
+ * <li class='link'>{@doc juneau-rest-server.ConfigurableProperties}
* </ul>
*/
@Documented