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 2017/09/10 20:33:04 UTC
incubator-juneau-website git commit: Update javadocs.
Repository: incubator-juneau-website
Updated Branches:
refs/heads/asf-site 62afb533d -> 294a19efa
Update javadocs.
Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/commit/294a19ef
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/tree/294a19ef
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/diff/294a19ef
Branch: refs/heads/asf-site
Commit: 294a19efa06585c45914aed39e69e873085d249b
Parents: 62afb53
Author: JamesBognar <ja...@apache.org>
Authored: Sun Sep 10 16:33:01 2017 -0400
Committer: JamesBognar <ja...@apache.org>
Committed: Sun Sep 10 16:33:01 2017 -0400
----------------------------------------------------------------------
.../org/apache/juneau/annotation/Swap.html | 359 +++++++++++++++++++
.../org/apache/juneau/annotation/Swaps.html | 233 ++++++++++++
.../org/apache/juneau/transform/Surrogate.html | 280 +++++++++++++++
.../org/apache/juneau/annotation/Swap.html | 192 ++++++++++
.../org/apache/juneau/annotation/Swaps.html | 116 ++++++
.../org/apache/juneau/transform/Surrogate.html | 206 +++++++++++
6 files changed, 1386 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/294a19ef/content/site/apidocs/org/apache/juneau/annotation/Swap.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/org/apache/juneau/annotation/Swap.html b/content/site/apidocs/org/apache/juneau/annotation/Swap.html
new file mode 100644
index 0000000..1f352a6
--- /dev/null
+++ b/content/site/apidocs/org/apache/juneau/annotation/Swap.html
@@ -0,0 +1,359 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!-- NewPage -->
+<html lang="en">
+<head>
+<!-- Generated by javadoc -->
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Swap (Apache Juneau (incubating) 6.3.2-incubating-SNAPSHOT)</title>
+<link rel="stylesheet" type="text/css" href="../../../../javadoc.css" title="Style">
+<script type="text/javascript" src="../../../../script.js"></script>
+</head>
+<body>
+<script type="text/javascript"><!--
+ try {
+ if (location.href.indexOf('is-external=true') == -1) {
+ parent.document.title="Swap (Apache Juneau (incubating) 6.3.2-incubating-SNAPSHOT)";
+ }
+ }
+ catch(err) {
+ }
+//-->
+</script>
+<noscript>
+<div>JavaScript is disabled on your browser.</div>
+</noscript>
+<!-- ========= START OF TOP NAVBAR ======= -->
+<div class="topNav"><a name="navbar.top">
+<!-- -->
+</a>
+<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
+<a name="navbar.top.firstrow">
+<!-- -->
+</a>
+<ul class="navList" title="Navigation">
+<li><a href="../../../../overview-summary.html">Overview</a></li>
+<li><a href="package-summary.html">Package</a></li>
+<li class="navBarCell1Rev">Class</li>
+<li><a href="package-tree.html">Tree</a></li>
+<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
+<li><a href="../../../../index-all.html">Index</a></li>
+<li><a href="../../../../help-doc.html">Help</a></li>
+</ul>
+</div>
+<div class="subNav">
+<ul class="navList">
+<li><a href="../../../../org/apache/juneau/annotation/ParentProperty.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">Prev Class</span></a></li>
+<li><a href="../../../../org/apache/juneau/annotation/Swaps.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">Next Class</span></a></li>
+</ul>
+<ul class="navList">
+<li><a href="../../../../index.html?org/apache/juneau/annotation/Swap.html" target="_top">Frames</a></li>
+<li><a href="Swap.html" target="_top">No Frames</a></li>
+</ul>
+<ul class="navList" id="allclasses_navbar_top">
+<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
+</ul>
+<div>
+<script type="text/javascript"><!--
+ allClassesLink = document.getElementById("allclasses_navbar_top");
+ if(window==top) {
+ allClassesLink.style.display = "block";
+ }
+ else {
+ allClassesLink.style.display = "none";
+ }
+ //-->
+</script>
+</div>
+<div>
+<ul class="subNavList">
+<li>Summary: </li>
+<li>Field | </li>
+<li>Required | </li>
+<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
+</ul>
+<ul class="subNavList">
+<li>Detail: </li>
+<li>Field | </li>
+<li><a href="#annotation.type.element.detail">Element</a></li>
+</ul>
+</div>
+<a name="skip.navbar.top">
+<!-- -->
+</a></div>
+<!-- ========= END OF TOP NAVBAR ========= -->
+<!-- ======== START OF CLASS DATA ======== -->
+<div class="header">
+<div class="subTitle">org.apache.juneau.annotation</div>
+<h2 title="Annotation Type Swap" class="title">Annotation Type Swap</h2>
+</div>
+<div class="contentContainer">
+<div class="description">
+<ul class="blockList">
+<li class="blockList">
+<hr>
+<br>
+<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Documented.html?is-external=true" title="class or interface in java.lang.annotation">@Documented</a>
+ <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/ElementType.html?is-external=true#ANNOTATION_TYPE" title="class or interface in java.lang.annotation">ANNOTATION_TYPE</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="clas
s 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/Swap.html#line.51">Swap</a></pre>
+<div class="block">Associates <a href="../../../../org/apache/juneau/transform/PojoSwap.html" title="class in org.apache.juneau.transform"><code>PojoSwap</code></a> and <a href="../../../../org/apache/juneau/transform/Surrogate.html" title="interface in org.apache.juneau.transform"><code>Surrogate</code></a> classes with POJOs and bean properties.
+
+ <p>
+ A typical example is 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 formatted string:
+
+ <h5 class='section'>Example:</h5>
+ <p class='bcode'>
+ <jk>public class</jk> MyClass {
+
+ <jc>// During serialization, convert to ISO8601 date-time string.</jc>
+ <ja>@Swap</ja>(CalendarSwap.ISO8601DT.<jk>class</jk>)
+ <jk>public</jk> Calendar getTime();
+ }
+ </p>
+
+ <p>
+ This annotation can be used in the following locations:
+ <ul>
+ <li>Classes.
+ <li>Bean getters/setters/fields.
+ <li>Inside the <a href="../../../../org/apache/juneau/annotation/Swaps.html" title="annotation in org.apache.juneau.annotation"><code>@Swaps</code></a> annotation.
+ </ul></div>
+</li>
+</ul>
+</div>
+<div class="summary">
+<ul class="blockList">
+<li class="blockList">
+<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
+<ul class="blockList">
+<li class="blockList"><a name="annotation.type.optional.element.summary">
+<!-- -->
+</a>
+<h3>Optional Element Summary</h3>
+<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation">
+<caption><span>Optional Elements</span><span class="tabEnd"> </span></caption>
+<tr>
+<th class="colFirst" scope="col">Modifier and Type</th>
+<th class="colLast" scope="col">Optional Element and Description</th>
+</tr>
+<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/Swap.html#impl--">impl</a></span></code>
+<div class="block">The <a href="../../../../org/apache/juneau/transform/PojoSwap.html" title="class in org.apache.juneau.transform"><code>PojoSwap</code></a> and <a href="../../../../org/apache/juneau/transform/Surrogate.html" title="interface in org.apache.juneau.transform"><code>Surrogate</code></a> class.</div>
+</td>
+</tr>
+<tr class="rowColor">
+<td class="colFirst"><code><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>[]</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/juneau/annotation/Swap.html#mediaTypes--">mediaTypes</a></span></code>
+<div class="block">Identifies the media types that this swap is applicable for.</div>
+</td>
+</tr>
+<tr class="altColor">
+<td class="colFirst"><code><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></code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/juneau/annotation/Swap.html#template--">template</a></span></code>
+<div class="block">Identifies a template string along with this swap.</div>
+</td>
+</tr>
+<tr class="rowColor">
+<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/Swap.html#value--">value</a></span></code>
+<div class="block">The <a href="../../../../org/apache/juneau/transform/PojoSwap.html" title="class in org.apache.juneau.transform"><code>PojoSwap</code></a> and <a href="../../../../org/apache/juneau/transform/Surrogate.html" title="interface in org.apache.juneau.transform"><code>Surrogate</code></a> class.</div>
+</td>
+</tr>
+</table>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="details">
+<ul class="blockList">
+<li class="blockList">
+<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
+<ul class="blockList">
+<li class="blockList"><a name="annotation.type.element.detail">
+<!-- -->
+</a>
+<h3>Element Detail</h3>
+<a name="value--">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>value</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/Swap.html#line.59">value</a></pre>
+<div class="block">The <a href="../../../../org/apache/juneau/transform/PojoSwap.html" title="class in org.apache.juneau.transform"><code>PojoSwap</code></a> and <a href="../../../../org/apache/juneau/transform/Surrogate.html" title="interface in org.apache.juneau.transform"><code>Surrogate</code></a> class.
+
+ <p>
+ A synonym for <a href="../../../../org/apache/juneau/annotation/Swap.html#impl--"><code>impl()</code></a>.</div>
+<dl>
+<dt>Default:</dt>
+<dd>org.apache.juneau.annotation.Null.class</dd>
+</dl>
+</li>
+</ul>
+</li>
+</ul>
+<ul class="blockList">
+<li class="blockList"><a name="impl--">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>impl</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/Swap.html#line.67">impl</a></pre>
+<div class="block">The <a href="../../../../org/apache/juneau/transform/PojoSwap.html" title="class in org.apache.juneau.transform"><code>PojoSwap</code></a> and <a href="../../../../org/apache/juneau/transform/Surrogate.html" title="interface in org.apache.juneau.transform"><code>Surrogate</code></a> class.
+
+ <p>
+ A synonym for <a href="../../../../org/apache/juneau/annotation/Swap.html#value--"><code>value()</code></a>.</div>
+<dl>
+<dt>Default:</dt>
+<dd>org.apache.juneau.annotation.Null.class</dd>
+</dl>
+</li>
+</ul>
+</li>
+</ul>
+<ul class="blockList">
+<li class="blockList"><a name="template--">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>template</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/Swap.html#line.100">template</a></pre>
+<div class="block">Identifies a template string along with this swap.
+
+ <p>
+ Template strings are arbitrary strings associated with swaps that help provide additional context information
+ for the swap class.
+ They're called 'templates' because their primary purpose is for providing template names, such as Apache FreeMarker
+ template names.
+
+ <p>
+ 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></div>
+<dl>
+<dt>Default:</dt>
+<dd>""</dd>
+</dl>
+</li>
+</ul>
+</li>
+</ul>
+<ul class="blockList">
+<li class="blockList"><a name="mediaTypes--">
+<!-- -->
+</a>
+<ul class="blockListLast">
+<li class="blockList">
+<h4>mediaTypes</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/Swap.html#line.119">mediaTypes</a></pre>
+<div class="block">Identifies the media types that this swap is applicable for.
+
+ <p>
+ In the following example, the swap is only invoked by the JSON serializer:
+
+ <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></div>
+<dl>
+<dt>Default:</dt>
+<dd>{}</dd>
+</dl>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+<!-- ========= END OF CLASS DATA ========= -->
+<!-- ======= START OF BOTTOM NAVBAR ====== -->
+<div class="bottomNav"><a name="navbar.bottom">
+<!-- -->
+</a>
+<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
+<a name="navbar.bottom.firstrow">
+<!-- -->
+</a>
+<ul class="navList" title="Navigation">
+<li><a href="../../../../overview-summary.html">Overview</a></li>
+<li><a href="package-summary.html">Package</a></li>
+<li class="navBarCell1Rev">Class</li>
+<li><a href="package-tree.html">Tree</a></li>
+<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
+<li><a href="../../../../index-all.html">Index</a></li>
+<li><a href="../../../../help-doc.html">Help</a></li>
+</ul>
+</div>
+<div class="subNav">
+<ul class="navList">
+<li><a href="../../../../org/apache/juneau/annotation/ParentProperty.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">Prev Class</span></a></li>
+<li><a href="../../../../org/apache/juneau/annotation/Swaps.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">Next Class</span></a></li>
+</ul>
+<ul class="navList">
+<li><a href="../../../../index.html?org/apache/juneau/annotation/Swap.html" target="_top">Frames</a></li>
+<li><a href="Swap.html" target="_top">No Frames</a></li>
+</ul>
+<ul class="navList" id="allclasses_navbar_bottom">
+<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
+</ul>
+<div>
+<script type="text/javascript"><!--
+ allClassesLink = document.getElementById("allclasses_navbar_bottom");
+ if(window==top) {
+ allClassesLink.style.display = "block";
+ }
+ else {
+ allClassesLink.style.display = "none";
+ }
+ //-->
+</script>
+</div>
+<div>
+<ul class="subNavList">
+<li>Summary: </li>
+<li>Field | </li>
+<li>Required | </li>
+<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
+</ul>
+<ul class="subNavList">
+<li>Detail: </li>
+<li>Field | </li>
+<li><a href="#annotation.type.element.detail">Element</a></li>
+</ul>
+</div>
+<a name="skip.navbar.bottom">
+<!-- -->
+</a></div>
+<!-- ======== END OF BOTTOM NAVBAR ======= -->
+<p class="legalCopy"><small>Copyright © 2017 <a href="http://www.apache.org/">Apache</a>. All rights reserved.</small></p>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/294a19ef/content/site/apidocs/org/apache/juneau/annotation/Swaps.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/org/apache/juneau/annotation/Swaps.html b/content/site/apidocs/org/apache/juneau/annotation/Swaps.html
new file mode 100644
index 0000000..bdf9dd7
--- /dev/null
+++ b/content/site/apidocs/org/apache/juneau/annotation/Swaps.html
@@ -0,0 +1,233 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!-- NewPage -->
+<html lang="en">
+<head>
+<!-- Generated by javadoc -->
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Swaps (Apache Juneau (incubating) 6.3.2-incubating-SNAPSHOT)</title>
+<link rel="stylesheet" type="text/css" href="../../../../javadoc.css" title="Style">
+<script type="text/javascript" src="../../../../script.js"></script>
+</head>
+<body>
+<script type="text/javascript"><!--
+ try {
+ if (location.href.indexOf('is-external=true') == -1) {
+ parent.document.title="Swaps (Apache Juneau (incubating) 6.3.2-incubating-SNAPSHOT)";
+ }
+ }
+ catch(err) {
+ }
+//-->
+</script>
+<noscript>
+<div>JavaScript is disabled on your browser.</div>
+</noscript>
+<!-- ========= START OF TOP NAVBAR ======= -->
+<div class="topNav"><a name="navbar.top">
+<!-- -->
+</a>
+<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
+<a name="navbar.top.firstrow">
+<!-- -->
+</a>
+<ul class="navList" title="Navigation">
+<li><a href="../../../../overview-summary.html">Overview</a></li>
+<li><a href="package-summary.html">Package</a></li>
+<li class="navBarCell1Rev">Class</li>
+<li><a href="package-tree.html">Tree</a></li>
+<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
+<li><a href="../../../../index-all.html">Index</a></li>
+<li><a href="../../../../help-doc.html">Help</a></li>
+</ul>
+</div>
+<div class="subNav">
+<ul class="navList">
+<li><a href="../../../../org/apache/juneau/annotation/Swap.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">Prev Class</span></a></li>
+<li><a href="../../../../org/apache/juneau/annotation/ThreadSafe.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">Next Class</span></a></li>
+</ul>
+<ul class="navList">
+<li><a href="../../../../index.html?org/apache/juneau/annotation/Swaps.html" target="_top">Frames</a></li>
+<li><a href="Swaps.html" target="_top">No Frames</a></li>
+</ul>
+<ul class="navList" id="allclasses_navbar_top">
+<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
+</ul>
+<div>
+<script type="text/javascript"><!--
+ allClassesLink = document.getElementById("allclasses_navbar_top");
+ if(window==top) {
+ allClassesLink.style.display = "block";
+ }
+ else {
+ allClassesLink.style.display = "none";
+ }
+ //-->
+</script>
+</div>
+<div>
+<ul class="subNavList">
+<li>Summary: </li>
+<li>Field | </li>
+<li>Required | </li>
+<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
+</ul>
+<ul class="subNavList">
+<li>Detail: </li>
+<li>Field | </li>
+<li><a href="#annotation.type.element.detail">Element</a></li>
+</ul>
+</div>
+<a name="skip.navbar.top">
+<!-- -->
+</a></div>
+<!-- ========= END OF TOP NAVBAR ========= -->
+<!-- ======== START OF CLASS DATA ======== -->
+<div class="header">
+<div class="subTitle">org.apache.juneau.annotation</div>
+<h2 title="Annotation Type Swaps" class="title">Annotation Type Swaps</h2>
+</div>
+<div class="contentContainer">
+<div class="description">
+<ul class="blockList">
+<li class="blockList">
+<hr>
+<br>
+<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Documented.html?is-external=true" title="class or interface in java.lang.annotation">@Documented</a>
+ <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/Swaps.html#line.38">Swaps</a></pre>
+<div class="block">Used to associate multiple swaps with the same POJO class.
+
+ <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></div>
+</li>
+</ul>
+</div>
+<div class="summary">
+<ul class="blockList">
+<li class="blockList">
+<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
+<ul class="blockList">
+<li class="blockList"><a name="annotation.type.optional.element.summary">
+<!-- -->
+</a>
+<h3>Optional Element Summary</h3>
+<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation">
+<caption><span>Optional Elements</span><span class="tabEnd"> </span></caption>
+<tr>
+<th class="colFirst" scope="col">Modifier and Type</th>
+<th class="colLast" scope="col">Optional Element and Description</th>
+</tr>
+<tr class="altColor">
+<td class="colFirst"><code><a href="../../../../org/apache/juneau/annotation/Swap.html" title="annotation in org.apache.juneau.annotation">Swap</a>[]</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/juneau/annotation/Swaps.html#value--">value</a></span></code>
+<div class="block">The swaps to apply to this POJO class.</div>
+</td>
+</tr>
+</table>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="details">
+<ul class="blockList">
+<li class="blockList">
+<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
+<ul class="blockList">
+<li class="blockList"><a name="annotation.type.element.detail">
+<!-- -->
+</a>
+<h3>Element Detail</h3>
+<a name="value--">
+<!-- -->
+</a>
+<ul class="blockListLast">
+<li class="blockList">
+<h4>value</h4>
+<pre>public abstract <a href="../../../../org/apache/juneau/annotation/Swap.html" title="annotation in org.apache.juneau.annotation">Swap</a>[] <a href="../../../../src-html/org/apache/juneau/annotation/Swaps.html#line.43">value</a></pre>
+<div class="block">The swaps to apply to this POJO class.</div>
+<dl>
+<dt>Default:</dt>
+<dd>{}</dd>
+</dl>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+<!-- ========= END OF CLASS DATA ========= -->
+<!-- ======= START OF BOTTOM NAVBAR ====== -->
+<div class="bottomNav"><a name="navbar.bottom">
+<!-- -->
+</a>
+<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
+<a name="navbar.bottom.firstrow">
+<!-- -->
+</a>
+<ul class="navList" title="Navigation">
+<li><a href="../../../../overview-summary.html">Overview</a></li>
+<li><a href="package-summary.html">Package</a></li>
+<li class="navBarCell1Rev">Class</li>
+<li><a href="package-tree.html">Tree</a></li>
+<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
+<li><a href="../../../../index-all.html">Index</a></li>
+<li><a href="../../../../help-doc.html">Help</a></li>
+</ul>
+</div>
+<div class="subNav">
+<ul class="navList">
+<li><a href="../../../../org/apache/juneau/annotation/Swap.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">Prev Class</span></a></li>
+<li><a href="../../../../org/apache/juneau/annotation/ThreadSafe.html" title="annotation in org.apache.juneau.annotation"><span class="typeNameLink">Next Class</span></a></li>
+</ul>
+<ul class="navList">
+<li><a href="../../../../index.html?org/apache/juneau/annotation/Swaps.html" target="_top">Frames</a></li>
+<li><a href="Swaps.html" target="_top">No Frames</a></li>
+</ul>
+<ul class="navList" id="allclasses_navbar_bottom">
+<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
+</ul>
+<div>
+<script type="text/javascript"><!--
+ allClassesLink = document.getElementById("allclasses_navbar_bottom");
+ if(window==top) {
+ allClassesLink.style.display = "block";
+ }
+ else {
+ allClassesLink.style.display = "none";
+ }
+ //-->
+</script>
+</div>
+<div>
+<ul class="subNavList">
+<li>Summary: </li>
+<li>Field | </li>
+<li>Required | </li>
+<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
+</ul>
+<ul class="subNavList">
+<li>Detail: </li>
+<li>Field | </li>
+<li><a href="#annotation.type.element.detail">Element</a></li>
+</ul>
+</div>
+<a name="skip.navbar.bottom">
+<!-- -->
+</a></div>
+<!-- ======== END OF BOTTOM NAVBAR ======= -->
+<p class="legalCopy"><small>Copyright © 2017 <a href="http://www.apache.org/">Apache</a>. All rights reserved.</small></p>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/294a19ef/content/site/apidocs/org/apache/juneau/transform/Surrogate.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/org/apache/juneau/transform/Surrogate.html b/content/site/apidocs/org/apache/juneau/transform/Surrogate.html
new file mode 100644
index 0000000..3bac937
--- /dev/null
+++ b/content/site/apidocs/org/apache/juneau/transform/Surrogate.html
@@ -0,0 +1,280 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!-- NewPage -->
+<html lang="en">
+<head>
+<!-- Generated by javadoc -->
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Surrogate (Apache Juneau (incubating) 6.3.2-incubating-SNAPSHOT)</title>
+<link rel="stylesheet" type="text/css" href="../../../../javadoc.css" title="Style">
+<script type="text/javascript" src="../../../../script.js"></script>
+</head>
+<body>
+<script type="text/javascript"><!--
+ try {
+ if (location.href.indexOf('is-external=true') == -1) {
+ parent.document.title="Surrogate (Apache Juneau (incubating) 6.3.2-incubating-SNAPSHOT)";
+ }
+ }
+ catch(err) {
+ }
+//-->
+</script>
+<noscript>
+<div>JavaScript is disabled on your browser.</div>
+</noscript>
+<!-- ========= START OF TOP NAVBAR ======= -->
+<div class="topNav"><a name="navbar.top">
+<!-- -->
+</a>
+<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
+<a name="navbar.top.firstrow">
+<!-- -->
+</a>
+<ul class="navList" title="Navigation">
+<li><a href="../../../../overview-summary.html">Overview</a></li>
+<li><a href="package-summary.html">Package</a></li>
+<li class="navBarCell1Rev">Class</li>
+<li><a href="package-tree.html">Tree</a></li>
+<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
+<li><a href="../../../../index-all.html">Index</a></li>
+<li><a href="../../../../help-doc.html">Help</a></li>
+</ul>
+</div>
+<div class="subNav">
+<ul class="navList">
+<li><a href="../../../../org/apache/juneau/transform/StringSwap.html" title="class in org.apache.juneau.transform"><span class="typeNameLink">Prev Class</span></a></li>
+<li><a href="../../../../org/apache/juneau/transform/SurrogateSwap.html" title="class in org.apache.juneau.transform"><span class="typeNameLink">Next Class</span></a></li>
+</ul>
+<ul class="navList">
+<li><a href="../../../../index.html?org/apache/juneau/transform/Surrogate.html" target="_top">Frames</a></li>
+<li><a href="Surrogate.html" target="_top">No Frames</a></li>
+</ul>
+<ul class="navList" id="allclasses_navbar_top">
+<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
+</ul>
+<div>
+<script type="text/javascript"><!--
+ allClassesLink = document.getElementById("allclasses_navbar_top");
+ if(window==top) {
+ allClassesLink.style.display = "block";
+ }
+ else {
+ allClassesLink.style.display = "none";
+ }
+ //-->
+</script>
+</div>
+<div>
+<ul class="subNavList">
+<li>Summary: </li>
+<li>Nested | </li>
+<li>Field | </li>
+<li>Constr | </li>
+<li>Method</li>
+</ul>
+<ul class="subNavList">
+<li>Detail: </li>
+<li>Field | </li>
+<li>Constr | </li>
+<li>Method</li>
+</ul>
+</div>
+<a name="skip.navbar.top">
+<!-- -->
+</a></div>
+<!-- ========= END OF TOP NAVBAR ========= -->
+<!-- ======== START OF CLASS DATA ======== -->
+<div class="header">
+<div class="subTitle">org.apache.juneau.transform</div>
+<h2 title="Interface Surrogate" class="title">Interface Surrogate</h2>
+</div>
+<div class="contentContainer">
+<div class="description">
+<ul class="blockList">
+<li class="blockList">
+<hr>
+<br>
+<pre>public interface <a href="../../../../src-html/org/apache/juneau/transform/Surrogate.html#line.134">Surrogate</a></pre>
+<div class="block">Identifies a class as being a surrogate class.
+
+ <p>
+ Surrogate classes are used in place of other classes during serialization.
+ For example, you may want to use a surrogate class to change the names or order of bean properties on a bean.
+
+ <p>
+ This interface has no methods to implement.
+ It's simply used by the framework to identify the class as a surrogate class when specified as a swap.
+
+ <p>
+ The following is an example of a surrogate class change changes a property name:
+ <p class='bcode'>
+ <jk>public class</jk> MySurrogate <jk>implements</jk> Surrogate {
+ <jk>public</jk> String surrogateField; <jc>// New bean property</jc>
+
+ <jk>public</jk> MySurrogate(NormalClass normalClass) {
+ <jk>this</jk>.surrogateField = normalClass.normalField;
+ }
+ }
+ </p>
+
+ <p>
+ Optionally, a public static method can be used to un-transform a class during parsing:
+ <p class='bcode'>
+ <jk>public class</jk> MySurrogate <jk>implements</jk> Surrogate {
+ ...
+ <jk>public static</jk> NormalClass <jsm>toNormalClass</jsm>(SurrogateClass surrogateClass) {
+ <jk>return new</jk> NormalClass(surrogateClass.transformedField);
+ }
+ }
+ </p>
+
+ <p>
+ Surrogate classes must conform to the following:
+ <ul class='spaced-list'>
+ <li>
+ It must have a one or more public constructors that take in a single parameter whose type is the normal types.
+ (It is possible to define a class as a surrogate for multiple class types by using multiple constructors with
+ different parameter types).
+ <li>
+ It optionally can have a public static method that takes in a single parameter whose type is the transformed
+ type and returns an instance of the normal type.
+ This is called the un-transform method.
+ The method can be called anything.
+ <li>
+ If an un-transform method is present, the class must also contain a no-arg constructor (so that the
+ transformed class can be instantiated by the parser before being converted into the normal class by the
+ un-transform method).
+ </ul>
+
+ <p>
+ Surrogate classes are associated with serializers and parsers using the <a href="../../../../org/apache/juneau/CoreObjectBuilder.html#pojoSwaps-java.lang.Class...-"><code>CoreObjectBuilder.pojoSwaps(Class...)</code></a>
+ method.
+ <p class='bcode'>
+ <ja>@Test</ja>
+ <jk>public void</jk> test() <jk>throws</jk> Exception {
+ JsonSerializer s = <jk>new</jk> JsonSerializerBuilder().simple().pojoSwaps(MySurrogate.<jk>class</jk>).build();
+ JsonParser p = <jk>new</jk> JsonParserBuilder().pojoSwaps(MySurrogate.<jk>class</jk>).build();
+ String r;
+ Normal n = Normal.<jsm>create</jsm>();
+
+ r = s.serialize(n);
+ assertEquals(<js>"{f2:'f1'}"</js>, r);
+
+ n = p.parse(r, Normal.<jk>class</jk>);
+ assertEquals(<js>"f1"</js>, n.f1);
+ }
+
+ <jc>// The normal class</jc>
+ <jk>public class</jk> Normal {
+ <jk>public</jk> String f1;
+
+ <jk>public static</jk> Normal <jsm>create</jsm>() {
+ Normal n = <jk>new</jk> Normal();
+ n.f1 = <js>"f1"</js>;
+ <jk>return</jk> n;
+ }
+ }
+
+ <jc>// The surrogate class</jc>
+ <jk>public class</jk> MySurrogate <jk>implements</jk> Surrogate {
+ <jk>public</jk> String f2;
+
+ <jc>// Surrogate constructor</jc>
+ <jk>public</jk> MySurrogate(Normal n) {
+ f2 = n.f1;
+ }
+
+ <jc>// Constructor used during parsing (only needed if un-transform method specified)</jc>
+ <jk>public</jk> MySurrogate() {}
+
+ <jc>// Un-transform method (optional)</jc>
+ <jk>public static</jk> Normal <jsm>toNormal</jsm>(Surrogate f) {
+ Normal n = <jk>new</jk> Normal();
+ n.f1 = f.f2;
+ <jk>return</jk> n;
+ }
+ }
+ </p>
+
+ <p>
+ It should be noted that a surrogate class is functionally equivalent to the following <a href="../../../../org/apache/juneau/transform/PojoSwap.html" title="class in org.apache.juneau.transform"><code>PojoSwap</code></a>
+ implementation:
+ <p class='bcode'>
+ <jk>public static class</jk> MySurrogate <jk>extends</jk> PojoSwap<Normal,MySurrogate> {
+ <jk>public</jk> MySurrogate swap(Normal n) <jk>throws</jk> SerializeException {
+ <jk>return new</jk> MySurrogate(n);
+ }
+ <jk>public</jk> Normal unswap(MySurrogate s, ClassMeta<?> hint) <jk>throws</jk> ParseException {
+ <jk>return</jk> MySurrogate.<jsm>toNormal</jsm>(s);
+ }
+ }
+ </p></div>
+</li>
+</ul>
+</div>
+</div>
+<!-- ========= END OF CLASS DATA ========= -->
+<!-- ======= START OF BOTTOM NAVBAR ====== -->
+<div class="bottomNav"><a name="navbar.bottom">
+<!-- -->
+</a>
+<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
+<a name="navbar.bottom.firstrow">
+<!-- -->
+</a>
+<ul class="navList" title="Navigation">
+<li><a href="../../../../overview-summary.html">Overview</a></li>
+<li><a href="package-summary.html">Package</a></li>
+<li class="navBarCell1Rev">Class</li>
+<li><a href="package-tree.html">Tree</a></li>
+<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
+<li><a href="../../../../index-all.html">Index</a></li>
+<li><a href="../../../../help-doc.html">Help</a></li>
+</ul>
+</div>
+<div class="subNav">
+<ul class="navList">
+<li><a href="../../../../org/apache/juneau/transform/StringSwap.html" title="class in org.apache.juneau.transform"><span class="typeNameLink">Prev Class</span></a></li>
+<li><a href="../../../../org/apache/juneau/transform/SurrogateSwap.html" title="class in org.apache.juneau.transform"><span class="typeNameLink">Next Class</span></a></li>
+</ul>
+<ul class="navList">
+<li><a href="../../../../index.html?org/apache/juneau/transform/Surrogate.html" target="_top">Frames</a></li>
+<li><a href="Surrogate.html" target="_top">No Frames</a></li>
+</ul>
+<ul class="navList" id="allclasses_navbar_bottom">
+<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
+</ul>
+<div>
+<script type="text/javascript"><!--
+ allClassesLink = document.getElementById("allclasses_navbar_bottom");
+ if(window==top) {
+ allClassesLink.style.display = "block";
+ }
+ else {
+ allClassesLink.style.display = "none";
+ }
+ //-->
+</script>
+</div>
+<div>
+<ul class="subNavList">
+<li>Summary: </li>
+<li>Nested | </li>
+<li>Field | </li>
+<li>Constr | </li>
+<li>Method</li>
+</ul>
+<ul class="subNavList">
+<li>Detail: </li>
+<li>Field | </li>
+<li>Constr | </li>
+<li>Method</li>
+</ul>
+</div>
+<a name="skip.navbar.bottom">
+<!-- -->
+</a></div>
+<!-- ======== END OF BOTTOM NAVBAR ======= -->
+<p class="legalCopy"><small>Copyright © 2017 <a href="http://www.apache.org/">Apache</a>. All rights reserved.</small></p>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/294a19ef/content/site/apidocs/src-html/org/apache/juneau/annotation/Swap.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/annotation/Swap.html b/content/site/apidocs/src-html/org/apache/juneau/annotation/Swap.html
new file mode 100644
index 0000000..32fae87
--- /dev/null
+++ b/content/site/apidocs/src-html/org/apache/juneau/annotation/Swap.html
@@ -0,0 +1,192 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a>
+<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a>
+<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a>
+<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a>
+<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a>
+<span class="sourceLineNo">006</span>// * *<a name="line.6"></a>
+<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a>
+<span class="sourceLineNo">008</span>// * *<a name="line.8"></a>
+<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a>
+<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a>
+<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a>
+<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a>
+<span class="sourceLineNo">013</span>package org.apache.juneau.annotation;<a name="line.13"></a>
+<span class="sourceLineNo">014</span><a name="line.14"></a>
+<span class="sourceLineNo">015</span>import static java.lang.annotation.ElementType.*;<a name="line.15"></a>
+<span class="sourceLineNo">016</span>import static java.lang.annotation.RetentionPolicy.*;<a name="line.16"></a>
+<span class="sourceLineNo">017</span><a name="line.17"></a>
+<span class="sourceLineNo">018</span>import java.lang.annotation.*;<a name="line.18"></a>
+<span class="sourceLineNo">019</span>import java.util.*;<a name="line.19"></a>
+<span class="sourceLineNo">020</span><a name="line.20"></a>
+<span class="sourceLineNo">021</span>import org.apache.juneau.transform.*;<a name="line.21"></a>
+<span class="sourceLineNo">022</span><a name="line.22"></a>
+<span class="sourceLineNo">023</span>/**<a name="line.23"></a>
+<span class="sourceLineNo">024</span> * Associates {@link PojoSwap} and {@link Surrogate} classes with POJOs and bean properties.<a name="line.24"></a>
+<span class="sourceLineNo">025</span> *<a name="line.25"></a>
+<span class="sourceLineNo">026</span> * <p><a name="line.26"></a>
+<span class="sourceLineNo">027</span> * A typical example is for rendering {@link Date Dates} and {@link Calendar Calendars} as a formatted string:<a name="line.27"></a>
+<span class="sourceLineNo">028</span> *<a name="line.28"></a>
+<span class="sourceLineNo">029</span> * <h5 class='section'>Example:</h5><a name="line.29"></a>
+<span class="sourceLineNo">030</span> * <p class='bcode'><a name="line.30"></a>
+<span class="sourceLineNo">031</span> * <jk>public class</jk> MyClass {<a name="line.31"></a>
+<span class="sourceLineNo">032</span> *<a name="line.32"></a>
+<span class="sourceLineNo">033</span> * <jc>// During serialization, convert to ISO8601 date-time string.</jc><a name="line.33"></a>
+<span class="sourceLineNo">034</span> * <ja>@Swap</ja>(CalendarSwap.ISO8601DT.<jk>class</jk>)<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * <jk>public</jk> Calendar getTime();<a name="line.35"></a>
+<span class="sourceLineNo">036</span> * }<a name="line.36"></a>
+<span class="sourceLineNo">037</span> * </p><a name="line.37"></a>
+<span class="sourceLineNo">038</span> *<a name="line.38"></a>
+<span class="sourceLineNo">039</span> * <p><a name="line.39"></a>
+<span class="sourceLineNo">040</span> * This annotation can be used in the following locations:<a name="line.40"></a>
+<span class="sourceLineNo">041</span> * <ul><a name="line.41"></a>
+<span class="sourceLineNo">042</span> * <li>Classes.<a name="line.42"></a>
+<span class="sourceLineNo">043</span> * <li>Bean getters/setters/fields.<a name="line.43"></a>
+<span class="sourceLineNo">044</span> * <li>Inside the {@link Swaps @Swaps} annotation.<a name="line.44"></a>
+<span class="sourceLineNo">045</span> * </ul><a name="line.45"></a>
+<span class="sourceLineNo">046</span> */<a name="line.46"></a>
+<span class="sourceLineNo">047</span>@Documented<a name="line.47"></a>
+<span class="sourceLineNo">048</span>@Target({TYPE,ANNOTATION_TYPE,FIELD,METHOD})<a name="line.48"></a>
+<span class="sourceLineNo">049</span>@Retention(RUNTIME)<a name="line.49"></a>
+<span class="sourceLineNo">050</span>@Inherited<a name="line.50"></a>
+<span class="sourceLineNo">051</span>public @interface Swap {<a name="line.51"></a>
+<span class="sourceLineNo">052</span><a name="line.52"></a>
+<span class="sourceLineNo">053</span> /**<a name="line.53"></a>
+<span class="sourceLineNo">054</span> * The {@link PojoSwap} and {@link Surrogate} class.<a name="line.54"></a>
+<span class="sourceLineNo">055</span> *<a name="line.55"></a>
+<span class="sourceLineNo">056</span> * <p><a name="line.56"></a>
+<span class="sourceLineNo">057</span> * A synonym for {@link #impl()}.<a name="line.57"></a>
+<span class="sourceLineNo">058</span> */<a name="line.58"></a>
+<span class="sourceLineNo">059</span> Class<?> value() default Null.class;<a name="line.59"></a>
+<span class="sourceLineNo">060</span><a name="line.60"></a>
+<span class="sourceLineNo">061</span> /**<a name="line.61"></a>
+<span class="sourceLineNo">062</span> * The {@link PojoSwap} and {@link Surrogate} class.<a name="line.62"></a>
+<span class="sourceLineNo">063</span> *<a name="line.63"></a>
+<span class="sourceLineNo">064</span> * <p><a name="line.64"></a>
+<span class="sourceLineNo">065</span> * A synonym for {@link #value()}.<a name="line.65"></a>
+<span class="sourceLineNo">066</span> */<a name="line.66"></a>
+<span class="sourceLineNo">067</span> Class<?> impl() default Null.class;<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span><a name="line.69"></a>
+<span class="sourceLineNo">070</span> /**<a name="line.70"></a>
+<span class="sourceLineNo">071</span> * Identifies a template string along with this swap.<a name="line.71"></a>
+<span class="sourceLineNo">072</span> *<a name="line.72"></a>
+<span class="sourceLineNo">073</span> * <p><a name="line.73"></a>
+<span class="sourceLineNo">074</span> * Template strings are arbitrary strings associated with swaps that help provide additional context information<a name="line.74"></a>
+<span class="sourceLineNo">075</span> * for the swap class.<a name="line.75"></a>
+<span class="sourceLineNo">076</span> * They're called 'templates' because their primary purpose is for providing template names, such as Apache FreeMarker<a name="line.76"></a>
+<span class="sourceLineNo">077</span> * template names.<a name="line.77"></a>
+<span class="sourceLineNo">078</span> *<a name="line.78"></a>
+<span class="sourceLineNo">079</span> * <p><a name="line.79"></a>
+<span class="sourceLineNo">080</span> * The following is an example of a templated swap class used to serialize POJOs to HTML using FreeMarker:<a name="line.80"></a>
+<span class="sourceLineNo">081</span> *<a name="line.81"></a>
+<span class="sourceLineNo">082</span> * <p class='bcode'><a name="line.82"></a>
+<span class="sourceLineNo">083</span> * <jc>// Our abstracted templated swap class.</jc><a name="line.83"></a>
+<span class="sourceLineNo">084</span> * <jk>public abstract class</jk> FreeMarkerSwap <jk>extends</jk> PojoSwap&lt;Object,Reader&gt; {<a name="line.84"></a>
+<span class="sourceLineNo">085</span> *<a name="line.85"></a>
+<span class="sourceLineNo">086</span> * <jk>public</jk> MediaType[] forMediaTypes() {<a name="line.86"></a>
+<span class="sourceLineNo">087</span> * <jk>return</jk> MediaType.<jsm>forStrings</jsm>(<js>"&#42;/html"</js>);<a name="line.87"></a>
+<span class="sourceLineNo">088</span> * }<a name="line.88"></a>
+<span class="sourceLineNo">089</span> *<a name="line.89"></a>
+<span class="sourceLineNo">090</span> * <jk>public</jk> Reader swap(BeanSession session, Object o, String template) <jk>throws</jk> Exception {<a name="line.90"></a>
+<span class="sourceLineNo">091</span> * <jk>return</jk> getFreeMarkerReader(template, o); <jc>// Some method that creates raw HTML.</jc><a name="line.91"></a>
+<span class="sourceLineNo">092</span> * }<a name="line.92"></a>
+<span class="sourceLineNo">093</span> * }<a name="line.93"></a>
+<span class="sourceLineNo">094</span> * </p><a name="line.94"></a>
+<span class="sourceLineNo">095</span> * <p class='bcode'><a name="line.95"></a>
+<span class="sourceLineNo">096</span> * <ja>@Swap</ja>(impl=FreeMarkerSwap.<jk>class</jk>, template=<js>"MyPojo.div.ftl"</js>)<a name="line.96"></a>
+<span class="sourceLineNo">097</span> * <jk>public class</jk> MyPojo {}<a name="line.97"></a>
+<span class="sourceLineNo">098</span> * </p><a name="line.98"></a>
+<span class="sourceLineNo">099</span> */<a name="line.99"></a>
+<span class="sourceLineNo">100</span> String template() default "";<a name="line.100"></a>
+<span class="sourceLineNo">101</span><a name="line.101"></a>
+<span class="sourceLineNo">102</span> /**<a name="line.102"></a>
+<span class="sourceLineNo">103</span> * Identifies the media types that this swap is applicable for.<a name="line.103"></a>
+<span class="sourceLineNo">104</span> *<a name="line.104"></a>
+<span class="sourceLineNo">105</span> * <p><a name="line.105"></a>
+<span class="sourceLineNo">106</span> * In the following example, the swap is only invoked by the JSON serializer:<a name="line.106"></a>
+<span class="sourceLineNo">107</span> *<a name="line.107"></a>
+<span class="sourceLineNo">108</span> * <p class='bcode'><a name="line.108"></a>
+<span class="sourceLineNo">109</span> * <ja>@Swap</ja>(impl=ToStringSwap.<jk>class</jk>, mediaTypes=<js>"&#42;/json"</js>)<a name="line.109"></a>
+<span class="sourceLineNo">110</span> * <jk>public class</jk> MyBean { ... }<a name="line.110"></a>
+<span class="sourceLineNo">111</span> *<a name="line.111"></a>
+<span class="sourceLineNo">112</span> * <jk>public class</jk> ToStringSwap <jk>extends</jk> PojoSwap&lt;Object,String&gt; {<a name="line.112"></a>
+<span class="sourceLineNo">113</span> * <jk>public</jk> String swap(BeanSession session, Object o) <jk>throws</jk> Exception {<a name="line.113"></a>
+<span class="sourceLineNo">114</span> * <jk>return</jk> o.toString();<a name="line.114"></a>
+<span class="sourceLineNo">115</span> * }<a name="line.115"></a>
+<span class="sourceLineNo">116</span> * }<a name="line.116"></a>
+<span class="sourceLineNo">117</span> * </p><a name="line.117"></a>
+<span class="sourceLineNo">118</span> */<a name="line.118"></a>
+<span class="sourceLineNo">119</span> String[] mediaTypes() default {};<a name="line.119"></a>
+<span class="sourceLineNo">120</span>}<a name="line.120"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/294a19ef/content/site/apidocs/src-html/org/apache/juneau/annotation/Swaps.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/annotation/Swaps.html b/content/site/apidocs/src-html/org/apache/juneau/annotation/Swaps.html
new file mode 100644
index 0000000..a07edac
--- /dev/null
+++ b/content/site/apidocs/src-html/org/apache/juneau/annotation/Swaps.html
@@ -0,0 +1,116 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a>
+<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a>
+<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a>
+<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a>
+<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a>
+<span class="sourceLineNo">006</span>// * *<a name="line.6"></a>
+<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a>
+<span class="sourceLineNo">008</span>// * *<a name="line.8"></a>
+<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a>
+<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a>
+<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a>
+<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a>
+<span class="sourceLineNo">013</span>package org.apache.juneau.annotation;<a name="line.13"></a>
+<span class="sourceLineNo">014</span><a name="line.14"></a>
+<span class="sourceLineNo">015</span>import static java.lang.annotation.ElementType.*;<a name="line.15"></a>
+<span class="sourceLineNo">016</span>import static java.lang.annotation.RetentionPolicy.*;<a name="line.16"></a>
+<span class="sourceLineNo">017</span><a name="line.17"></a>
+<span class="sourceLineNo">018</span>import java.lang.annotation.*;<a name="line.18"></a>
+<span class="sourceLineNo">019</span><a name="line.19"></a>
+<span class="sourceLineNo">020</span>/**<a name="line.20"></a>
+<span class="sourceLineNo">021</span> * Used to associate multiple swaps with the same POJO class.<a name="line.21"></a>
+<span class="sourceLineNo">022</span> *<a name="line.22"></a>
+<span class="sourceLineNo">023</span> * <p class='bcode'><a name="line.23"></a>
+<span class="sourceLineNo">024</span> * <ja>@Swaps</ja>(<a name="line.24"></a>
+<span class="sourceLineNo">025</span> * {<a name="line.25"></a>
+<span class="sourceLineNo">026</span> * <ja>@Swap</ja>(MyJsonSwap.<jk>class</jk>),<a name="line.26"></a>
+<span class="sourceLineNo">027</span> * <ja>@Swap</ja>(MyXmlSwap.<jk>class</jk>),<a name="line.27"></a>
+<span class="sourceLineNo">028</span> * <ja>@Swap</ja>(MyOtherSwap.<jk>class</jk>)<a name="line.28"></a>
+<span class="sourceLineNo">029</span> * }<a name="line.29"></a>
+<span class="sourceLineNo">030</span> * )<a name="line.30"></a>
+<span class="sourceLineNo">031</span> * <jk>public class</jk> MyPojo {}<a name="line.31"></a>
+<span class="sourceLineNo">032</span> * </p><a name="line.32"></a>
+<span class="sourceLineNo">033</span> */<a name="line.33"></a>
+<span class="sourceLineNo">034</span>@Documented<a name="line.34"></a>
+<span class="sourceLineNo">035</span>@Target({TYPE})<a name="line.35"></a>
+<span class="sourceLineNo">036</span>@Retention(RUNTIME)<a name="line.36"></a>
+<span class="sourceLineNo">037</span>@Inherited<a name="line.37"></a>
+<span class="sourceLineNo">038</span>public @interface Swaps {<a name="line.38"></a>
+<span class="sourceLineNo">039</span><a name="line.39"></a>
+<span class="sourceLineNo">040</span> /**<a name="line.40"></a>
+<span class="sourceLineNo">041</span> * The swaps to apply to this POJO class.<a name="line.41"></a>
+<span class="sourceLineNo">042</span> */<a name="line.42"></a>
+<span class="sourceLineNo">043</span> Swap[] value() default {};<a name="line.43"></a>
+<span class="sourceLineNo">044</span>}<a name="line.44"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/294a19ef/content/site/apidocs/src-html/org/apache/juneau/transform/Surrogate.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/transform/Surrogate.html b/content/site/apidocs/src-html/org/apache/juneau/transform/Surrogate.html
new file mode 100644
index 0000000..007ca2c
--- /dev/null
+++ b/content/site/apidocs/src-html/org/apache/juneau/transform/Surrogate.html
@@ -0,0 +1,206 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a>
+<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a>
+<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a>
+<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a>
+<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a>
+<span class="sourceLineNo">006</span>// * *<a name="line.6"></a>
+<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a>
+<span class="sourceLineNo">008</span>// * *<a name="line.8"></a>
+<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a>
+<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a>
+<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a>
+<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a>
+<span class="sourceLineNo">013</span>package org.apache.juneau.transform;<a name="line.13"></a>
+<span class="sourceLineNo">014</span><a name="line.14"></a>
+<span class="sourceLineNo">015</span>import org.apache.juneau.*;<a name="line.15"></a>
+<span class="sourceLineNo">016</span><a name="line.16"></a>
+<span class="sourceLineNo">017</span>/**<a name="line.17"></a>
+<span class="sourceLineNo">018</span> * Identifies a class as being a surrogate class.<a name="line.18"></a>
+<span class="sourceLineNo">019</span> *<a name="line.19"></a>
+<span class="sourceLineNo">020</span> * <p><a name="line.20"></a>
+<span class="sourceLineNo">021</span> * Surrogate classes are used in place of other classes during serialization.<a name="line.21"></a>
+<span class="sourceLineNo">022</span> * For example, you may want to use a surrogate class to change the names or order of bean properties on a bean.<a name="line.22"></a>
+<span class="sourceLineNo">023</span> *<a name="line.23"></a>
+<span class="sourceLineNo">024</span> * <p><a name="line.24"></a>
+<span class="sourceLineNo">025</span> * This interface has no methods to implement.<a name="line.25"></a>
+<span class="sourceLineNo">026</span> * It's simply used by the framework to identify the class as a surrogate class when specified as a swap.<a name="line.26"></a>
+<span class="sourceLineNo">027</span> *<a name="line.27"></a>
+<span class="sourceLineNo">028</span> * <p><a name="line.28"></a>
+<span class="sourceLineNo">029</span> * The following is an example of a surrogate class change changes a property name:<a name="line.29"></a>
+<span class="sourceLineNo">030</span> * <p class='bcode'><a name="line.30"></a>
+<span class="sourceLineNo">031</span> * <jk>public class</jk> MySurrogate <jk>implements</jk> Surrogate {<a name="line.31"></a>
+<span class="sourceLineNo">032</span> * <jk>public</jk> String surrogateField; <jc>// New bean property</jc><a name="line.32"></a>
+<span class="sourceLineNo">033</span> *<a name="line.33"></a>
+<span class="sourceLineNo">034</span> * <jk>public</jk> MySurrogate(NormalClass normalClass) {<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * <jk>this</jk>.surrogateField = normalClass.normalField;<a name="line.35"></a>
+<span class="sourceLineNo">036</span> * }<a name="line.36"></a>
+<span class="sourceLineNo">037</span> * }<a name="line.37"></a>
+<span class="sourceLineNo">038</span> * </p><a name="line.38"></a>
+<span class="sourceLineNo">039</span> *<a name="line.39"></a>
+<span class="sourceLineNo">040</span> * <p><a name="line.40"></a>
+<span class="sourceLineNo">041</span> * Optionally, a public static method can be used to un-transform a class during parsing:<a name="line.41"></a>
+<span class="sourceLineNo">042</span> * <p class='bcode'><a name="line.42"></a>
+<span class="sourceLineNo">043</span> * <jk>public class</jk> MySurrogate <jk>implements</jk> Surrogate {<a name="line.43"></a>
+<span class="sourceLineNo">044</span> * ...<a name="line.44"></a>
+<span class="sourceLineNo">045</span> * <jk>public static</jk> NormalClass <jsm>toNormalClass</jsm>(SurrogateClass surrogateClass) {<a name="line.45"></a>
+<span class="sourceLineNo">046</span> * <jk>return new</jk> NormalClass(surrogateClass.transformedField);<a name="line.46"></a>
+<span class="sourceLineNo">047</span> * }<a name="line.47"></a>
+<span class="sourceLineNo">048</span> * }<a name="line.48"></a>
+<span class="sourceLineNo">049</span> * </p><a name="line.49"></a>
+<span class="sourceLineNo">050</span> *<a name="line.50"></a>
+<span class="sourceLineNo">051</span> * <p><a name="line.51"></a>
+<span class="sourceLineNo">052</span> * Surrogate classes must conform to the following:<a name="line.52"></a>
+<span class="sourceLineNo">053</span> * <ul class='spaced-list'><a name="line.53"></a>
+<span class="sourceLineNo">054</span> * <li><a name="line.54"></a>
+<span class="sourceLineNo">055</span> * It must have a one or more public constructors that take in a single parameter whose type is the normal types.<a name="line.55"></a>
+<span class="sourceLineNo">056</span> * (It is possible to define a class as a surrogate for multiple class types by using multiple constructors with<a name="line.56"></a>
+<span class="sourceLineNo">057</span> * different parameter types).<a name="line.57"></a>
+<span class="sourceLineNo">058</span> * <li><a name="line.58"></a>
+<span class="sourceLineNo">059</span> * It optionally can have a public static method that takes in a single parameter whose type is the transformed<a name="line.59"></a>
+<span class="sourceLineNo">060</span> * type and returns an instance of the normal type.<a name="line.60"></a>
+<span class="sourceLineNo">061</span> * This is called the un-transform method.<a name="line.61"></a>
+<span class="sourceLineNo">062</span> * The method can be called anything.<a name="line.62"></a>
+<span class="sourceLineNo">063</span> * <li><a name="line.63"></a>
+<span class="sourceLineNo">064</span> * If an un-transform method is present, the class must also contain a no-arg constructor (so that the<a name="line.64"></a>
+<span class="sourceLineNo">065</span> * transformed class can be instantiated by the parser before being converted into the normal class by the<a name="line.65"></a>
+<span class="sourceLineNo">066</span> * un-transform method).<a name="line.66"></a>
+<span class="sourceLineNo">067</span> * </ul><a name="line.67"></a>
+<span class="sourceLineNo">068</span> *<a name="line.68"></a>
+<span class="sourceLineNo">069</span> * <p><a name="line.69"></a>
+<span class="sourceLineNo">070</span> * Surrogate classes are associated with serializers and parsers using the {@link CoreObjectBuilder#pojoSwaps(Class...)}<a name="line.70"></a>
+<span class="sourceLineNo">071</span> * method.<a name="line.71"></a>
+<span class="sourceLineNo">072</span> * <p class='bcode'><a name="line.72"></a>
+<span class="sourceLineNo">073</span> * <ja>@Test</ja><a name="line.73"></a>
+<span class="sourceLineNo">074</span> * <jk>public void</jk> test() <jk>throws</jk> Exception {<a name="line.74"></a>
+<span class="sourceLineNo">075</span> * JsonSerializer s = <jk>new</jk> JsonSerializerBuilder().simple().pojoSwaps(MySurrogate.<jk>class</jk>).build();<a name="line.75"></a>
+<span class="sourceLineNo">076</span> * JsonParser p = <jk>new</jk> JsonParserBuilder().pojoSwaps(MySurrogate.<jk>class</jk>).build();<a name="line.76"></a>
+<span class="sourceLineNo">077</span> * String r;<a name="line.77"></a>
+<span class="sourceLineNo">078</span> * Normal n = Normal.<jsm>create</jsm>();<a name="line.78"></a>
+<span class="sourceLineNo">079</span> *<a name="line.79"></a>
+<span class="sourceLineNo">080</span> * r = s.serialize(n);<a name="line.80"></a>
+<span class="sourceLineNo">081</span> * assertEquals(<js>"{f2:'f1'}"</js>, r);<a name="line.81"></a>
+<span class="sourceLineNo">082</span> *<a name="line.82"></a>
+<span class="sourceLineNo">083</span> * n = p.parse(r, Normal.<jk>class</jk>);<a name="line.83"></a>
+<span class="sourceLineNo">084</span> * assertEquals(<js>"f1"</js>, n.f1);<a name="line.84"></a>
+<span class="sourceLineNo">085</span> * }<a name="line.85"></a>
+<span class="sourceLineNo">086</span> *<a name="line.86"></a>
+<span class="sourceLineNo">087</span> * <jc>// The normal class</jc><a name="line.87"></a>
+<span class="sourceLineNo">088</span> * <jk>public class</jk> Normal {<a name="line.88"></a>
+<span class="sourceLineNo">089</span> * <jk>public</jk> String f1;<a name="line.89"></a>
+<span class="sourceLineNo">090</span> *<a name="line.90"></a>
+<span class="sourceLineNo">091</span> * <jk>public static</jk> Normal <jsm>create</jsm>() {<a name="line.91"></a>
+<span class="sourceLineNo">092</span> * Normal n = <jk>new</jk> Normal();<a name="line.92"></a>
+<span class="sourceLineNo">093</span> * n.f1 = <js>"f1"</js>;<a name="line.93"></a>
+<span class="sourceLineNo">094</span> * <jk>return</jk> n;<a name="line.94"></a>
+<span class="sourceLineNo">095</span> * }<a name="line.95"></a>
+<span class="sourceLineNo">096</span> * }<a name="line.96"></a>
+<span class="sourceLineNo">097</span> *<a name="line.97"></a>
+<span class="sourceLineNo">098</span> * <jc>// The surrogate class</jc><a name="line.98"></a>
+<span class="sourceLineNo">099</span> * <jk>public class</jk> MySurrogate <jk>implements</jk> Surrogate {<a name="line.99"></a>
+<span class="sourceLineNo">100</span> * <jk>public</jk> String f2;<a name="line.100"></a>
+<span class="sourceLineNo">101</span> *<a name="line.101"></a>
+<span class="sourceLineNo">102</span> * <jc>// Surrogate constructor</jc><a name="line.102"></a>
+<span class="sourceLineNo">103</span> * <jk>public</jk> MySurrogate(Normal n) {<a name="line.103"></a>
+<span class="sourceLineNo">104</span> * f2 = n.f1;<a name="line.104"></a>
+<span class="sourceLineNo">105</span> * }<a name="line.105"></a>
+<span class="sourceLineNo">106</span> *<a name="line.106"></a>
+<span class="sourceLineNo">107</span> * <jc>// Constructor used during parsing (only needed if un-transform method specified)</jc><a name="line.107"></a>
+<span class="sourceLineNo">108</span> * <jk>public</jk> MySurrogate() {}<a name="line.108"></a>
+<span class="sourceLineNo">109</span> *<a name="line.109"></a>
+<span class="sourceLineNo">110</span> * <jc>// Un-transform method (optional)</jc><a name="line.110"></a>
+<span class="sourceLineNo">111</span> * <jk>public static</jk> Normal <jsm>toNormal</jsm>(Surrogate f) {<a name="line.111"></a>
+<span class="sourceLineNo">112</span> * Normal n = <jk>new</jk> Normal();<a name="line.112"></a>
+<span class="sourceLineNo">113</span> * n.f1 = f.f2;<a name="line.113"></a>
+<span class="sourceLineNo">114</span> * <jk>return</jk> n;<a name="line.114"></a>
+<span class="sourceLineNo">115</span> * }<a name="line.115"></a>
+<span class="sourceLineNo">116</span> * }<a name="line.116"></a>
+<span class="sourceLineNo">117</span> * </p><a name="line.117"></a>
+<span class="sourceLineNo">118</span> *<a name="line.118"></a>
+<span class="sourceLineNo">119</span> * <p><a name="line.119"></a>
+<span class="sourceLineNo">120</span> * It should be noted that a surrogate class is functionally equivalent to the following {@link PojoSwap}<a name="line.120"></a>
+<span class="sourceLineNo">121</span> * implementation:<a name="line.121"></a>
+<span class="sourceLineNo">122</span> * <p class='bcode'><a name="line.122"></a>
+<span class="sourceLineNo">123</span> * <jk>public static class</jk> MySurrogate <jk>extends</jk> PojoSwap&lt;Normal,MySurrogate&gt; {<a name="line.123"></a>
+<span class="sourceLineNo">124</span> * <jk>public</jk> MySurrogate swap(Normal n) <jk>throws</jk> SerializeException {<a name="line.124"></a>
+<span class="sourceLineNo">125</span> * <jk>return new</jk> MySurrogate(n);<a name="line.125"></a>
+<span class="sourceLineNo">126</span> * }<a name="line.126"></a>
+<span class="sourceLineNo">127</span> * <jk>public</jk> Normal unswap(MySurrogate s, ClassMeta&lt;?&gt; hint) <jk>throws</jk> ParseException {<a name="line.127"></a>
+<span class="sourceLineNo">128</span> * <jk>return</jk> MySurrogate.<jsm>toNormal</jsm>(s);<a name="line.128"></a>
+<span class="sourceLineNo">129</span> * }<a name="line.129"></a>
+<span class="sourceLineNo">130</span> * }<a name="line.130"></a>
+<span class="sourceLineNo">131</span> * </p><a name="line.131"></a>
+<span class="sourceLineNo">132</span> *<a name="line.132"></a>
+<span class="sourceLineNo">133</span> */<a name="line.133"></a>
+<span class="sourceLineNo">134</span>public interface Surrogate {}<a name="line.134"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>