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 8fef5f5 Javadoc updates.
8fef5f5 is described below
commit 8fef5f55fc7673bff907ee22b172d4be02807b4e
Author: JamesBognar <[email protected]>
AuthorDate: Mon Mar 5 13:14:32 2018 -0500
Javadoc updates.
---
.../main/java/org/apache/juneau/jena/package.html | 209 --------
.../main/java/org/apache/juneau/json/package.html | 291 -----------
.../main/java/org/apache/juneau/uon/package.html | 282 -----------
.../org/apache/juneau/urlencoding/package.html | 282 -----------
.../main/java/org/apache/juneau/xml/package.html | 202 --------
juneau-doc/src/main/javadoc/overview.html | 563 ++++++++++++++++++++-
6 files changed, 537 insertions(+), 1292 deletions(-)
diff --git
a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/package.html
b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/package.html
index e50b908..281451c 100644
---
a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/package.html
+++
b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/package.html
@@ -65,17 +65,14 @@
<ol>
<li><p><a class='doclink' href='#Namespaces'>Namespaces</a></p>
<li><p><a class='doclink' href='#UriProperties'>URI
properties</a></p>
- <li><p><a class='doclink' href='#BeanAnnotations'>@Bean and
@BeanProperty annotations</a></p>
<li><p><a class='doclink'
href='#Collections'>Collections</a></p>
<li><p><a class='doclink' href='#RootProperty'>Root
property</a></p>
<li><p><a class='doclink' href='#TypedLiterals'>Typed
literals</a></p>
- <li><p><a class='doclink' href='#Recursion'>Non-tree models and
recursion detection</a></p>
<li><p><a class='doclink'
href='#SerializerConfigurableProperties'>Configurable properties</a></p>
<li><p><a class='doclink' href='#SerializerOtherNotes'>Other
notes</a></p>
</ol>
<li><p><a class='doclink' href='#RdfParser'>RdfParser class</a></p>
<ol>
- <li><p><a class='doclink' href='#GenericParsing'>Parsing into
generic POJO models</a></p>
<li><p><a class='doclink'
href='#ParserConfigurableProperties'>Configurable properties</a></p>
<li><p><a class='doclink' href='#ParserOtherNotes'>Other
notes</a></p>
</ol>
@@ -470,78 +467,6 @@
</p>
</div>
- <!--
========================================================================================================
-->
- <a id="BeanAnnotations"></a>
- <h3 class='topic' onclick='toggle(this)'>2.3 - @Bean and @BeanProperty
annotations</h3>
- <div class='topic'>
- <p>
- The {@link org.apache.juneau.annotation.Bean @Bean} and
{@link org.apache.juneau.annotation.BeanProperty @BeanProperty}
- annotations are used to customize the behavior of beans
across the entire framework.
- <br>In addition to using them to identify the resource
URI for the bean shown above, they have various other
- uses:
- </p>
- <ul class='spaced-list'>
- <li>
- Hiding bean properties.
- <li>
- Specifying the ordering of bean properties.
- <li>
- Overriding the names of bean properties.
- <li>
- Associating transforms at both the class and
property level (to convert non-serializable POJOs to
- serializable forms).
- </ul>
- <p>
- For example, we now add a <code>birthDate</code>
property, and associate a swap with it to transform
- it to an ISO8601 date-time string in GMT time.
- <br>By default, <code>Calendars</code> are treated as
beans by the framework, which is usually not how you want
- them serialized.
- <br>Using swaps, we can convert them to standardized
string forms.
- </p>
- <p class='bcode'>
- <jk>public class</jk> Person {
-
- <jc>// Bean properties</jc>
-
<ja>@BeanProperty</ja>(swap=CalendarSwap.ISO8601DTZ.<jk>class</jk>)
<jk>public</jk> Calendar birthDate;
- ...
-
- <jc>// Normal constructor</jc>
- <jk>public</jk> Person(<jk>int</jk> id, String name, String
uri, String addressBookUri, String birthDate)
- <jk>throws</jk> Exception {
- ...
- <jk>this</jk>.<jf>birthDate</jf> = <jk>new</jk>
GregorianCalendar();
- <jk>this</jk>.<jf>birthDate</jf>.setTime(
-
DateFormat.<jsm>getDateInstance</jsm>(DateFormat.<jsf>MEDIUM</jsf>).parse(birthDate));
- }
- }
- </p>
- <p>
- And we alter our code to pass in the birthdate.
- </p>
- <p class='bcode'>
- <jc>// Create our bean.</jc>
- Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>,
<js>"http://sample/addressBook/person/1"</js>,
- <js>"http://sample/addressBook"</js>, <js>"Aug 12, 1946"</js>);
- </p>
- <p>
- Now when we rerun the sample code, we'll get the
following:
- </p>
- <p class='bcode'>
- <xt><rdf:RDF</xt>
-
<xa>xmlns:rdf</xa>=<xs>"http://www.w3.org/1999/02/22-rdf-syntax-ns#"</xs>
- <xa>xmlns:j</xa>=<xs>"http://www.apache.org/juneau/"</xs>
- <xa>xmlns:jp</xa>=<xs>"http://www.apache.org/juneaubp/"</xs>
-
<xa>xmlns:per</xa>=<xs>"http://www.apache.org/person/"</xs><xt>></xt>
- <xt><rdf:Description
<xa>rdf:about</xa>=<xs>"http://sample/addressBook/person/1"</xs>></xt>
- <xt><per:addressBookUri</xt>
<xa>rdf:resource</xa>=<xs>"http://sample/addressBook"</xs><xt>/></xt>
- <xt><per:id></xt>1<xt></per:id></xt>
- <xt><per:name></xt>John Smith<xt></per:name></xt>
-
<xt><per:birthDate></xt>1946-08-12T00:00:00Z<xt></per:birthDate></xt>
- <xt></rdf:Description></xt>
- <xt></rdf:RDF></xt>
- </p>
- </div>
-
<!--
========================================================================================================
-->
<a id="Collections"></a>
@@ -766,30 +691,6 @@
<!--
========================================================================================================
-->
- <a id="Recursion"></a>
- <h3 class='topic' onclick='toggle(this)'>2.7 - Non-tree models and
recursion detection</h3>
- <div class='topic'>
- <p>
- The RDF serializer is designed to be used against tree
structures.
- <br>It expects that there not be loops in the POJO
model (e.g. children with references to parents, etc...).
- <br>If you try to serialize models with loops, you will
usually cause a <code>StackOverflowError</code> to
- be thrown (if {@link
org.apache.juneau.serializer.Serializer#SERIALIZER_maxDepth} is not reached
- first).
- </p>
- <p>
- If you still want to use the XML serializer on such
models, Juneau provides the
- {@link
org.apache.juneau.serializer.Serializer#SERIALIZER_detectRecursions} setting.
- <br>It tells the serializer to look for instances of an
object in the current branch of the tree and skip
- serialization when a duplicate is encountered.
- </p>
- <p>
- Recursion detection introduces a performance penalty of
around 20%.
- <br>For this reason the setting is disabled by default.
- </p>
- </div>
-
-
- <!--
========================================================================================================
-->
<a id="SerializerConfigurableProperties"></a>
<h3 class='topic' onclick='toggle(this)'>2.8 - Configurable
properties</h3>
<div class='topic'>
@@ -909,116 +810,6 @@
<!--
========================================================================================================
-->
- <a id="GenericParsing"></a>
- <h3 class='topic' onclick='toggle(this)'>3.1 - Parsing into generic
POJO models</h3>
- <div class='topic'>
- <p>
- The RDF parser is not limited to parsing back into the
original bean classes.
- <br>If the bean classes are not available on the
parsing side, the parser can also be used to parse into a
- generic model consisting of <code>Maps</code>,
<code>Collections</code>, and primitive objects.
- </p>
- <p>
- You can parse into any <code>Map</code> type (e.g.
<code>HashMap</code>, <code>TreeMap</code>), but
- using {@link org.apache.juneau.ObjectMap} is
recommended since it has many convenience methods
- for converting values to various types.
- <br>The same is true when parsing collections. You can
use any Collection (e.g. <code>HashSet</code>,
- <code>LinkedList</code>) or array (e.g.
<code>Object[]</code>, <code>String[]</code>,
- <code>String[][]</code>), but using {@link
org.apache.juneau.ObjectList} is recommended.
- </p>
- <p>
- When the map or list type is not specified, or is the
abstract <code>Map</code>, <code>Collection</code>,
- or <code>List</code> types, the parser will use
<code>ObjectMap</code> and <code>ObjectList</code> by
- default.
- </p>
- <p>
- In the following example, we parse into an
<code>ObjectMap</code> and use the convenience methods for
- performing data conversion on values in the map.
- </p>
- <p class='bcode'>
- <jc>// Parse RDF into a generic POJO model.</jc>
- ObjectMap m = RdfParser.<jsf>DEFAULT_XML</jsf>.parse(rdfXml,
ObjectMap.<jk>class</jk>);
-
- <jc>// Get some simple values.</jc>
- String name = m.getString(<js>"name"</js>);
- <jk>int</jk> id = m.getInt(<js>"id"</js>);
-
- <jc>// Get a value convertable from a String.</jc>
- URI uri = m.get(URI.<jk>class</jk>, <js>"uri"</js>);
-
- <jc>// Get a value using a swap.</jc>
- CalendarSwap swap = <jk>new</jk> CalendarSwap.ISO8601DTZ();
- Calendar birthDate = m.get(swap, <js>"birthDate"</js>);
-
- <jc>// Get the addresses.</jc>
- ObjectList addresses = m.getObjectList(<js>"addresses"</js>);
-
- <jc>// Get the first address and convert it to a bean.</jc>
- Address address = addresses.get(Address.<jk>class</jk>, 0);
- </p>
-
- <p>
- However, there are caveats when parsing into generic
models due to the nature of RDF.
- <br>Watch out for the following:
- </p>
- <ul class='spaced-list'>
- <li>
- The ordering of entries are going to be
inconsistent.
- <li>
- Bean URIs are always going to be denoted with
the key <js>"uri"</js>.
- <br>Therefore, you cannot have a bean with a
URI property and a separate property named <js>"uri"</js>.
- <br>The latter will overwrite the former.
- <br>This isn't a problem when parsing into
beans instead of generic POJO models.
- <li>
- All values are strings.
- <br>This normally isn't a problem when using
<code>ObjectMap</code> and <code>ObjectList</code> since
- various methods are provided for converting to
the correct type anyway.
- <li>
- The results may not be what is expected if
there are lots of URL reference loops in the RDF model.
- <br>As nodes are processed from the root node
down through the child nodes, the parser keeps
- track of previously processed parent URIs and
handles them accordingly.
- <br>If it finds that the URI has previously
been processed, it handles it as a normal URI string and doesn't
- process further.
- <br>However, depending on how complex the
reference loops are, the parsed data may end up having the
- same data in it, but structured differently
from the original POJO.
- </ul>
- <p>
- We can see some of these when we render the
<code>ObjectMap</code> back to JSON.
- </p>
- <p class='bcode'>
-
System.<jsm>err</jsm>.println(JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.serialize(m));
- </p>
- <p>
- This is what's produced:
- </p>
- <p class='bcode'>
- {
- uri: <js>'http://sample/addressBook/person/1'</js>,
- addresses: [
- {
- uri:
<js>'http://sample/addressBook/address/1'</js>,
- isCurrent: <js>'true'</js>,
- zip: <js>'12345'</js>,
- state: <js>'NY'</js>,
- city: <js>'Anywhereville'</js>,
- street: <js>'100 Main Street'</js>,
- id: <js>'1'</js>,
- personUri:
<js>'http://sample/addressBook/person/1'</js>
- }
- ],
- birthDate: <js>'1946-08-12T00:00:00Z'</js>,
- addressBookUri: <js>'http://sample/addressBook'</js>,
- name: <js>'John Smith'</js>,
- id: <js>'1'</js>,
- root: <js>'true'</js>
- }
- </p>
- <p>
- As a general rule, parsing into beans is often more
efficient than parsing into generic models.
- <br>And working with beans is often less error prone
than working with generic models.
- </p>
- </div>
-
- <!--
========================================================================================================
-->
<a id="ParserConfigurableProperties"></a>
<h3 class='topic' onclick='toggle(this)'>3.2 - Configurable
properties</h3>
<!-- TODO -->
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/package.html
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/package.html
index 4bdc900..bce9595 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/package.html
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/package.html
@@ -63,16 +63,13 @@
</ol>
<li><p><a class='doclink' href='#JsonSerializer'>JsonSerializer
class</a></p>
<ol>
- <li><p><a class='doclink' href='#BeanAnnotations'>@Bean and
@BeanProperty annotations</a></p>
<li><p><a class='doclink'
href='#Collections'>Collections</a></p>
<li><p><a class='doclink' href='#JsonSchemaSupport'>JSON-Schema
support</a></p>
- <li><p><a class='doclink' href='#Recursion'> Non-tree models
and recursion detection</a></p>
<li><p><a class='doclink'
href='#SerializerConfigurableProperties'>Configurable properties</a></p>
<li><p><a class='doclink' href='#SerializerOtherNotes'>Other
notes</a></p>
</ol>
<li><p><a class='doclink' href='#JsonParser'>JsonParser class</a></p>
<ol>
- <li><p><a class='doclink' href='#GenericParsing'>Parsing into
generic POJO models</a></p>
<li><p><a class='doclink'
href='#ParserConfigurableProperties'>Configurable properties</a></p>
<li><p><a class='doclink' href='#ParserOtherNotes'>Other
notes</a></p>
</ol>
@@ -306,107 +303,6 @@
<!--
========================================================================================================
-->
- <a id="BeanAnnotations"></a>
- <h3 class='topic' onclick='toggle(this)'>2.1 - @Bean and @BeanProperty
annotations</h3>
- <div class='topic'>
- <p>
- The {@link org.apache.juneau.annotation.Bean @Bean} and
- {@link org.apache.juneau.annotation.BeanProperty
@BeanProperty} annotations are used to customize the
- behavior of beans across the entire framework.
- <br>They have various uses:
- </p>
- <ul class='spaced-list'>
- <li>
- Hiding bean properties.
- <li>
- Specifying the ordering of bean properties.
- <li>
- Overriding the names of bean properties.
- <li>
- Associating swaps at both the class and
property level (to convert non-serializable POJOs to
- serializable forms).
- </ul>
- <p>
- For example, we now add a <code>birthDate</code>
property, and associate a swap with it to transform it to
- an ISO8601 date-time string in GMT time.
- <br>We'll also add a couple of <code>URI</code>
properties.
- <br>By default, <code>Calendars</code> are treated as
beans by the framework, which is usually not how you
- want them serialized.
- <br>Using swaps, we can convert them to standardized
string forms.
- </p>
- <p class='bcode'>
- <jk>public class</jk> Person {
- <jc>// Bean properties</jc>
- <jk>public int</jk> <jf>id</jf>;
- <jk>public</jk> String <jf>name</jf>;
- <jk>public</jk> URI <jf>uri</jf>;
- <jk>public</jk> URI <jf>addressBookUri</jf>;
-
-
<ja>@BeanProperty</ja>(swap=CalendarSwap.ISO8601DTZ.<jk>class</jk>)
<jk>public</jk> Calendar <jf>birthDate</jf>;
-
-
- <jc>// Bean constructor (needed by parser)</jc>
- <jk>public</jk> Person() {}
-
- <jc>// Normal constructor</jc>
- <jk>public</jk> Person(<jk>int</jk> id, String name, String
uri, String addressBookUri, String birthDate) <jk>throws</jk> Exception {
- <jk>this</jk>.<jf>id</jf> = id;
- <jk>this</jk>.<jf>name</jf> = name;
- <jk>this</jk>.<jf>uri</jf> = <jk>new</jk> URI(uri);
- <jk>this</jk>.<jf>addressBookUri</jf> = <jk>new</jk>
URI(addressBookUri);
- <jk>this</jk>.<jf>birthDate</jf> = <jk>new</jk>
GregorianCalendar();
-
<jk>this</jk>.<jf>birthDate</jf>.setTime(DateFormat.<jsm>getDateInstance</jsm>(DateFormat.<jsf>MEDIUM</jsf>).parse(birthDate));
- }
- }
- </p>
- <p>
- Next, we alter our code to pass in the birthdate:
- </p>
- <p class='bcode'>
- <jc>// Create our bean.</jc>
- Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>,
<js>"http://sample/addressBook/person/1"</js>,
- <js>"http://sample/addressBook"</js>, <js>"Aug 12, 1946"</js>);
- </p>
- <p>
- Now when we rerun the sample code, we'll get the
following:
- </p>
- <p class='bcode'>
- {
- id: <jk>1</jk>,
- name: <js>'John Smith'</js>,
- uri: <js>'http://sample/addressBook/person/1'</js>,
- addressBookUri: <js>'http://sample/addressBook'</js>,
- birthDate: <js>'1946-08-12T00:00:00Z'</js>
- }
- </p>
- <p>
- Another useful feature is the {@link
org.apache.juneau.annotation.Bean#propertyNamer() @Bean.propertyNamer()}
- annotation that allows you to plug in your own logic
for determining bean property names.
- <br>The {@link org.apache.juneau.PropertyNamerDLC} is
an example of an alternate property namer.
- It converts bean property names to lowercase-dashed
format.
- </p>
-
- <h5 class='topic'>Example:</h5>
- <p class='bcode'>
- <ja>@Bean</ja>(propertyNamer=PropertyNamerDLC.<jk>class</jk>)
- <jk>public class</jk> Person {
- ...
- </p>
-
- <h5 class='figure'>Results</h5>
- <p class='bcode'>
- {
- id: <jk>1</jk>,
- name: <js>'John Smith'</js>,
- uri: <js>'http://sample/addressBook/person/1'</js>,
- <js>'address-book-uri'</js>:
<js>'http://sample/addressBook'</js>,
- <js>'birth-date'</js>: <js>'1946-08-12T00:00:00Z'</js>
- }
- </p>
- </div>
-
-
- <!--
========================================================================================================
-->
<a id="Collections"></a>
<h3 class='topic' onclick='toggle(this)'>2.2 - Collections</h3>
<div class='topic'>
@@ -634,77 +530,6 @@
</p>
</div>
-
- <!--
========================================================================================================
-->
- <a id="Recursion"></a>
- <h3 class='topic' onclick='toggle(this)'>2.4 - Non-tree models and
recursion detection</h3>
- <div class='topic'>
- <p>
- The JSON serializer is designed to be used against POJO
tree structures.
- <br>It expects that there not be loops in the POJO
model (e.g. children with references to parents, etc...).
- <br>If you try to serialize models with loops, you will
usually cause a <code>StackOverflowError</code> to
- be thrown (if {@link
org.apache.juneau.serializer.Serializer#SERIALIZER_maxDepth} is not reached
- first).
- </p>
- <p>
- If you still want to use the JSON serializer on such
models, Juneau provides the
- {@link
org.apache.juneau.serializer.Serializer#SERIALIZER_detectRecursions} setting.
- <br>It tells the serializer to look for instances of an
object in the current branch of the tree and skip
- serialization when a duplicate is encountered.
- </p>
- <p>
- For example, let's make a POJO model out of the
following classes:
- </p>
- <p class='bcode'>
- <jk>public class</jk> A {
- <jk>public</jk> B b;
- }
-
- <jk>public class</jk> B {
- <jk>public</jk> C c;
- }
-
- <jk>public class</jk> C {
- <jk>public</jk> A a;
- }
- </p>
- <p>
- Now we create a model with a loop and serialize the
results.
- </p>
- <p class='bcode'>
- <jc>// Clone an existing serializer and set property for detecting
recursions.</jc>
- JsonSerializer s =
JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.builder().detectRecursions(<jk>true</jk>).build();
-
- <jc>// Create a recursive loop.</jc>
- A a = <jk>new</jk> A();
- a.<jf>b</jf> = <jk>new</jk> B();
- a.<jf>b</jf>.<jf>c</jf> = <jk>new</jk> C();
- a.<jf>b</jf>.<jf>c</jf>.<jf>a</jf> = a;
-
- <jc>// Serialize to JSON.</jc>
- String json = s.serialize(a);
- </p>
- <p>
- What we end up with is the following, which does not
serialize the contents of the <code>c</code> field:
- </p>
- <p class='bcode'>
- {
- b: {
- c: {
- }
- }
- }
- </p>
- <p>
- Without recursion detection enabled, this would cause a
stack-overflow error.
- </p>
- <p>
- Recursion detection introduces a performance penalty of
around 20%.
- <br>For this reason the setting is disabled by default.
- </p>
- </div>
-
-
<!--
========================================================================================================
-->
<a id="SerializerConfigurableProperties"></a>
<h3 class='topic' onclick='toggle(this)'>2.5 - Configurable
properties</h3>
@@ -850,122 +675,6 @@
<!--
========================================================================================================
-->
- <a id="GenericParsing"></a>
- <h3 class='topic' onclick='toggle(this)'>3.1 - Parsing into generic
POJO models</h3>
- <div class='topic'>
- <p>
- The JSON parser is not limited to parsing back into the
original bean classes.
- <br>If the bean classes are not available on the
parsing side, the parser can also be used to
- parse into a generic model consisting of
<code>Maps</code>, <code>Collections</code>, and primitive
- objects.
- </p>
- <p>
- You can parse into any <code>Map</code> type (e.g.
<code>HashMap</code>, <code>TreeMap</code>), but
- using {@link org.apache.juneau.ObjectMap} is
recommended since it has many convenience methods
- for converting values to various types.
- <br>The same is true when parsing collections. You can
use any Collection (e.g. <code>HashSet</code>,
- <code>LinkedList</code>) or array (e.g.
<code>Object[]</code>, <code>String[]</code>,
- <code>String[][]</code>), but using {@link
org.apache.juneau.ObjectList} is recommended.
- </p>
- <p>
- When the map or list type is not specified, or is the
abstract <code>Map</code>, <code>Collection</code>,
- or <code>List</code> types, the parser will use
<code>ObjectMap</code> and <code>ObjectList</code> by
- default.
- </p>
- <p>
- Starting back with our original JSON:
- </p>
- <p class='bcode'>
- {
- id: <jk>1</jk>,
- name: <js>'John Smith'</js>,
- uri: <js>'http://sample/addressBook/person/1'</js>,
- addressBookUri: <js>'http://sample/addressBook'</js>,
- birthDate: <js>'1946-08-12T00:00:00Z'</js>,
- addresses: [
- {
- uri:
<js>'http://sample/addressBook/address/1'</js>,
- personUri:
<js>'http://sample/addressBook/person/1'</js>,
- id: <jk>1</jk>,
- street: <js>'100 Main Street'</js>,
- city: <js>'Anywhereville'</js>,
- state: <js>'NY'</js>,
- zip: <jk>12345</jk>,
- isCurrent: <jk>true</jk>
- }
- ]
- }
- </p>
- <p>
- We can parse this into a generic <code>ObjectMap</code>:
- </p>
- <p class='bcode'>
- <jc>// Parse JSON into a generic POJO model.</jc>
- ObjectMap m = JsonParser.<jsf>DEFAULT</jsf>.parse(json,
ObjectMap.<jk>class</jk>);
-
- <jc>// Convert it back to JSON.</jc>
- String json =
JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.serialize(m);
- </p>
- <p>
- What we end up with is the exact same output.
- <br>Even the numbers and booleans are preserved because
they are parsed into <code>Number</code> and
- <code>Boolean</code> objects when parsing into generic
models.
- </p>
- <p class='bcode'>
- {
- id: <jk>1</jk>,
- name: <js>'John Smith'</js>,
- uri: <js>'http://sample/addressBook/person/1'</js>,
- addressBookUri: <js>'http://sample/addressBook'</js>,
- birthDate: <js>'1946-08-12T00:00:00Z'</js>,
- addresses: [
- {
- uri:
<js>'http://sample/addressBook/address/1'</js>,
- personUri:
<js>'http://sample/addressBook/person/1'</js>,
- id: <jk>1</jk>,
- street: <js>'100 Main Street'</js>,
- city: <js>'Anywhereville'</js>,
- state: <js>'NY'</js>,
- zip: <jk>12345</jk>,
- isCurrent: <jk>true</jk>
- }
- ]
- }
- </p>
- <p>
- Once parsed into a generic model, various convenience
methods are provided on the <code>ObjectMap</code>
- and <code>ObjectList</code> classes to retrieve
values:
- </p>
- <p class='bcode'>
- <jc>// Parse JSON into a generic POJO model.</jc>
- ObjectMap m = JsonParser.<jsf>DEFAULT</jsf>.parse(json,
ObjectMap.<jk>class</jk>);
-
- <jc>// Get some simple values.</jc>
- String name = m.getString(<js>"name"</js>);
- <jk>int</jk> id = m.getInt(<js>"id"</js>);
-
- <jc>// Get a value convertable from a String.</jc>
- URI uri = m.get(URI.<jk>class</jk>, <js>"uri"</js>);
-
- <jc>// Get a value using a swap.</jc>
- CalendarSwap swap = <jk>new</jk> CalendarSwap.ISO8601DTZ();
- Calendar birthDate = m.get(swap, <js>"birthDate"</js>);
-
- <jc>// Get the addresses.</jc>
- ObjectList addresses = m.getObjectList(<js>"addresses"</js>);
-
- <jc>// Get the first address and convert it to a bean.</jc>
- Address address = addresses.get(Address.<jk>class</jk>, 0);
- </p>
-
- <p>
- As a general rule, parsing into beans is often more
efficient than parsing into generic models.
- <br>And working with beans is often less error prone
than working with generic models.
- </p>
- </div>
-
-
- <!--
========================================================================================================
-->
<a id="ParserConfigurableProperties"></a>
<h3 class='topic' onclick='toggle(this)'>3.2 - Configurable
properties</h3>
<div class='topic'>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/package.html
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/package.html
index b2d50fd..eb457ba 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/package.html
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/package.html
@@ -63,15 +63,12 @@
</ol>
<li><p><a class='doclink'
href='#UrlEncodingSerializer'>UrlEncodingSerializer and UonSerializer
classes</a></p>
<ol>
- <li><p><a class='doclink' href='#BeanAnnotations'>@Bean and
@BeanProperty annotations</a></p>
<li><p><a class='doclink'
href='#Collections'>Collections</a></p>
- <li><p><a class='doclink' href='#Recursion'> Non-tree models
and recursion detection</a></p>
<li><p><a class='doclink'
href='#SerializerConfigurableProperties'>Configurable properties</a></p>
<li><p><a class='doclink' href='#SerializerOtherNotes'>Other
notes</a></p>
</ol>
<li><p><a class='doclink' href='#UrlEncodingParser'>UrlEncodingParser
and UonParser classes</a></p>
<ol>
- <li><p><a class='doclink' href='#GenericParsing'>Parsing into
generic POJO models</a></p>
<li><p><a class='doclink'
href='#ParserConfigurableProperties'>Configurable properties</a></p>
<li><p><a class='doclink' href='#ParserOtherNotes'>Other
notes</a></p>
</ol>
@@ -428,100 +425,6 @@
<!--
========================================================================================================
-->
- <a id="BeanAnnotations"></a>
- <h3 class='topic' onclick='toggle(this)'>2.1 - @Bean and @BeanProperty
annotations</h3>
- <div class='topic'>
- <p>
- The {@link org.apache.juneau.annotation.Bean @Bean} and
{@link org.apache.juneau.annotation.BeanProperty @BeanProperty}
- annotations are used to customize the behavior of beans
across the entire framework.
- <br>They have various uses:
- </p>
- <ul>
- <li>Hiding bean properties.
- <li>Specifying the ordering of bean properties.
- <li>Overriding the names of bean properties.
- <li>Associating transforms at both the class and
property level (to convert non-serializable POJOs to
- serializable forms).
- </ul>
- <p>
- For example, we now add a <code>birthDate</code>
property, and associate a transform with it to transform
- it to an ISO8601 date-time string in GMT time.
- <br>We'll also add a couple of <code>URI</code>
properties.
- <br>By default, <code>Calendars</code> are treated as
beans by the framework, which is usually not how you
- want them serialized.
- <br>Using transforms, we can convert them to
standardized string forms.
- </p>
- <p class='bcode'>
- <jk>public class</jk> Person {
- <jc>// Bean properties</jc>
- <jk>public int</jk> <jf>id</jf>;
- <jk>public</jk> String <jf>name</jf>;
- <jk>public</jk> URI <jf>uri</jf>;
- <jk>public</jk> URI <jf>addressBookUri</jf>;
-
-
<ja>@BeanProperty</ja>(swap=CalendarSwap.ISO8601DTZ.<jk>class</jk>)
<jk>public</jk> Calendar <jf>birthDate</jf>;
-
- <jc>// Bean constructor (needed by parser)</jc>
- <jk>public</jk> Person() {}
-
- <jc>// Normal constructor</jc>
- <jk>public</jk> Person(<jk>int</jk> id, String name, String
uri, String addressBookUri, String birthDate)
- <jk>throws</jk> Exception {
- <jk>this</jk>.<jf>id</jf> = id;
- <jk>this</jk>.<jf>name</jf> = name;
- <jk>this</jk>.<jf>uri</jf> = <jk>new</jk> URI(uri);
- <jk>this</jk>.<jf>addressBookUri</jf> = <jk>new</jk>
URI(addressBookUri);
- <jk>this</jk>.<jf>birthDate</jf> = <jk>new</jk>
GregorianCalendar();
- <jk>this</jk>.<jf>birthDate</jf>
-
.setTime(DateFormat.<jsm>getDateInstance</jsm>(DateFormat.<jsf>MEDIUM</jsf>).parse(birthDate));
- }
- }
- </p>
- <p>
- Next, we alter our code to pass in the birthdate:
- </p>
- <p class='bcode'>
- <jc>// Create our bean.</jc>
- Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>,
<js>"http://sample/addressBook/person/1"</js>,
- <js>"http://sample/addressBook"</js>, <js>"Aug 12, 1946"</js>);
- </p>
- <p>
- Now when we rerun the sample code, we'll get the
following:
- </p>
- <p class='bcode'>
-
(<ua>id</ua>=<un>1</un>,<ua>name</ua>=<us>'John+Smith'</us>,<ua>uri</ua>=<us>http://sample/addressBook/person/1</us>,
-
<ua>addressBookUri</ua>=<us>http://sample/addressBook</us>,<ua>birthDate</ua>=<us>1946-08-12T00:00:00Z</us>)
- </p>
- <p>
- Using <code>UrlEncodingSerializer</code> instead would
create the following:
- </p>
- <p class='bcode'>
-
<ua>id</ua>=<un>1</un>&<ua>name</ua>=<us>'John+Smith'</us>&<ua>uri</ua>=<us>http://sample/addressBook/person/1</us>
-
&<ua>addressBookUri</ua>=<us>http://sample/addressBook</us>&<ua>birthDate</ua>=<us>1946-08-12T00:00:00Z</us>
- </p>
- <p>
- Another useful feature is the {@link
org.apache.juneau.annotation.Bean#propertyNamer() @Bean.propertyNamer()}
annotation that
- allows you to plug in your own logic for determining
bean property names.
- <br>The {@link org.apache.juneau.PropertyNamerDLC} is
an example of an alternate property namer.
- It converts bean property names to lowercase-dashed
format.
- </p>
-
- <h5 class='figure'>Example:</h5>
- <p class='bcode'>
- <ja>@Bean</ja>(propertyNamer=PropertyNamerDLC.<jk>class</jk>)
- <jk>public class</jk> Person {
- ...
- </p>
-
- <h5 class='figure'>Results</h5>
- <p class='bcode'>
-
(<ua>id</ua>=<un>1</us>,<ua>name</ua>=<us>'John+Smith'</us>,<ua>uri</ua>=<us>http://sample/addressBook/person/1</us>,
-
<ua>address-book-uri</ua>=<us>http://sample/addressBook</us>,<ua>birth-date</ua>=<us>1946-08-12T00:00:00Z</us>)
- </p>
- </div>
-
-
- <!--
========================================================================================================
-->
<a id="Collections"></a>
<h3 class='topic' onclick='toggle(this)'>2.2 - Collections</h3>
<div class='topic'>
@@ -627,76 +530,6 @@
<!--
========================================================================================================
-->
- <a id="Recursion"></a>
- <h3 class='topic' onclick='toggle(this)'>2.3 - Non-tree models and
recursion detection</h3>
- <div class='topic'>
- <p>
- The URL-encoding serializer is designed to be used
against POJO tree structures.
- It expects that there not be loops in the POJO model
(e.g. children with references to parents, etc...).
- <br>If you try to serialize models with loops, you will
usually cause a <code>StackOverflowError</code> to
- be thrown (if {@link
org.apache.juneau.serializer.Serializer#SERIALIZER_maxDepth} is not reached
- first).
- </p>
- <p>
- If you still want to use the URL-encoding serializer on
such models, Juneau provides the
- {@link
org.apache.juneau.serializer.Serializer#SERIALIZER_detectRecursions} setting.
- <br>It tells the serializer to look for instances of an
object in the current branch of the tree and skip
- serialization when a duplicate is encountered.
- </p>
- <p>
- For example, let's make a POJO model out of the
following classes:
- </p>
- <p class='bcode'>
- <jk>public class</jk> A {
- <jk>public</jk> B b;
- }
-
- <jk>public class</jk> B {
- <jk>public</jk> C c;
- }
-
- <jk>public class</jk> C {
- <jk>public</jk> A a;
- }
- </p>
- <p>
- Now we create a model with a loop and serialize the
results.
- </p>
- <p class='bcode'>
- <jc>// Clone an existing serializer and set property for detecting
recursions.</jc>
- UrlEncodingSerializer s =
UrlEncodingSerializer.<jsf>DEFAULT_READABLE</jsf>.builder()
- .detectRecursions(<jk>true</jk>).build();
-
- <jc>// Create a recursive loop.</jc>
- A a = <jk>new</jk> A();
- a.<jf>b</jf> = <jk>new</jk> B();
- a.<jf>b</jf>.<jf>c</jf> = <jk>new</jk> C();
- a.<jf>b</jf>.<jf>c</jf>.<jf>a</jf> = a;
-
- <jc>// Serialize.</jc>
- String json = s.serialize(a);
- </p>
- <p>
- What we end up with is the following, which does not
serialize the contents of the <code>c</code> field:
- </p>
- <p class='bcode'>
- (
- <ua>b</ua>=(
- <ua>c</ua>=()
- )
- )
- </p>
- <p>
- Without recursion detection enabled, this would cause a
stack-overflow error.
- </p>
- <p>
- Recursion detection introduces a performance penalty of
around 20%.
- For this reason the setting is disabled by default.
- </p>
- </div>
-
-
- <!--
========================================================================================================
-->
<a id="SerializerConfigurableProperties"></a>
<h3 class='topic' onclick='toggle(this)'>2.4 - Configurable
properties</h3>
<div class='topic'>
@@ -855,121 +688,6 @@
<!--
========================================================================================================
-->
- <a id="GenericParsing"></a>
- <h3 class='topic' onclick='toggle(this)'>3.1 - Parsing into generic
POJO models</h3>
- <div class='topic'>
- <p>
- The URL-encoding parser is not limited to parsing back
into the original bean classes.
- <br>If the bean classes are not available on the
parsing side, the parser can also be used to parse into a
- generic model consisting of <code>Maps</code>,
<code>Collections</code>, and primitive objects.
- </p>
- <p>
- You can parse into any <code>Map</code> type (e.g.
<code>HashMap</code>, <code>TreeMap</code>), but
- using {@link org.apache.juneau.ObjectMap} is
recommended since it has many convenience methods
- for converting values to various types.
- <br>The same is true when parsing collections.
- You can use any Collection (e.g. <code>HashSet</code>,
<code>LinkedList</code>)
- or array (e.g. <code>Object[]</code>,
<code>String[]</code>, <code>String[][]</code>), but using
- {@link org.apache.juneau.ObjectList} is recommended.
- </p>
- <p>
- When the map or list type is not specified, or is the
abstract <code>Map</code>, <code>Collection</code>,
- or <code>List</code> types, the parser will use
<code>ObjectMap</code> and <code>ObjectList</code> by default.
- </p>
- <p>
- Starting back with our original URL-encoded string:
- </p>
- <p class='bcode'>
- (
- <ua>id</ua>=<un>1</un>,
- <ua>name</ua>=<us>'John+Smith'</us>,
- <ua>uri</ua>=<us>http://sample/addressBook/person/1</us>,
- <ua>addressBookUri</ua>=<us>http://sample/addressBook</us>,
- <ua>birthDate</ua>=<us>1946-08-12T00:00:00Z</us>,
- <ua>addresses</ua>=@(
- (
-
<ua>uri</ua>=<us>http://sample/addressBook/address/1</us>,
-
<ua>personUri</ua>=<us>http://sample/addressBook/person/1</us>,
- <ua>id</ua>=<un>1</un>,
- <ua>street</ua>=<us>'100+Main+Street'</us>,
- <ua>city</ua>=<us>Anywhereville</us>,
- <ua>state</ua>=<us>NY</us>,
- <ua>zip</ua>=<un>12345</un>,
- <ua>isCurrent</ua>=<uk>true</uk>
- )
- )
- )
- </p>
- <p>
- We can parse this into a generic <code>ObjectMap</code>:
- </p>
- <p class='bcode'>
- <jc>// Parse URL-encoded string into a generic POJO model.</jc>
- ObjectMap m = UonParser.<jsf>DEFAULT</jsf>.parse(urlencoded,
ObjectMap.<jk>class</jk>);
-
- <jc>// Convert it back to JSON.</jc>
- String json =
JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.serialize(m);
- </p>
- <p>
- What we end up with is the exact same output.
- <br>Even the numbers and booleans are preserved because
they are parsed into <code>Number</code> and
- <code>Boolean</code> objects when parsing into generic
models.
- </p>
- <p class='bcode'>
- {
- id: <un>1</un>,
- name: <js>'John Smith'</js>,
- uri: <js>'http://sample/addressBook/person/1'</js>,
- addressBookUri: <js>'http://sample/addressBook'</js>,
- birthDate: <js>'1946-08-12T00:00:00Z'</js>,
- addresses: [
- {
- uri:
<js>'http://sample/addressBook/address/1'</js>,
- personUri:
<js>'http://sample/addressBook/person/1'</js>,
- id: <un>1</un>,
- street: <js>'100 Main Street'</js>,
- city: <js>'Anywhereville'</js>,
- state: <js>'NY'</js>,
- zip: <un>12345</un>,
- isCurrent: <jk>true</jk>
- }
- ]
- }
- </p>
- <p>
- Once parsed into a generic model, various convenience
methods are provided on the <code>ObjectMap</code>
- and <code>ObjectList</code> classes to retrieve values:
- </p>
- <p class='bcode'>
- <jc>// Parse URL-encoded string into a generic POJO model.</jc>
- ObjectMap m = UonParser.<jsf>DEFAULT</jsf>.parse(urlencoded,
ObjectMap.<jk>class</jk>);
-
- <jc>// Get some simple values.</jc>
- String name = m.getString(<js>"name"</js>);
- <jk>int</jk> id = m.getInt(<js>"id"</js>);
-
- <jc>// Get a value convertable from a String.</jc>
- URI uri = m.get(URI.<jk>class</jk>, <js>"uri"</js>);
-
- <jc>// Get a value using a transform.</jc>
- CalendarSwap transform = <jk>new</jk> CalendarSwap.ISO8601DTZ();
- Calendar birthDate = m.get(transform, <js>"birthDate"</js>);
-
- <jc>// Get the addresses.</jc>
- ObjectList addresses = m.getObjectList(<js>"addresses"</js>);
-
- <jc>// Get the first address and convert it to a bean.</jc>
- Address address = addresses.get(Address.<jk>class</jk>, 0);
- </p>
-
- <p>
- As a general rule, parsing into beans is often more
efficient than parsing into generic models.
- <br>And working with beans is often less error prone
than working with generic models.
- </p>
- </div>
-
-
- <!--
========================================================================================================
-->
<a id="ParserConfigurableProperties"></a>
<h3 class='topic' onclick='toggle(this)'>3.2 - Configurable
properties</h3>
<div class='topic'>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/package.html
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/package.html
index 11b216c..721625a 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/package.html
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/package.html
@@ -63,15 +63,12 @@
</ol>
<li><p><a class='doclink'
href='#UrlEncodingSerializer'>UrlEncodingSerializer and UonSerializer
classes</a></p>
<ol>
- <li><p><a class='doclink' href='#BeanAnnotations'>@Bean and
@BeanProperty annotations</a></p>
<li><p><a class='doclink'
href='#Collections'>Collections</a></p>
- <li><p><a class='doclink' href='#Recursion'> Non-tree models
and recursion detection</a></p>
<li><p><a class='doclink'
href='#SerializerConfigurableProperties'>Configurable properties</a></p>
<li><p><a class='doclink' href='#SerializerOtherNotes'>Other
notes</a></p>
</ol>
<li><p><a class='doclink' href='#UrlEncodingParser'>UrlEncodingParser
and UonParser classes</a></p>
<ol>
- <li><p><a class='doclink' href='#GenericParsing'>Parsing into
generic POJO models</a></p>
<li><p><a class='doclink'
href='#ParserConfigurableProperties'>Configurable properties</a></p>
<li><p><a class='doclink' href='#ParserOtherNotes'>Other
notes</a></p>
</ol>
@@ -428,101 +425,6 @@
<!--
========================================================================================================
-->
- <a id="BeanAnnotations"></a>
- <h3 class='topic' onclick='toggle(this)'>2.1 - @Bean and @BeanProperty
annotations</h3>
- <div class='topic'>
- <p>
- The {@link org.apache.juneau.annotation.Bean @Bean} and
{@link org.apache.juneau.annotation.BeanProperty @BeanProperty}
- annotations are used to customize the behavior of beans
across the entire framework.
- <br>They have various uses:
- </p>
- <ul>
- <li>Hiding bean properties.
- <li>Specifying the ordering of bean properties.
- <li>Overriding the names of bean properties.
- <li>Associating transforms at both the class and
property level (to convert non-serializable POJOs to
- serializable forms).
- </ul>
- <p>
- For example, we now add a <code>birthDate</code>
property, and associate a transform with it to transform
- it to an ISO8601 date-time string in GMT time.
- <br>We'll also add a couple of <code>URI</code>
properties.
- <br>By default, <code>Calendars</code> are treated as
beans by the framework, which is usually not how you want
- them serialized.
- <br>Using transforms, we can convert them to
standardized string forms.
- </p>
- <p class='bcode'>
- <jk>public class</jk> Person {
- <jc>// Bean properties</jc>
- <jk>public int</jk> <jf>id</jf>;
- <jk>public</jk> String <jf>name</jf>;
- <jk>public</jk> URI <jf>uri</jf>;
- <jk>public</jk> URI <jf>addressBookUri</jf>;
-
-
<ja>@BeanProperty</ja>(swap=CalendarSwap.ISO8601DTZ.<jk>class</jk>)
<jk>public</jk> Calendar <jf>birthDate</jf>;
-
- <jc>// Bean constructor (needed by parser)</jc>
- <jk>public</jk> Person() {}
-
- <jc>// Normal constructor</jc>
- <jk>public</jk> Person(<jk>int</jk> id, String name, String
uri, String addressBookUri, String birthDate)
- <jk>throws</jk> Exception {
- <jk>this</jk>.<jf>id</jf> = id;
- <jk>this</jk>.<jf>name</jf> = name;
- <jk>this</jk>.<jf>uri</jf> = <jk>new</jk> URI(uri);
- <jk>this</jk>.<jf>addressBookUri</jf> = <jk>new</jk>
URI(addressBookUri);
- <jk>this</jk>.<jf>birthDate</jf> = <jk>new</jk>
GregorianCalendar();
- <jk>this</jk>.<jf>birthDate</jf>
-
.setTime(DateFormat.<jsm>getDateInstance</jsm>(DateFormat.<jsf>MEDIUM</jsf>)
- .parse(birthDate));
- }
- }
- </p>
- <p>
- Next, we alter our code to pass in the birthdate:
- </p>
- <p class='bcode'>
- <jc>// Create our bean.</jc>
- Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>,
<js>"http://sample/addressBook/person/1"</js>,
- <js>"http://sample/addressBook"</js>, <js>"Aug 12, 1946"</js>);
- </p>
- <p>
- Now when we rerun the sample code, we'll get the
following:
- </p>
- <p class='bcode'>
-
(<ua>id</ua>=<un>1</un>,<ua>name</ua>=<us>'John+Smith'</us>,<ua>uri</ua>=<us>http://sample/addressBook/person/1</us>,
-
<ua>addressBookUri</ua>=<us>http://sample/addressBook</us>,<ua>birthDate</ua>=<us>1946-08-12T00:00:00Z</us>)
- </p>
- <p>
- Using <code>UrlEncodingSerializer</code> instead would
create the following:
- </p>
- <p class='bcode'>
-
<ua>id</ua>=<un>1</un>&<ua>name</ua>=<us>'John+Smith'</us>&<ua>uri</ua>=<us>http://sample/addressBook/person/1</us>
-
&<ua>addressBookUri</ua>=<us>http://sample/addressBook</us>&<ua>birthDate</ua>=<us>1946-08-12T00:00:00Z</us>
- </p>
- <p>
- Another useful feature is the {@link
org.apache.juneau.annotation.Bean#propertyNamer() @Bean.propertyNamer()}
annotation that
- allows you to plug in your own logic for determining
bean property names.
- <br>The {@link org.apache.juneau.PropertyNamerDLC} is
an example of an alternate property namer.
- It converts bean property names to lowercase-dashed
format.
- </p>
-
- <h5 class='figure'>Example:</h5>
- <p class='bcode'>
- <ja>@Bean</ja>(propertyNamer=PropertyNamerDLC.<jk>class</jk>)
- <jk>public class</jk> Person {
- ...
- </p>
-
- <h5 class='figure'>Results</h5>
- <p class='bcode'>
-
(<ua>id</ua>=<un>1</us>,<ua>name</ua>=<us>'John+Smith'</us>,<ua>uri</ua>=<us>http://sample/addressBook/person/1</us>,
-
<ua>address-book-uri</ua>=<us>http://sample/addressBook</us>,<ua>birth-date</ua>=<us>1946-08-12T00:00:00Z</us>)
- </p>
- </div>
-
-
- <!--
========================================================================================================
-->
<a id="Collections"></a>
<h3 class='topic' onclick='toggle(this)'>2.2 - Collections</h3>
<div class='topic'>
@@ -628,75 +530,6 @@
<!--
========================================================================================================
-->
- <a id="Recursion"></a>
- <h3 class='topic' onclick='toggle(this)'>2.3 - Non-tree models and
recursion detection</h3>
- <div class='topic'>
- <p>
- The URL-encoding serializer is designed to be used
against POJO tree structures.
- <br>It expects that there not be loops in the POJO
model (e.g. children with references to parents, etc...).
- <br>If you try to serialize models with loops, you will
usually cause a <code>StackOverflowError</code> to
- be thrown (if {@link
org.apache.juneau.serializer.Serializer#SERIALIZER_maxDepth} is not reached
first).
- </p>
- <p>
- If you still want to use the URL-encoding serializer on
such models, Juneau provides the
- {@link
org.apache.juneau.serializer.Serializer#SERIALIZER_detectRecursions} setting.
- <br>It tells the serializer to look for instances of an
object in the current branch of the tree and
- skip serialization when a duplicate is encountered.
- </p>
- <p>
- For example, let's make a POJO model out of the
following classes:
- </p>
- <p class='bcode'>
- <jk>public class</jk> A {
- <jk>public</jk> B b;
- }
-
- <jk>public class</jk> B {
- <jk>public</jk> C c;
- }
-
- <jk>public class</jk> C {
- <jk>public</jk> A a;
- }
- </p>
- <p>
- Now we create a model with a loop and serialize the
results.
- </p>
- <p class='bcode'>
- <jc>// Clone an existing serializer and set property for detecting
recursions.</jc>
- UrlEncodingSerializer s =
UrlEncodingSerializer.<jsf>DEFAULT_READABLE</jsf>.builder()
- .detectRecursions(<jk>true</jk>).build();
-
- <jc>// Create a recursive loop.</jc>
- A a = <jk>new</jk> A();
- a.<jf>b</jf> = <jk>new</jk> B();
- a.<jf>b</jf>.<jf>c</jf> = <jk>new</jk> C();
- a.<jf>b</jf>.<jf>c</jf>.<jf>a</jf> = a;
-
- <jc>// Serialize.</jc>
- String json = s.serialize(a);
- </p>
- <p>
- What we end up with is the following, which does not
serialize the contents of the <code>c</code> field:
- </p>
- <p class='bcode'>
- (
- <ua>b</ua>=(
- <ua>c</ua>=()
- )
- )
- </p>
- <p>
- Without recursion detection enabled, this would cause a
stack-overflow error.
- </p>
- <p>
- Recursion detection introduces a performance penalty of
around 20%.
- <br>For this reason the setting is disabled by default.
- </p>
- </div>
-
-
- <!--
========================================================================================================
-->
<a id="SerializerConfigurableProperties"></a>
<h3 class='topic' onclick='toggle(this)'>2.4 - Configurable
properties</h3>
<div class='topic'>
@@ -857,121 +690,6 @@
<!--
========================================================================================================
-->
- <a id="GenericParsing"></a>
- <h3 class='topic' onclick='toggle(this)'>3.1 - Parsing into generic
POJO models</h3>
- <div class='topic'>
- <p>
- The URL-encoding parser is not limited to parsing back
into the original bean classes.
- <br>If the bean classes are not available on the
parsing side, the parser can also be used to parse into a
- generic model consisting of <code>Maps</code>,
<code>Collections</code>, and primitive objects.
- </p>
- <p>
- You can parse into any <code>Map</code> type (e.g.
<code>HashMap</code>, <code>TreeMap</code>), but
- using {@link org.apache.juneau.ObjectMap} is
recommended since it has many convenience methods
- for converting values to various types.
- <br>The same is true when parsing collections. You can
use any Collection (e.g. <code>HashSet</code>,
- <code>LinkedList</code>) or array (e.g.
<code>Object[]</code>, <code>String[]</code>,
- <code>String[][]</code>), but using {@link
org.apache.juneau.ObjectList} is recommended.
- </p>
- <p>
- When the map or list type is not specified, or is the
abstract <code>Map</code>, <code>Collection</code>,
- or <code>List</code> types, the parser will use
<code>ObjectMap</code> and <code>ObjectList</code> by
- default.
- </p>
- <p>
- Starting back with our original URL-encoded string:
- </p>
- <p class='bcode'>
- (
- <ua>id</ua>=<un>1</un>,
- <ua>name</ua>=<us>'John+Smith'</us>,
- <ua>uri</ua>=<us>http://sample/addressBook/person/1</us>,
- <ua>addressBookUri</ua>=<us>http://sample/addressBook</us>,
- <ua>birthDate</ua>=<us>1946-08-12T00:00:00Z</us>,
- <ua>addresses</ua>=@(
- (
-
<ua>uri</ua>=<us>http://sample/addressBook/address/1</us>,
-
<ua>personUri</ua>=<us>http://sample/addressBook/person/1</us>,
- <ua>id</ua>=<un>1</un>,
- <ua>street</ua>=<us>'100+Main+Street'</us>,
- <ua>city</ua>=<us>Anywhereville</us>,
- <ua>state</ua>=<us>NY</us>,
- <ua>zip</ua>=<un>12345</un>,
- <ua>isCurrent</ua>=<uk>true</uk>
- )
- )
- )
- </p>
- <p>
- We can parse this into a generic <code>ObjectMap</code>:
- </p>
- <p class='bcode'>
- <jc>// Parse URL-encoded string into a generic POJO model.</jc>
- ObjectMap m = UonParser.<jsf>DEFAULT</jsf>.parse(urlencoded,
ObjectMap.<jk>class</jk>);
-
- <jc>// Convert it back to JSON.</jc>
- String json =
JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.serialize(m);
- </p>
- <p>
- What we end up with is the exact same output.
- <br>Even the numbers and booleans are preserved because
they are parsed into <code>Number</code> and
- <code>Boolean</code> objects when parsing into generic
models.
- </p>
- <p class='bcode'>
- {
- id: <un>1</un>,
- name: <js>'John Smith'</js>,
- uri: <js>'http://sample/addressBook/person/1'</js>,
- addressBookUri: <js>'http://sample/addressBook'</js>,
- birthDate: <js>'1946-08-12T00:00:00Z'</js>,
- addresses: [
- {
- uri:
<js>'http://sample/addressBook/address/1'</js>,
- personUri:
<js>'http://sample/addressBook/person/1'</js>,
- id: <un>1</un>,
- street: <js>'100 Main Street'</js>,
- city: <js>'Anywhereville'</js>,
- state: <js>'NY'</js>,
- zip: <un>12345</un>,
- isCurrent: <jk>true</jk>
- }
- ]
- }
- </p>
- <p>
- Once parsed into a generic model, various convenience
methods are provided on the <code>ObjectMap</code>
- and <code>ObjectList</code> classes to retrieve
values:
- </p>
- <p class='bcode'>
- <jc>// Parse URL-encoded string into a generic POJO model.</jc>
- ObjectMap m = UonParser.<jsf>DEFAULT</jsf>.parse(urlencoded,
ObjectMap.<jk>class</jk>);
-
- <jc>// Get some simple values.</jc>
- String name = m.getString(<js>"name"</js>);
- <jk>int</jk> id = m.getInt(<js>"id"</js>);
-
- <jc>// Get a value convertable from a String.</jc>
- URI uri = m.get(URI.<jk>class</jk>, <js>"uri"</js>);
-
- <jc>// Get a value using a transform.</jc>
- CalendarSwap transform = <jk>new</jk> CalendarSwap.ISO8601DTZ();
- Calendar birthDate = m.get(transform, <js>"birthDate"</js>);
-
- <jc>// Get the addresses.</jc>
- ObjectList addresses = m.getObjectList(<js>"addresses"</js>);
-
- <jc>// Get the first address and convert it to a bean.</jc>
- Address address = addresses.get(Address.<jk>class</jk>, 0);
- </p>
-
- <p>
- As a general rule, parsing into beans is often more
efficient than parsing into generic models.
- <br>And working with beans is often less error prone
than working with generic models.
- </p>
- </div>
-
-
- <!--
========================================================================================================
-->
<a id="ParserConfigurableProperties"></a>
<h3 class='topic' onclick='toggle(this)'>3.2 - Configurable
properties</h3>
<div class='topic'>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/package.html
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/package.html
index 1d2df4e..6649d97 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/package.html
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/package.html
@@ -74,16 +74,13 @@
<ol>
<li><p><a class='doclink'
href='#AutoDetectNamespaces'>Auto-detection of namespaces</a></p>
</ol>
- <li><p><a class='doclink' href='#BeanAnnotations'>@Bean and
@BeanProperty annotations</a></p>
<li><p><a class='doclink'
href='#Collections'>Collections</a></p>
<li><p><a class='doclink' href='#XmlSchemaSupport'>XML-Schema
support</a></p>
- <li><p><a class='doclink' href='#Recursion'> Non-tree models
and recursion detection</a></p>
<li><p><a class='doclink'
href='#SerializerConfigurableProperties'>Configurable properties</a></p>
<li><p><a class='doclink' href='#SerializerOtherNotes'>Other
notes</a></p>
</ol>
<li><p><a class='doclink' href='#XmlParser'>XmlParser class</a></p>
<ol>
- <li><p><a class='doclink' href='#GenericParsing'>Parsing into
generic POJO models</a></p>
<li><p><a class='doclink'
href='#ParserConfigurableProperties'>Configurable properties</a></p>
<li><p><a class='doclink' href='#ParserOtherNotes'>Other
notes</a></p>
</ol>
@@ -2180,105 +2177,6 @@
</div>
- <!--
========================================================================================================
-->
- <a id="BeanAnnotations"></a>
- <h3 class='topic' onclick='toggle(this)'>2.4 - @Bean and @BeanProperty
annotations</h3>
- <div class='topic'>
- <p>
- The {@link org.apache.juneau.annotation.Bean @Bean} and
{@link org.apache.juneau.annotation.BeanProperty @BeanProperty}
- annotations are used to customize the behavior of beans
across the entire framework.
- <br>In addition to using them to identify the resource
URI for the bean shown above, they have various other
- uses:
- </p>
- <ul class='spaced-list'>
- <li>
- Hiding bean properties.
- <li>
- Specifying the ordering of bean properties.
- <li>
- Overriding the names of bean properties.
- <li>
- Associating transforms at both the class and
property level (to convert non-serializable POJOs to
- serializable forms).
- </ul>
- <p>
- For example, we now add a <code>birthDate</code>
property, and associate a transform with it to transform
- it to an ISO8601 date-time string in GMT time.
- <br>By default, <code>Calendars</code> are treated as
beans by the framework, which is usually not how you want
- them serialized.
- <br>Using transforms, we can convert them to
standardized string forms.
- </p>
- <p class='bcode'>
- <ja>@Xml</ja>(prefix=<js>"per"</js>)
- <ja>@Bean</ja>(typeName=<js>"person"</js>)
- <jk>public class</jk> Person {
-
- <jc>// Bean properties</jc>
-
<ja>@BeanProperty</ja>(swap=CalendarSwap.ISO8601DTZ.<jk>class</jk>)
<jk>public</jk> Calendar birthDate;
- ...
-
- <jc>// Normal constructor</jc>
- <jk>public</jk> Person(<jk>int</jk> id, String name, String
uri, String addressBookUri, String birthDate)
- <jk>throws</jk> Exception {
- ...
- <jk>this</jk>.<jf>birthDate</jf> = <jk>new</jk>
GregorianCalendar();
- <jk>this</jk>.<jf>birthDate</jf>
-
.setTime(DateFormat.<jsm>getDateInstance</jsm>(DateFormat.<jsf>MEDIUM</jsf>)
- .parse(birthDate));
- }
- }
- </p>
- <p>
- Next, we alter our code to pass in the birthdate:
- </p>
- <p class='bcode'>
- <jc>// Create our bean.</jc>
- Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>,
<js>"http://sample/addressBook/person/1"</js>,
- <js>"http://sample/addressBook"</js>, <js>"Aug 12, 1946"</js>);
- </p>
- <p>
- Now when we rerun the sample code, we'll get the
following:
- </p>
- <p class='bcode'>
- <xt><per:person</xt>
-
<xa>xmlns</xa>=<xs>'http://www.apache.org/2013/Juneau'</xs>
-
<xa>xmlns:per</xa>=<xs>'http://www.apache.org/person/'</xs>
-
<xa>uri</xa>=<xs>'http://sample/addressBook/person/1'</xs><xt>></xt>
- <xt><per:id></xt>1<xt></per:id></xt>
- <xt><per:name></xt>John Smith<xt></per:name></xt>
-
<xt><per:addressBookUri></xt>http://sample/addressBook<xt></per:addressBookUri></xt>
-
<xt><per:birthDate></xt>1946-08-12T00:00:00Z<xt></per:birthDate></xt>
- <xt></per:person></xt>
- </p>
- <p>
- Another useful feature is the {@link
org.apache.juneau.annotation.Bean#propertyNamer() @Bean.propertyNamer()}
annotation that
- allows you to plug in your own logic for determining
bean property names.
- <br>The {@link org.apache.juneau.PropertyNamerDLC} is
an example of an alternate property namer.
- It converts bean property names to lowercase-dashed
format.
- </p>
-
- <h5 class='figure'>Example</h5>
- <p class='bcode'>
- <ja>@Xml</ja>(prefix=<js>"per"</js>)
-
<ja>@Bean</ja>(typeName=<js>"person"</js>,propertyNamer=PropertyNamerDLC.<jk>class</jk>)
- <jk>public class</jk> Person {
- ...
- </p>
-
- <h5 class='figure'>Results</h5>
- <p class='bcode'>
- <xt><per:person</xt>
-
<xa>xmlns</xa>=<xs>'http://www.apache.org/2013/Juneau'</xs>
-
<xa>xmlns:per</xa>=<xs>'http://www.apache.org/person/'</xs>
-
<xa>uri</xa>=<xs>'http://sample/addressBook/person/1'</xs><xt>></xt>
- <xt><per:id></xt>1<xt></per:id></xt>
- <xt><per:name></xt>John Smith<xt></per:name></xt>
-
<xt><per:address-book-uri></xt>http://sample/addressBook<xt></per:address-book-uri></xt>
-
<xt><per:birth-date></xt>1946-08-12T04:00:00Z<xt></per:birth-date></xt>
- <xt></per:person></xt>
- </p>
- </div>
-
<!--
========================================================================================================
-->
<a id="Collections"></a>
@@ -2702,81 +2600,6 @@
<!--
========================================================================================================
-->
- <a id="Recursion"></a>
- <h3 class='topic' onclick='toggle(this)'>2.7 - Non-tree models and
recursion detection</h3>
- <div class='topic'>
- <p>
- The XML serializer is designed to be used against POJO
tree structures.
- <br>It expects that there not be loops in the POJO
model (e.g. children with references to parents, etc...).
- <br>If you try to serialize models with loops, you will
usually cause a <code>StackOverflowError</code> to
- be thrown (if {@link
org.apache.juneau.serializer.Serializer#SERIALIZER_maxDepth} is not reached
- first).
- </p>
- <p>
- If you still want to use the XML serializer on such
models, Juneau provides the
- {@link
org.apache.juneau.serializer.Serializer#SERIALIZER_detectRecursions} setting.
- <br>It tells the serializer to look for instances of an
object in the current branch of the tree and skip
- serialization when a duplicate is encountered.
- </p>
- <p>
- For example, let's make a POJO model out of the
following classes:
- </p>
- <p class='bcode'>
- <ja>@Bean</ja>(typeName=<js>"a"</js>)
- <jk>public class</jk> A {
- <jk>public</jk> B b;
- }
-
- <jk>public class</jk> B {
- <jk>public</jk> C c;
- }
-
- <jk>public class</jk> C {
- <jk>public</jk> A a;
- }
- </p>
- <p>
- Now we create a model with a loop and serialize the
results.
- </p>
- <p class='bcode'>
- <jc>// Create a new serializer with readable output.</jc>
- XmlSerializer s = XmlSerializer.<jsm>create</jsm>()
- .ws()
- .sq()
- .ns()
- .detectRecursions(<jk>true</jk>)
- .build();
-
- <jc>// Create a recursive loop.</jc>
- A a = <jk>new</jk> A();
- a.<jf>b</jf> = <jk>new</jk> B();
- a.<jf>b</jf>.<jf>c</jf> = <jk>new</jk> C();
- a.<jf>b</jf>.<jf>c</jf>.<jf>a</jf> = a;
-
- <jc>// Serialize to XML.</jc>
- String xml = s.serialize(a);
- </p>
- <p>
- What we end up with is the following, which does not
serialize the contents of the <code>c</code> field:
- </p>
- <p class='bcode'>
- <xt><a></xt>
- <xt><b></xt>
- <xt><c/></xt>
- <xt></b></xt>
- <xt></a></xt>
- </p>
- <p>
- Without recursion detection enabled, this would cause a
stack-overflow error.
- </p>
- <p>
- Recursion detection introduces a performance penalty of
around 20%.
- <br>For this reason the setting is disabled by default.
- </p>
- </div>
-
-
- <!--
========================================================================================================
-->
<a id="SerializerConfigurableProperties"></a>
<h3 class='topic' onclick='toggle(this)'>2.8 - Configurable
properties</h3>
<div class='topic'>
@@ -2908,31 +2731,6 @@
<!--
========================================================================================================
-->
- <a id="GenericParsing"></a>
- <h3 class='topic' onclick='toggle(this)'>3.1 - Parsing into generic
POJO models</h3>
- <div class='topic'>
- <p>
- The XML parser is not limited to parsing back into the
original bean classes.
- <br>If the bean classes are not available on the
parsing side, the parser can also be used to parse into a
- generic model consisting of <code>Maps</code>,
<code>Collections</code>, and primitive objects.
- </p>
- <p>
- You can parse into any <code>Map</code> type (e.g.
<code>HashMap</code>, <code>TreeMap</code>), but
- using {@link org.apache.juneau.ObjectMap} is
recommended since it has many convenience methods
- for converting values to various types.
- <br>The same is true when parsing collections. You can
use any Collection (e.g. <code>HashSet</code>,
- <code>LinkedList</code>) or array (e.g.
<code>Object[]</code>, <code>String[]</code>,
- <code>String[][]</code>), but using {@link
org.apache.juneau.ObjectList} is recommended.
- </p>
- <p>
- When the map or list type is not specified, or is the
abstract <code>Map</code>, <code>Collection</code>,
- or <code>List</code> types, the parser will use
<code>ObjectMap</code> and <code>ObjectList</code> by
- default.
- </p>
- </div>
-
-
- <!--
========================================================================================================
-->
<a id="ParserConfigurableProperties"></a>
<h3 class='topic' onclick='toggle(this)'>3.2 - Configurable
properties</h3>
<div class='topic'>
diff --git a/juneau-doc/src/main/javadoc/overview.html
b/juneau-doc/src/main/javadoc/overview.html
index e89e16a..61a869f 100644
--- a/juneau-doc/src/main/javadoc/overview.html
+++ b/juneau-doc/src/main/javadoc/overview.html
@@ -115,19 +115,70 @@
<li><p><a class='doclink'
href='#juneau-marshall.BeanSubTypes'>Bean Subtypes</a></p>
</ol>
<li><p><a class='doclink'
href='#juneau-marshall.VirtualBeans'>Virtual Beans</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.Recursion'>Non-Tree Models and Recursion
Detection</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.ParsingIntoGenericModels'>Parsing into Generic
Models</a></p>
<li><p><a class='doclink'
href='#juneau-marshall.ReadingContinuousStreams'>Reading Continuous
Streams</a></p>
<li><p><a class='doclink'
href='#juneau-marshall.JacksonComparison'>Comparison with Jackson</a></p>
<li><p><a class='doclink'
href='#juneau-marshall.PojoCategories'>POJO Categories</a></p>
<li><p><a class='doclink'
href='#juneau-marshall.BestPractices'>Best Practices</a></p>
<li><p><a class='doclink'
href='#juneau-marshall.JsonDetails'>JSON Details</a></p>
+ <ol>
+ <li><p><a class='doclink'
href='#juneau-marshall.JsonDetails.Methodology'>JSON Methodology</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.JsonDetails.Serializers'>Serializers</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.JsonDetails.Parsers'>Parsers</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.JsonDetails.ConfigurableProperties'>Configurable
Properties</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.JsonDetails.JsonAnnotation'>@Json Annotation</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.JsonDetails.JsonSchema'>JSON-Schema Support</a></p>
+ </ol>
<li><p><a class='doclink'
href='#juneau-marshall.XmlDetails'>XML Details</a></p>
+ <ol>
+ <li><p><a class='doclink'
href='#juneau-marshall.XmlDetails.Methodology'>XML Methodology</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.XmlDetails.Serializers'>Serializers</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.XmlDetails.Parsers'>Parsers</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.XmlDetails.ConfigurableProperties'>Configurable
Properties</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.XmlDetails.XmlAnnotation'>@Xml Annotation</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.XmlDetails.Namespaces'>Namespaces</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.XmlDetails.XmlSchema'>XML-Schema Support</a></p>
+ </ol>
<li><p><a class='doclink'
href='#juneau-marshall.HtmlDetails'>HTML Details</a></p>
+ <ol>
+ <li><p><a class='doclink'
href='#juneau-marshall.HtmlDetails.Methodology'>HTML Methodology</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.HtmlDetails.Serializers'>Serializers</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.HtmlDetails.Parsers'>Parsers</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.HtmlDetails.ConfigurableProperties'>Configurable
Properties</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.HtmlDetails.HtmlAnnotation'>@Html Annotation</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.HtmlDetails.HtmlSchema'>HTML-Schema Support</a></p>
+ </ol>
<li><p><a class='doclink'
href='#juneau-marshall.UonDetails'>UON Details</a></p>
+ <ol>
+ <li><p><a class='doclink'
href='#juneau-marshall.UonDetails.Methodology'>UON Methodology</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.UonDetails.Serializers'>Serializers</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.UonDetails.Parsers'>Parsers</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.UonDetails.ConfigurableProperties'>Configurable
Properties</a></p>
+ </ol>
<li><p><a class='doclink'
href='#juneau-marshall.UrlEncodingDetails'>URL-Encoding Details</a></p>
+ <ol>
+ <li><p><a class='doclink'
href='#juneau-marshall.UrlEncodingDetails.Methodology'>URL-Encoding
Methodology</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.UrlEncodingDetails.Serializers'>Serializers</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.UrlEncodingDetails.Parsers'>Parsers</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.UrlEncodingDetails.ConfigurableProperties'>Configurable
Properties</a></p>
+ <li><p><a class='doclink'
href='#juneau-marshall.UrlEncodingDetails.UrlEncodingAnnotation'>@UrlEncoding
Annotation</a></p>
+ </ol>
</ol>
<li><p class='toc2'><a class='doclink'
href='#juneau-marshall-rdf'><i>juneau-marshall-rdf</i></a></p>
<ol>
<li><p><a class='doclink'
href='#juneau-marshall-rdf.RdfDetails'>RDF Details</a></p>
+ <ol>
+ <li><p><a class='doclink'
href='#juneau-marshall.RdfDetails.Methodology'>RDF Methodology</a></p>
+ <li><p><a class='doclink'
href='juneau-marshall-rdf.RdfDetails.Serializers'>Serializers</a></p>
+ <li><p><a class='doclink'
href='juneau-marshall-rdf.RdfDetails.Parsers'>Parsers</a></p>
+ <li><p><a class='doclink'
href='juneau-marshall-rdf.RdfDetails.ConfigurableProperties'>Configurable
Properties</a></p>
+ <li><p><a class='doclink'
href='juneau-marshall-rdf.RdfDetails.RdfAnnotation'>@Rdf Annotation</a></p>
+ <li><p><a class='doclink'
href='juneau-marshall-rdf.RdfDetails.Namespaces'>Namespaces</a></p>
+ <li><p><a class='doclink'
href='juneau-marshall-rdf.RdfDetails.UriProperties'>URI Properties</a></p>
+ <li><p><a class='doclink'
href='juneau-marshall-rdf.RdfDetails.RootProperty'>Root Property</a></p>
+ <li><p><a class='doclink'
href='juneau-marshall-rdf.RdfDetails.TypedLiterals'>Typed Literals</a></p>
+ </ol>
</ol>
<li><p class='toc2'><a class='doclink'
href='#juneau-dto'><i>juneau-dto</i></a></p>
<ol>
@@ -3195,12 +3246,196 @@
</p>
</div>
+ <!--
========================================================================================================
-->
+ <a id="juneau-marshall.Recursion"></a>
+ <h3 class='topic' onclick='toggle(this)'>2.10 - Non-Tree Models and
Recursion Detection</h3>
+ <div class='topic'>
+ <p>
+ The Juneau Serializer API is designed to be used
against POJO tree structures.
+ <br>It expects that there not be loops in the POJO
model (e.g. children with references to parents, etc...).
+ <br>If you try to serialize models with loops, you will
usually cause a <code>StackOverflowError</code> to
+ be thrown (if {@link
org.apache.juneau.serializer.Serializer#SERIALIZER_maxDepth} is not reached
+ first).
+ </p>
+ <p>
+ If you still want to use the Juneau serializers on such
models, Juneau provides the
+ {@link
org.apache.juneau.serializer.Serializer#SERIALIZER_detectRecursions} setting.
+ <br>It tells the serializer to look for instances of an
object in the current branch of the tree and skip
+ serialization when a duplicate is encountered.
+ </p>
+ <p>
+ For example, let's make a POJO model out of the
following classes:
+ </p>
+ <p class='bcode'>
+ <jk>public class</jk> A {
+ <jk>public</jk> B b;
+ }
+
+ <jk>public class</jk> B {
+ <jk>public</jk> C c;
+ }
+
+ <jk>public class</jk> C {
+ <jk>public</jk> A a;
+ }
+ </p>
+ <p>
+ Now we create a model with a loop and serialize the
results.
+ </p>
+ <p class='bcode'>
+ <jc>// Clone an existing serializer and set property for detecting
recursions.</jc>
+ JsonSerializer s =
JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.builder().detectRecursions(<jk>true</jk>).build();
+
+ <jc>// Create a recursive loop.</jc>
+ A a = <jk>new</jk> A();
+ a.<jf>b</jf> = <jk>new</jk> B();
+ a.<jf>b</jf>.<jf>c</jf> = <jk>new</jk> C();
+ a.<jf>b</jf>.<jf>c</jf>.<jf>a</jf> = a;
+
+ <jc>// Serialize to JSON.</jc>
+ String json = s.serialize(a);
+ </p>
+ <p>
+ What we end up with is the following, which does not
serialize the contents of the <code>c</code> field:
+ </p>
+ <p class='bcode'>
+ {
+ b: {
+ c: {
+ }
+ }
+ }
+ </p>
+ <p>
+ Without recursion detection enabled, this would cause a
stack-overflow error.
+ </p>
+ <p>
+ Recursion detection introduces a performance penalty of
around 20%.
+ <br>For this reason the setting is disabled by default.
+ </p>
+ </div>
+
+ <!--
========================================================================================================
-->
+ <a id="juneau-marshall.ParsingIntoGenericModels"></a>
+ <h3 class='topic' onclick='toggle(this)'>2.11 - Parsing into Generic
Models</h3>
+ <div class='topic'>
+ <p>
+ The Juneau parsers are not limited to parsing back into
the original bean classes.
+ <br>If the bean classes are not available on the
parsing side, the parser can also be used to
+ parse into a generic model consisting of
<code>Maps</code>, <code>Collections</code>, and primitive
+ objects.
+ </p>
+ <p>
+ You can parse into any <code>Map</code> type (e.g.
<code>HashMap</code>, <code>TreeMap</code>), but
+ using {@link org.apache.juneau.ObjectMap} is
recommended since it has many convenience methods
+ for converting values to various types.
+ <br>The same is true when parsing collections. You can
use any Collection (e.g. <code>HashSet</code>,
+ <code>LinkedList</code>) or array (e.g.
<code>Object[]</code>, <code>String[]</code>,
+ <code>String[][]</code>), but using {@link
org.apache.juneau.ObjectList} is recommended.
+ </p>
+ <p>
+ When the map or list type is not specified, or is the
abstract <code>Map</code>, <code>Collection</code>,
+ or <code>List</code> types, the parser will use
<code>ObjectMap</code> and <code>ObjectList</code> by
+ default.
+ </p>
+ <p>
+ Starting back with our original JSON:
+ </p>
+ <p class='bcode'>
+ {
+ id: <jk>1</jk>,
+ name: <js>'John Smith'</js>,
+ uri: <js>'http://sample/addressBook/person/1'</js>,
+ addressBookUri: <js>'http://sample/addressBook'</js>,
+ birthDate: <js>'1946-08-12T00:00:00Z'</js>,
+ addresses: [
+ {
+ uri:
<js>'http://sample/addressBook/address/1'</js>,
+ personUri:
<js>'http://sample/addressBook/person/1'</js>,
+ id: <jk>1</jk>,
+ street: <js>'100 Main Street'</js>,
+ city: <js>'Anywhereville'</js>,
+ state: <js>'NY'</js>,
+ zip: <jk>12345</jk>,
+ isCurrent: <jk>true</jk>
+ }
+ ]
+ }
+ </p>
+ <p>
+ We can parse this into a generic <code>ObjectMap</code>:
+ </p>
+ <p class='bcode'>
+ <jc>// Parse JSON into a generic POJO model.</jc>
+ ObjectMap m = JsonParser.<jsf>DEFAULT</jsf>.parse(json,
ObjectMap.<jk>class</jk>);
+
+ <jc>// Convert it back to JSON.</jc>
+ String json =
JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.serialize(m);
+ </p>
+ <p>
+ What we end up with is the exact same output.
+ <br>Even the numbers and booleans are preserved because
they are parsed into <code>Number</code> and
+ <code>Boolean</code> objects when parsing into generic
models.
+ </p>
+ <p class='bcode'>
+ {
+ id: <jk>1</jk>,
+ name: <js>'John Smith'</js>,
+ uri: <js>'http://sample/addressBook/person/1'</js>,
+ addressBookUri: <js>'http://sample/addressBook'</js>,
+ birthDate: <js>'1946-08-12T00:00:00Z'</js>,
+ addresses: [
+ {
+ uri:
<js>'http://sample/addressBook/address/1'</js>,
+ personUri:
<js>'http://sample/addressBook/person/1'</js>,
+ id: <jk>1</jk>,
+ street: <js>'100 Main Street'</js>,
+ city: <js>'Anywhereville'</js>,
+ state: <js>'NY'</js>,
+ zip: <jk>12345</jk>,
+ isCurrent: <jk>true</jk>
+ }
+ ]
+ }
+ </p>
+ <p>
+ Once parsed into a generic model, various convenience
methods are provided on the <code>ObjectMap</code>
+ and <code>ObjectList</code> classes to retrieve
values:
+ </p>
+ <p class='bcode'>
+ <jc>// Parse JSON into a generic POJO model.</jc>
+ ObjectMap m = JsonParser.<jsf>DEFAULT</jsf>.parse(json,
ObjectMap.<jk>class</jk>);
+
+ <jc>// Get some simple values.</jc>
+ String name = m.getString(<js>"name"</js>);
+ <jk>int</jk> id = m.getInt(<js>"id"</js>);
+
+ <jc>// Get a value convertable from a String.</jc>
+ URI uri = m.get(URI.<jk>class</jk>, <js>"uri"</js>);
+
+ <jc>// Get a value using a swap.</jc>
+ CalendarSwap swap = <jk>new</jk> CalendarSwap.ISO8601DTZ();
+ Calendar birthDate = m.get(swap, <js>"birthDate"</js>);
+
+ <jc>// Get the addresses.</jc>
+ ObjectList addresses = m.getObjectList(<js>"addresses"</js>);
+
+ <jc>// Get the first address and convert it to a bean.</jc>
+ Address address = addresses.get(Address.<jk>class</jk>, 0);
+ </p>
+
+ <p>
+ As a general rule, parsing into beans is often more
efficient than parsing into generic models.
+ <br>And working with beans is often less error prone
than working with generic models.
+ </p>
+ </div>
+
<!--
=======================================================================================================
-->
<a id="juneau-marshall.ReadingContinuousStreams"></a>
- <h3 class='topic' onclick='toggle(this)'>2.10 - Reading Continuous
Streams</h3>
+ <h3 class='topic' onclick='toggle(this)'>2.12 - Reading Continuous
Streams</h3>
<div class='topic'>
<p>
- The following parsers can be configured to read
continous streams of objects from the same input stream:
+ The following parsers can be configured to read
continuous streams of objects from the same input stream:
</p>
<ul>
<li class='jc'>{@link org.apache.juneau.json.JsonParser}
@@ -3209,7 +3444,7 @@
</ul>
<p>
The {@link org.apache.juneau.json.JsonParser} and
{@link org.apache.juneau.uon.UonParser}
- classes can read continous streams by using the {@link
org.apache.juneau.parser.Parser#PARSER_unbuffered}
+ classes can read continuous streams by using the {@link
org.apache.juneau.parser.Parser#PARSER_unbuffered}
setting.
<br>This prevents the parsers from using an internal
buffer that would read past the end of the currently
parsed POJO.
@@ -3249,7 +3484,7 @@
<!--
=======================================================================================================
-->
<a id="juneau-marshall.JacksonComparison"></a>
- <h3 class='topic' onclick='toggle(this)'>2.11 - Comparison with
Jackson</h3>
+ <h3 class='topic' onclick='toggle(this)'>2.13 - Comparison with
Jackson</h3>
<div class='topic'>
<p>
Juneau was developed independently from Jackson, but
shares many of the same features and capabilities.
@@ -3362,7 +3597,7 @@
<!--
=======================================================================================================
-->
<a id="juneau-marshall.PojoCategories"></a>
- <h3 class='topic' onclick='toggle(this)'>2.12 - POJO Categories</h3>
+ <h3 class='topic' onclick='toggle(this)'>2.14 - POJO Categories</h3>
<div class='topic'>
<p>
The following chart shows POJOs categorized into groups
and whether they can be serialized or parsed:
@@ -3628,7 +3863,7 @@
<!--
=======================================================================================================
-->
<a id="juneau-marshall.BestPractices"></a>
- <h3 class='topic' onclick='toggle(this)'>2.13 - Best Practices</h3>
+ <h3 class='topic' onclick='toggle(this)'>2.15 - Best Practices</h3>
<div class='topic'>
<ol class='spaced-list'>
<li>
@@ -3657,8 +3892,21 @@
<!--
=======================================================================================================
-->
<a id="juneau-marshall.JsonDetails"></a>
- <h3 class='topic' onclick='toggle(this)'>2.14 - JSON Details</h3>
+ <h3 class='topic' onclick='toggle(this)'>2.16 - JSON Details</h3>
<div class='topic'>
+ <p>
+ Juneau supports converting arbitrary POJOs to and from
JSON using ultra-efficient serializers and parsers.
+ <br>The JSON serializer converts POJOs directly to JSON
without the need for intermediate DOM objects using a
+ highly-efficient state machine.
+ <br>Likewise, the JSON parser creates POJOs directly
from JSON without the need for intermediate DOM objects.
+ </p>
+
+ <h5 class='topic'>Prerequisites</h5>
+ <p>
+ The Juneau JSON serialization and parsing support does
not require any external prerequisites.
+ <br>It only requires Java 1.6 or above.
+ </p>
+
<h5 class='toc'>Additional Information -
org.apache.juneau.json</h5>
<ol class='toc'>
<li><p><a class='doclink'
href='org/apache/juneau/json/package-summary.html#Overview'>JSON support
overview</a></p>
@@ -3667,25 +3915,120 @@
</ol>
<li><p><a class='doclink'
href='org/apache/juneau/json/package-summary.html#JsonSerializer'>JsonSerializer
class</a></p>
<ol>
- <li><p><a class='doclink'
href='org/apache/juneau/json/package-summary.html#BeanAnnotations'>@Bean and
@BeanProperty annotations</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/json/package-summary.html#Collections'>Collections</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/json/package-summary.html#JsonSchemaSupport'>JSON-Schema
support</a></p>
- <li><p><a class='doclink'
href='org/apache/juneau/json/package-summary.html#Recursion'> Non-tree models
and recursion detection</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/json/package-summary.html#SerializerConfigurableProperties'>Configurable
properties</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/json/package-summary.html#SerializerOtherNotes'>Other
notes</a></p>
</ol>
<li><p><a class='doclink'
href='org/apache/juneau/json/package-summary.html#JsonParser'>JsonParser
class</a></p>
<ol>
- <li><p><a class='doclink'
href='org/apache/juneau/json/package-summary.html#GenericParsing'>Parsing into
generic POJO models</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/json/package-summary.html#ParserConfigurableProperties'>Configurable
properties</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/json/package-summary.html#ParserOtherNotes'>Other
notes</a></p>
</ol>
</ol>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.JsonDetails.Methodology"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.16.1 - JSON
Methodology</h4>
+ <div class='topic'>
+ <p>
+ The JSON data type produced depends on the Java
object type being serialized.
+ </p>
+ <ul class='spaced-list'>
+ <li>
+ Primitives and primitive objects are
converted to JSON primitives.
+ <li>
+ Beans and Maps are converted to JSON
objects.
+ <li>
+ Collections and arrays are converted to
JSON arrays.
+ <li>
+ Anything else is converted to JSON
strings.
+ </ul>
+
+ <h5 class='topic'>Examples:</h5>
+ <table class='styled'>
+ <tr>
+ <th>POJO type</th>
+ <th>Example</th>
+ <th>Serialized form</th>
+ </tr>
+ <tr>
+ <td>String</td>
+
<td><code>serializer.serialize(<js>"foobar"</js>);</code></td>
+ <td><code><js>'foobar'</js></code>
+ </tr>
+ <tr>
+ <td>Number</td>
+
<td><code>serializer.serialize(123);</code></td>
+ <td><code><jk>123</jk></code>
+ </tr>
+ <tr>
+ <td>Boolean</td>
+
<td><code>serializer.serialize(<jk>true</jk>);</code></td>
+ <td><code><jk>true</jk></code>
+ </tr>
+ <tr>
+ <td>Null</td>
+
<td><code>serializer.serialize(<jk>null</jk>);</code></td>
+ <td><code><jk>null</jk></code>
+ </tr>
+ <tr>
+ <td>Beans with properties of any type
on this list</td>
+
<td><code>serializer.serialize(<jk>new</jk> MyBean());</code></td>
+
<td><code>{p1:<js>'val1'</js>,p2:<jk>true</jk>}</code>
+ </tr>
+ <tr>
+ <td>Maps with values of any type on
this list</td>
+
<td><code>serializer.serialize(<jk>new</jk> TreeMap());</code></td>
+
<td><code>{key1:<js>'val1'</js>,key2:<jk>true</jk>}</code>
+ </tr>
+ <tr>
+ <td>Collections and arrays of any type
on this list</td>
+
<td><code>serializer.serialize(<jk>new</jk>
Object[]{1,<js>"foo"</js>,<jk>true</jk>});</code></td>
+ <td><code>[1,'foo',true]</code>
+ </tr>
+ </table>
+ <p>
+ In addition, swaps can be used to convert
non-serializable POJOs into serializable forms, such as converting
+ <code>Calendar</code> object to ISO8601
strings, or <code><jk>byte</jk>[]</code> arrays to Base-64
+ encoded strings.
+ </p>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.JsonDetails.Serializers"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.16.2 -
Serializers</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.JsonDetails.Parsers"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.16.3 - Parsers</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.JsonDetails.ConfigurableProperties"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.16.4 - Configurable
Properties</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.JsonDetails.JsonAnnotation"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.16.5 - @Json
Annotation</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.JsonDetails.JsonSchema"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.16.6 - JSON-Schema
Support</h4>
+ <div class='topic'>
+ </div>
</div>
<!--
=======================================================================================================
-->
<a id="juneau-marshall.XmlDetails"></a>
- <h3 class='topic' onclick='toggle(this)'>2.15 - XML Details</h3>
+ <h3 class='topic' onclick='toggle(this)'>2.17 - XML Details</h3>
<div class='topic'>
<h5 class='toc'>Additional Information -
org.apache.juneau.xml</h5>
<ol class='toc'>
@@ -3706,36 +4049,111 @@
<ol>
<li><p><a class='doclink'
href='org/apache/juneau/xml/package-summary.html#AutoDetectNamespaces'>Auto-detection
of namespaces</a></p>
</ol>
- <li><p><a class='doclink'
href='org/apache/juneau/xml/package-summary.html#BeanAnnotations'>@Bean and
@BeanProperty annotations</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/xml/package-summary.html#Collections'>Collections</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/xml/package-summary.html#XmlSchemaSupport'>XML-Schema
support</a></p>
- <li><p><a class='doclink'
href='org/apache/juneau/xml/package-summary.html#Recursion'> Non-tree models
and recursion detection</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/xml/package-summary.html#SerializerConfigurableProperties'>Configurable
properties</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/xml/package-summary.html#SerializerOtherNotes'>Other
notes</a></p>
</ol>
<li><p><a class='doclink'
href='org/apache/juneau/xml/package-summary.html#XmlParser'>XmlParser
class</a></p>
<ol>
- <li><p><a class='doclink'
href='org/apache/juneau/xml/package-summary.html#GenericParsing'>Parsing into
generic POJO models</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/xml/package-summary.html#ParserConfigurableProperties'>Configurable
properties</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/xml/package-summary.html#ParserOtherNotes'>Other
notes</a></p>
</ol>
</ol>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.XmlDetails.Methodology"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.17.1 - XML
Methodology</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.XmlDetails.Serializers"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.17.2 -
Serializers</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.XmlDetails.Parsers"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.17.3 - Parsers</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.XmlDetails.ConfigurableProperties"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.17.4 - Configurable
Properties</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.XmlDetails.XmlAnnotation"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.17.5 - @Xml
Annotation</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.XmlDetails.Namespaces"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.17.6- Namespaces</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.XmlDetails.XmlSchema"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.17.7 - XML-Schema
Support</h4>
+ <div class='topic'>
+ </div>
</div>
<!--
=======================================================================================================
-->
<a id="juneau-marshall.HtmlDetails"></a>
- <h3 class='topic' onclick='toggle(this)'>2.16 - HTML Details</h3>
+ <h3 class='topic' onclick='toggle(this)'>2.18 - HTML Details</h3>
<div class='topic'>
<h5 class='toc'>Additional Information -
org.apache.juneau.html</h5>
<ol class='toc'>
<li><p><a class='doclink'
href='org/apache/juneau/html/package-summary.html#HtmlSerializer'>HTML
serialization support</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/html/package-summary.html#HtmlParser'>HTML parsing
support</a></p>
</ol>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.HtmlDetails.Methodology"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.18.1 - HTML
Methodology</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.HtmlDetails.Serializers"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.18.2 -
Serializers</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.HtmlDetails.Parsers"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.18.3 - Parsers</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.HtmlDetails.ConfigurableProperties"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.18.4 - Configurable
Properties</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.HtmlDetails.HtmlAnnotation"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.18.5 - @Html
Annotation</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.HtmlDetails.HtmlSchema"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.18.6 - HTML-Schema
Support</h4>
+ <div class='topic'>
+ </div>
</div>
<!--
=======================================================================================================
-->
<a id="juneau-marshall.UonDetails"></a>
- <h3 class='topic' onclick='toggle(this)'>2.17 - UON Details</h3>
+ <h3 class='topic' onclick='toggle(this)'>2.19 - UON Details</h3>
<div class='topic'>
<h5 class='toc'>Additional Information -
org.apache.juneau.uon</h5>
<ol class='toc'>
@@ -3745,24 +4163,45 @@
</ol>
<li><p><a class='doclink'
href='org/apache/juneau/uon/package-summary.html#UrlEncodingSerializer'>UrlEncodingSerializer
and UonSerializer classes</a></p>
<ol>
- <li><p><a class='doclink'
href='org/apache/juneau/uon/package-summary.html#BeanAnnotations'>@Bean and
@BeanProperty annotations</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/uon/package-summary.html#Collections'>Collections</a></p>
- <li><p><a class='doclink'
href='org/apache/juneau/uon/package-summary.html#Recursion'> Non-tree models
and recursion detection</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/uon/package-summary.html#SerializerConfigurableProperties'>Configurable
properties</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/uon/package-summary.html#SerializerOtherNotes'>Other
notes</a></p>
</ol>
<li><p><a class='doclink'
href='org/apache/juneau/uon/package-summary.html#UrlEncodingParser'>UrlEncodingParser
and UonParser classes</a></p>
<ol>
- <li><p><a class='doclink'
href='org/apache/juneau/uon/package-summary.html#GenericParsing'>Parsing into
generic POJO models</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/uon/package-summary.html#ParserConfigurableProperties'>Configurable
properties</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/uon/package-summary.html#ParserOtherNotes'>Other
notes</a></p>
</ol>
</ol>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.UonDetails.Methodology"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.19.1 - UON
Methodology</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.UonDetails.Serializers"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.19.2 -
Serializers</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.UonDetails.Parsers"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.19.3 - Parsers</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.UonDetails.ConfigurableProperties"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.19.4 - Configurable
Properties</h4>
+ <div class='topic'>
+ </div>
</div>
<!--
=======================================================================================================
-->
<a id="juneau-marshall.UrlEncodingDetails"></a>
- <h3 class='topic' onclick='toggle(this)'>2.18 - URL-Encoding
Details</h3>
+ <h3 class='topic' onclick='toggle(this)'>2.20 - URL-Encoding
Details</h3>
<div class='topic'>
<h5 class='toc'>Additional Information -
org.apache.juneau.urlencoding</h5>
<ol class='toc'>
@@ -3772,19 +4211,40 @@
</ol>
<li><p><a class='doclink'
href='org/apache/juneau/urlencoding/package-summary.html#UrlEncodingSerializer'>UrlEncodingSerializer
and UonSerializer classes</a></p>
<ol>
- <li><p><a class='doclink'
href='org/apache/juneau/urlencoding/package-summary.html#BeanAnnotations'>@Bean
and @BeanProperty annotations</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/urlencoding/package-summary.html#Collections'>Collections</a></p>
- <li><p><a class='doclink'
href='org/apache/juneau/urlencoding/package-summary.html#Recursion'> Non-tree
models and recursion detection</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/urlencoding/package-summary.html#SerializerConfigurableProperties'>Configurable
properties</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/urlencoding/package-summary.html#SerializerOtherNotes'>Other
notes</a></p>
</ol>
<li><p><a class='doclink'
href='org/apache/juneau/urlencoding/package-summary.html#UrlEncodingParser'>UrlEncodingParser
and UonParser classes</a></p>
<ol>
- <li><p><a class='doclink'
href='org/apache/juneau/urlencoding/package-summary.html#GenericParsing'>Parsing
into generic POJO models</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/urlencoding/package-summary.html#ParserConfigurableProperties'>Configurable
properties</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/urlencoding/package-summary.html#ParserOtherNotes'>Other
notes</a></p>
</ol>
</ol>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.UrlEncodingDetails.Methodology"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.20.1 - URL-Encoding
Methodology</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.UrlEncodingDetails.Serializers"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.20.2 -
Serializers</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall.UrlEncodingDetails.Parsers"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.20.3 - Parsers</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a
id="juneau-marshall.UrlEncodingDetails.ConfigurableProperties"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.20.4 - Configurable
Properties</h4>
+ <div class='topic'>
+ </div>
</div>
</div>
@@ -3877,21 +4337,72 @@
<ol>
<li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#Namespaces'>Namespaces</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#UriProperties'>URI
properties</a></p>
- <li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#BeanAnnotations'>@Bean and
@BeanProperty annotations</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#Collections'>Collections</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#RootProperty'>Root
property</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#TypedLiterals'>Typed
literals</a></p>
- <li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#Recursion'>Non-tree models
and recursion detection</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#SerializerConfigurableProperties'>Configurable
properties</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#SerializerOtherNotes'>Other
notes</a></p>
</ol>
<li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#RdfParser'>RdfParser
class</a></p>
<ol>
- <li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#GenericParsing'>Parsing into
generic POJO models</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#ParserConfigurableProperties'>Configurable
properties</a></p>
<li><p><a class='doclink'
href='org/apache/juneau/jena/package-summary.html#ParserOtherNotes'>Other
notes</a></p>
</ol>
</ol>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall-rdf.RdfDetails.Methodology"></a>
+ <h4 class='topic' onclick='toggle(this)'>3.1.1 - RDF
Methodology</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall-rdf.RdfDetails.Serializers"></a>
+ <h4 class='topic' onclick='toggle(this)'>3.1.2 -
Serializers</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall-rdf.RdfDetails.Parsers"></a>
+ <h4 class='topic' onclick='toggle(this)'>3.1.3 - Parsers</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a
id="juneau-marshall-rdf.RdfDetails.ConfigurableProperties"></a>
+ <h4 class='topic' onclick='toggle(this)'>3.1.4 - Configurable
Properties</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall-rdf.RdfDetails.RdfAnnotation"></a>
+ <h4 class='topic' onclick='toggle(this)'>3.1.5 - @Rdf
Annotation</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall-rdf.RdfDetails.Namespaces"></a>
+ <h4 class='topic' onclick='toggle(this)'>3.1.6 - Namespaces</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall-rdf.RdfDetails.UriProperties"></a>
+ <h4 class='topic' onclick='toggle(this)'>3.1.7 - URI
Properties</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall-rdf.RdfDetails.RootProperty"></a>
+ <h4 class='topic' onclick='toggle(this)'>3.1.8 - Root
Property</h4>
+ <div class='topic'>
+ </div>
+
+ <!--
=======================================================================================================
-->
+ <a id="juneau-marshall-rdf.RdfDetails.TypedLiterals"></a>
+ <h4 class='topic' onclick='toggle(this)'>3.1.9 - Typed
Literals</h4>
+ <div class='topic'>
+ </div>
</div>
</div>
--
To stop receiving notification emails like this one, please contact
[email protected].