| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (18) --> |
| <title>Uon (Apache Juneau 9.0.0)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="description" content="declaration: package: org.apache.juneau.marshaller, class: Uon"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <link rel="stylesheet" type="text/css" href="../../../../javadoc.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-3.5.1.min.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var evenRowColor = "even-row-color"; |
| var oddRowColor = "odd-row-color"; |
| var tableTab = "table-tab"; |
| var activeTableTab = "active-table-tab"; |
| var pathtoroot = "../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"></span><span class="nav-bar-toggle-icon"></span><span class="nav-bar-toggle-icon"></span></button> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html#class">Help</a></li> |
| </ul> |
| <ul class="sub-nav-list-small"> |
| <li> |
| <p>Summary:</p> |
| <ul> |
| <li>Nested</li> |
| <li><a href="#field-summary">Field</a></li> |
| <li><a href="#constructor-summary">Constr</a></li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| </li> |
| <li> |
| <p>Detail:</p> |
| <ul> |
| <li><a href="#field-detail">Field</a></li> |
| <li><a href="#constructor-detail">Constr</a></li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div id="navbar-sub-list"> |
| <ul class="sub-nav-list"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field-summary">Field</a> | </li> |
| <li><a href="#constructor-summary">Constr</a> | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li><a href="#field-detail">Field</a> | </li> |
| <li><a href="#constructor-detail">Constr</a> | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><label for="search-input">SEARCH:</label> |
| <input type="text" id="search-input" disabled placeholder="Search"> |
| <input type="reset" id="reset-button" disabled value="reset"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.apache.juneau.marshaller</a></div> |
| <h1 title="Class Uon" class="title">Class Uon</h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a> |
| <div class="inheritance"><a href="Marshaller.html" title="class in org.apache.juneau.marshaller">org.apache.juneau.marshaller.Marshaller</a> |
| <div class="inheritance"><a href="CharMarshaller.html" title="class in org.apache.juneau.marshaller">org.apache.juneau.marshaller.CharMarshaller</a> |
| <div class="inheritance">org.apache.juneau.marshaller.Uon</div> |
| </div> |
| </div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public class </span><span class="element-name"><a href="../../../../src-html/org/apache/juneau/marshaller/Uon.html#line-47">Uon</a></span> |
| <span class="extends-implements">extends <a href="CharMarshaller.html" title="class in org.apache.juneau.marshaller">CharMarshaller</a></span></div> |
| <div class="block">A pairing of a <a href="../uon/UonSerializer.html" title="class in org.apache.juneau.uon"><code>UonSerializer</code></a> and <a href="../uon/UonParser.html" title="class in org.apache.juneau.uon"><code>UonParser</code></a> into a single class with convenience read/write methods. |
| |
| <p> |
| The general idea is to combine a single serializer and parser inside a simplified API for reading and writing POJOs. |
| |
| <h5 class='figure'>Examples:</h5> |
| <p class='bjava'> |
| <jc>// Using instance.</jc> |
| Uon <jv>uon</jv> = <jk>new</jk> Uon(); |
| MyPojo <jv>myPojo</jv> = <jv>uon</jv>.read(<jv>string</jv>, MyPojo.<jk>class</jk>); |
| String <jv>string</jv> = <jv>uon</jv>.write(<jv>myPojo</jv>); |
| </p> |
| <p class='bjava'> |
| <jc>// Using DEFAULT instance.</jc> |
| MyPojo <jv>myPojo</jv> = Uon.<jsf>DEFAULT</jsf>.read(<jv>string</jv>, MyPojo.<jk>class</jk>); |
| String <jv>string</jv> = Uon.<jsf>DEFAULT</jsf>.write(<jv>myPojo</jv>); |
| </p> |
| |
| <h5 class='section'>See Also:</h5><ul> |
| <li class='link'><a class="doclink" href="../../../../index.html#jm.Marshallers">Marshallers</a> |
| </ul></div> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <li> |
| <section class="field-summary" id="field-summary"> |
| <h2>Field Summary</h2> |
| <div class="caption"><span>Fields</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Field</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>static final <a href="Uon.html" title="class in org.apache.juneau.marshaller">Uon</a></code></div> |
| <div class="col-second even-row-color"><code><a href="#DEFAULT" class="member-name-link">DEFAULT</a></code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Default reusable instance.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <li> |
| <section class="constructor-summary" id="constructor-summary"> |
| <h2>Constructor Summary</h2> |
| <div class="caption"><span>Constructors</span></div> |
| <div class="summary-table two-column-summary"> |
| <div class="table-header col-first">Constructor</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">Uon</a>()</code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Constructor.</div> |
| </div> |
| <div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(org.apache.juneau.uon.UonSerializer,org.apache.juneau.uon.UonParser)" class="member-name-link">Uon</a><wbr>(<a href="../uon/UonSerializer.html" title="class in org.apache.juneau.uon">UonSerializer</a> s, |
| <a href="../uon/UonParser.html" title="class in org.apache.juneau.uon">UonParser</a> p)</code></div> |
| <div class="col-last odd-row-color"> |
| <div class="block">Constructor.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method-summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel"> |
| <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#of(java.lang.Object)" class="member-name-link">of</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> object)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Serializes a Java object to a UON string.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#of(java.lang.Object,java.lang.Object)" class="member-name-link">of</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> object, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> output)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Serializes a Java object to a UON output.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <T> T</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#to(java.lang.Object,java.lang.Class)" class="member-name-link">to</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> input, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> type)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Parses a UON input object to the specified Java type.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <T> T</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#to(java.lang.Object,java.lang.reflect.Type,java.lang.reflect.Type...)" class="member-name-link">to</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> input, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Type.html" title="class or interface in java.lang.reflect" class="external-link">Type</a> type, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Type.html" title="class or interface in java.lang.reflect" class="external-link">Type</a>... args)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Parses a UON input object to the specified Java type.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <T> T</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#to(java.lang.String,java.lang.Class)" class="member-name-link">to</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> input, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> type)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Parses a UON input string to the specified type.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <T> T</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#to(java.lang.String,java.lang.reflect.Type,java.lang.reflect.Type...)" class="member-name-link">to</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> input, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Type.html" title="class or interface in java.lang.reflect" class="external-link">Type</a> type, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Type.html" title="class or interface in java.lang.reflect" class="external-link">Type</a>... args)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Parses a UON input string to the specified Java type.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-org.apache.juneau.marshaller.CharMarshaller">Methods inherited from class org.apache.juneau.marshaller.<a href="CharMarshaller.html" title="class in org.apache.juneau.marshaller">CharMarshaller</a></h3> |
| <code><a href="CharMarshaller.html#read(java.lang.String,java.lang.Class)">read</a>, <a href="CharMarshaller.html#read(java.lang.String,java.lang.reflect.Type,java.lang.reflect.Type...)">read</a>, <a href="CharMarshaller.html#write(java.lang.Object)">write</a></code></div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-org.apache.juneau.marshaller.Marshaller">Methods inherited from class org.apache.juneau.marshaller.<a href="Marshaller.html" title="class in org.apache.juneau.marshaller">Marshaller</a></h3> |
| <code><a href="Marshaller.html#getParser()">getParser</a>, <a href="Marshaller.html#getSerializer()">getSerializer</a>, <a href="Marshaller.html#read(java.lang.Object,java.lang.Class)">read</a>, <a href="Marshaller.html#read(java.lang.Object,java.lang.reflect.Type,java.lang.reflect.Type...)">read</a>, <a href="Marshaller.html#write(java.lang.Object,java.lang.Object)">write</a></code></div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <li> |
| <section class="field-details" id="field-detail"> |
| <h2>Field Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="DEFAULT"> |
| <h3>DEFAULT</h3> |
| <div class="member-signature"><span class="modifiers">public static final</span> <span class="return-type"><a href="Uon.html" title="class in org.apache.juneau.marshaller">Uon</a></span> <span class="element-name"><a href="../../../../src-html/org/apache/juneau/marshaller/Uon.html#line-56">DEFAULT</a></span></div> |
| <div class="block">Default reusable instance.</div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <li> |
| <section class="constructor-details" id="constructor-detail"> |
| <h2>Constructor Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="<init>(org.apache.juneau.uon.UonSerializer,org.apache.juneau.uon.UonParser)"> |
| <h3>Uon</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name"><a href="../../../../src-html/org/apache/juneau/marshaller/Uon.html#line-72">Uon</a></span><wbr><span class="parameters">(<a href="../uon/UonSerializer.html" title="class in org.apache.juneau.uon">UonSerializer</a> s, |
| <a href="../uon/UonParser.html" title="class in org.apache.juneau.uon">UonParser</a> p)</span></div> |
| <div class="block">Constructor.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>s</code> - The serializer to use for serializing output. |
| <br>Must not be <jk>null</jk>.</dd> |
| <dd><code>p</code> - The parser to use for parsing input. |
| <br>Must not be <jk>null</jk>.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="<init>()"> |
| <h3>Uon</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name"><a href="../../../../src-html/org/apache/juneau/marshaller/Uon.html#line-82">Uon</a></span>()</div> |
| <div class="block">Constructor. |
| |
| <p> |
| Uses <a href="../uon/UonSerializer.html#DEFAULT"><code>UonSerializer.DEFAULT</code></a> and <a href="../uon/UonParser.html#DEFAULT"><code>UonParser.DEFAULT</code></a>.</div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="to(java.lang.String,java.lang.Class)"> |
| <h3>to</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name"><a href="../../../../src-html/org/apache/juneau/marshaller/Uon.html#line-98">to</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> input, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> type)</span> |
| throws <span class="exceptions"><a href="../parser/ParseException.html" title="class in org.apache.juneau.parser">ParseException</a></span></div> |
| <div class="block">Parses a UON input string to the specified type. |
| |
| <p> |
| A shortcut for calling <c><jsf>DEFAULT</jsf>.read(<jv>input</jv>, <jv>type</jv>)</c>.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - The class type of the object being created.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>input</code> - The input.</dd> |
| <dd><code>type</code> - The object type to create.</dd> |
| <dt>Returns:</dt> |
| <dd>The parsed object.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="../parser/ParseException.html" title="class in org.apache.juneau.parser">ParseException</a></code> - Malformed input encountered.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="to(java.lang.Object,java.lang.Class)"> |
| <h3>to</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name"><a href="../../../../src-html/org/apache/juneau/marshaller/Uon.html#line-128">to</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> input, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> type)</span> |
| throws <span class="exceptions"><a href="../parser/ParseException.html" title="class in org.apache.juneau.parser">ParseException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div> |
| <div class="block">Parses a UON input object to the specified Java type. |
| |
| <p> |
| A shortcut for calling <c><jsf>DEFAULT</jsf>.read(<jv>input</jv>, <jv>type</jv>)</c>.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - The class type of the object being created.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>input</code> - The input. |
| <br>Can be any of the following types: |
| <ul> |
| <li><jk>null</jk> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html" title="class or interface in java.io" class="external-link"><code>Reader</code></a> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html" title="class or interface in java.io" class="external-link"><code>InputStream</code></a> containing UTF-8 encoded text (or charset defined by |
| <a href="../parser/ReaderParser.Builder.html#streamCharset(java.nio.charset.Charset)"><code>ReaderParser.Builder.streamCharset(Charset)</code></a> property value). |
| <li><code><jk>byte</jk>[]</code> containing UTF-8 encoded text (or charset defined by |
| <a href="../parser/ReaderParser.Builder.html#streamCharset(java.nio.charset.Charset)"><code>ReaderParser.Builder.streamCharset(Charset)</code></a> property value). |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html" title="class or interface in java.io" class="external-link"><code>File</code></a> containing system encoded text (or charset defined by |
| <a href="../parser/ReaderParser.Builder.html#fileCharset(java.nio.charset.Charset)"><code>ReaderParser.Builder.fileCharset(Charset)</code></a> property value). |
| </ul></dd> |
| <dd><code>type</code> - The object type to create.</dd> |
| <dt>Returns:</dt> |
| <dd>The parsed object.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="../parser/ParseException.html" title="class in org.apache.juneau.parser">ParseException</a></code> - Malformed input encountered.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - Thrown by underlying stream.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="to(java.lang.String,java.lang.reflect.Type,java.lang.reflect.Type...)"> |
| <h3>to</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name"><a href="../../../../src-html/org/apache/juneau/marshaller/Uon.html#line-151">to</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> input, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Type.html" title="class or interface in java.lang.reflect" class="external-link">Type</a> type, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Type.html" title="class or interface in java.lang.reflect" class="external-link">Type</a>... args)</span> |
| throws <span class="exceptions"><a href="../parser/ParseException.html" title="class in org.apache.juneau.parser">ParseException</a></span></div> |
| <div class="block">Parses a UON input string to the specified Java type. |
| |
| <p> |
| A shortcut for calling <c><jsf>DEFAULT</jsf>.read(<jv>input</jv>, <jv>type</jv>, <jv>args</jv>)</c>.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - The class type of the object to create.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>input</code> - The input.</dd> |
| <dd><code>type</code> - The object type to create. |
| <br>Can be any of the following: <a href="../ClassMeta.html" title="class in org.apache.juneau"><code>ClassMeta</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link"><code>Class</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/ParameterizedType.html" title="class or interface in java.lang.reflect" class="external-link"><code>ParameterizedType</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/GenericArrayType.html" title="class or interface in java.lang.reflect" class="external-link"><code>GenericArrayType</code></a></dd> |
| <dd><code>args</code> - The type arguments of the class if it's a collection or map. |
| <br>Can be any of the following: <a href="../ClassMeta.html" title="class in org.apache.juneau"><code>ClassMeta</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link"><code>Class</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/ParameterizedType.html" title="class or interface in java.lang.reflect" class="external-link"><code>ParameterizedType</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/GenericArrayType.html" title="class or interface in java.lang.reflect" class="external-link"><code>GenericArrayType</code></a> |
| <br>Ignored if the main type is not a map or collection.</dd> |
| <dt>Returns:</dt> |
| <dd>The parsed object.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="../parser/ParseException.html" title="class in org.apache.juneau.parser">ParseException</a></code> - Malformed input encountered.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="../BeanSession.html#getClassMeta(java.lang.reflect.Type,java.lang.reflect.Type...)"><code>for argument syntax for maps and collections.</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="to(java.lang.Object,java.lang.reflect.Type,java.lang.reflect.Type...)"> |
| <h3>to</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name"><a href="../../../../src-html/org/apache/juneau/marshaller/Uon.html#line-188">to</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> input, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Type.html" title="class or interface in java.lang.reflect" class="external-link">Type</a> type, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Type.html" title="class or interface in java.lang.reflect" class="external-link">Type</a>... args)</span> |
| throws <span class="exceptions"><a href="../parser/ParseException.html" title="class in org.apache.juneau.parser">ParseException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div> |
| <div class="block">Parses a UON input object to the specified Java type. |
| |
| <p> |
| A shortcut for calling <c><jsf>DEFAULT</jsf>.read(<jv>input</jv>, <jv>type</jv>, <jv>args</jv>)</c>.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - The class type of the object to create.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>input</code> - The input. |
| <br>Can be any of the following types: |
| <ul> |
| <li><jk>null</jk> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html" title="class or interface in java.io" class="external-link"><code>Reader</code></a> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html" title="class or interface in java.io" class="external-link"><code>InputStream</code></a> containing UTF-8 encoded text (or charset defined by |
| <a href="../parser/ReaderParser.Builder.html#streamCharset(java.nio.charset.Charset)"><code>ReaderParser.Builder.streamCharset(Charset)</code></a> property value). |
| <li><code><jk>byte</jk>[]</code> containing UTF-8 encoded text (or charset defined by |
| <a href="../parser/ReaderParser.Builder.html#streamCharset(java.nio.charset.Charset)"><code>ReaderParser.Builder.streamCharset(Charset)</code></a> property value). |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html" title="class or interface in java.io" class="external-link"><code>File</code></a> containing system encoded text (or charset defined by |
| <a href="../parser/ReaderParser.Builder.html#fileCharset(java.nio.charset.Charset)"><code>ReaderParser.Builder.fileCharset(Charset)</code></a> property value). |
| </ul></dd> |
| <dd><code>type</code> - The object type to create. |
| <br>Can be any of the following: <a href="../ClassMeta.html" title="class in org.apache.juneau"><code>ClassMeta</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link"><code>Class</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/ParameterizedType.html" title="class or interface in java.lang.reflect" class="external-link"><code>ParameterizedType</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/GenericArrayType.html" title="class or interface in java.lang.reflect" class="external-link"><code>GenericArrayType</code></a></dd> |
| <dd><code>args</code> - The type arguments of the class if it's a collection or map. |
| <br>Can be any of the following: <a href="../ClassMeta.html" title="class in org.apache.juneau"><code>ClassMeta</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link"><code>Class</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/ParameterizedType.html" title="class or interface in java.lang.reflect" class="external-link"><code>ParameterizedType</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/GenericArrayType.html" title="class or interface in java.lang.reflect" class="external-link"><code>GenericArrayType</code></a> |
| <br>Ignored if the main type is not a map or collection.</dd> |
| <dt>Returns:</dt> |
| <dd>The parsed object.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="../parser/ParseException.html" title="class in org.apache.juneau.parser">ParseException</a></code> - Malformed input encountered.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - Thrown by underlying stream.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="../BeanSession.html#getClassMeta(java.lang.reflect.Type,java.lang.reflect.Type...)"><code>for argument syntax for maps and collections.</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="of(java.lang.Object)"> |
| <h3>of</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name"><a href="../../../../src-html/org/apache/juneau/marshaller/Uon.html#line-203">of</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> object)</span> |
| throws <span class="exceptions"><a href="../serializer/SerializeException.html" title="class in org.apache.juneau.serializer">SerializeException</a></span></div> |
| <div class="block">Serializes a Java object to a UON string. |
| |
| <p> |
| A shortcut for calling <c><jsf>DEFAULT</jsf>.write(<jv>object</jv>)</c>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>object</code> - The object to serialize.</dd> |
| <dt>Returns:</dt> |
| <dd>The serialized object.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="../serializer/SerializeException.html" title="class in org.apache.juneau.serializer">SerializeException</a></code> - If a problem occurred trying to convert the output.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="of(java.lang.Object,java.lang.Object)"> |
| <h3>of</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span> <span class="element-name"><a href="../../../../src-html/org/apache/juneau/marshaller/Uon.html#line-227">of</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> object, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> output)</span> |
| throws <span class="exceptions"><a href="../serializer/SerializeException.html" title="class in org.apache.juneau.serializer">SerializeException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div> |
| <div class="block">Serializes a Java object to a UON output. |
| |
| <p> |
| A shortcut for calling <c><jsf>DEFAULT</jsf>.write(<jv>output</jv>)</c>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>object</code> - The object to serialize.</dd> |
| <dd><code>output</code> - The output object. |
| <br>Can be any of the following types: |
| <ul> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html" title="class or interface in java.io" class="external-link"><code>Writer</code></a> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html" title="class or interface in java.io" class="external-link"><code>OutputStream</code></a> - Output will be written as UTF-8 encoded stream. |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html" title="class or interface in java.io" class="external-link"><code>File</code></a> - Output will be written as system-default encoded stream. |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html" title="class or interface in java.lang" class="external-link"><code>StringBuilder</code></a> - Output will be written to the specified string builder. |
| </ul></dd> |
| <dt>Returns:</dt> |
| <dd>The output object.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="../serializer/SerializeException.html" title="class in org.apache.juneau.serializer">SerializeException</a></code> - If a problem occurred trying to convert the output.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - Thrown by underlying stream.</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small>Copyright © 2016–2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |