| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.9.1) on Mon Dec 07 10:59:53 CST 2020 --> |
| <title>JSON (Eclipse Jetty API Doc - v11.0.0)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2020-12-07"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../../jquery/jquery-3.5.1.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="JSON (Eclipse Jetty API Doc - v11.0.0)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":9,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/JSON.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.eclipse.jetty.util.ajax</a></div> |
| <h2 title="Class JSON" class="title">Class JSON</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.eclipse.jetty.util.ajax.JSON</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <pre>public class <span class="typeNameLabel">JSON</span> |
| extends java.lang.Object</pre> |
| <div class="block"><p>JSON parser and generator.</p> |
| <p>This class provides methods to convert POJOs to and from JSON notation.</p> |
| <p>The mapping from JSON to Java is:</p> |
| |
| <pre> |
| object --> Map<String, Object> |
| array --> Object[] |
| number --> Double or Long |
| string --> String |
| null --> null |
| bool --> Boolean |
| </pre> |
| |
| <p>The Java to JSON mapping is:</p> |
| |
| <pre> |
| String --> string |
| Number --> number |
| Map --> object |
| List --> array |
| Array --> array |
| null --> null |
| Boolean--> boolean |
| Object --> string (dubious!) |
| </pre> |
| |
| <p>The interface <a href="JSON.Convertible.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertible</code></a> may be implemented by classes that |
| wish to externalize and initialize specific fields to and from JSON objects. |
| Only directed acyclic graphs of objects are supported.</p> |
| <p>The interface <a href="JSON.Generator.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Generator</code></a> may be implemented by classes that |
| know how to render themselves as JSON and the <a href="#toJSON(java.lang.Object)"><code>toJSON(Object)</code></a> method |
| will use <a href="JSON.Generator.html#addJSON(java.lang.Appendable)"><code>JSON.Generator.addJSON(Appendable)</code></a> to generate the JSON.</p> |
| <p>The class <a href="JSON.Literal.html" title="class in org.eclipse.jetty.util.ajax"><code>JSON.Literal</code></a> may be used to hold pre-generated JSON object.</p> |
| <p>The interface <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> may be implemented to provide |
| converters for objects that may be registered with |
| <a href="#addConvertor(java.lang.Class,org.eclipse.jetty.util.ajax.JSON.Convertor)"><code>addConvertor(Class, Convertor)</code></a>. |
| These converters are looked up by class, interface and super class by |
| <a href="#getConvertor(java.lang.Class)"><code>getConvertor(Class)</code></a>.</p> |
| <p>If a JSON object has a <code>class</code> field, then a Java class for that |
| name is loaded and the method <a href="#convertTo(java.lang.Class,java.util.Map)"><code>convertTo(Class, Map)</code></a> is used to find |
| a <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> for that class.</p> |
| <p>If a JSON object has a <code>x-class</code> field then a direct lookup for a |
| <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> for that class name is done (without loading the class).</p></div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Class</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static interface </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JSON.Convertible.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertible</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">JSON Convertible object.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static interface </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">JSON Convertor.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static interface </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JSON.Generator.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Generator</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">JSON Generator.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JSON.Literal.html" title="class in org.eclipse.jetty.util.ajax">JSON.Literal</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">A Literal JSON generator.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static interface </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JSON.Output.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Output</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">JSON Output class for use by <a href="JSON.Convertible.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertible</code></a>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JSON.ReaderSource.html" title="class in org.eclipse.jetty.util.ajax">JSON.ReaderSource</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">A Reader source for a JSON string.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static interface </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">A generic source for a JSON representation.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JSON.StringSource.html" title="class in org.eclipse.jetty.util.ajax">JSON.StringSource</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">An in-memory source for a JSON string.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">JSON</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addConvertor(java.lang.Class,org.eclipse.jetty.util.ajax.JSON.Convertor)">addConvertor</a></span>​(java.lang.Class<?> forClass, |
| <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a> convertor)</code></th> |
| <td class="colLast"> |
| <div class="block">Registers a <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> for the given class.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addConvertorFor(java.lang.String,org.eclipse.jetty.util.ajax.JSON.Convertor)">addConvertorFor</a></span>​(java.lang.String name, |
| <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a> convertor)</code></th> |
| <td class="colLast"> |
| <div class="block">Registers a <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> for a named class.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(java.lang.Appendable,java.lang.Object)">append</a></span>​(java.lang.Appendable buffer, |
| java.lang.Object object)</code></th> |
| <td class="colLast"> |
| <div class="block">Appends the given object as JSON to string buffer.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#appendArray(java.lang.Appendable,java.lang.Object)">appendArray</a></span>​(java.lang.Appendable buffer, |
| java.lang.Object array)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#appendArray(java.lang.Appendable,java.util.Collection)">appendArray</a></span>​(java.lang.Appendable buffer, |
| java.util.Collection<?> collection)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#appendBoolean(java.lang.Appendable,java.lang.Boolean)">appendBoolean</a></span>​(java.lang.Appendable buffer, |
| java.lang.Boolean b)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#appendJSON(java.lang.Appendable,org.eclipse.jetty.util.ajax.JSON.Convertible)">appendJSON</a></span>​(java.lang.Appendable buffer, |
| <a href="JSON.Convertible.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertible</a> converter)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#appendJSON(java.lang.Appendable,org.eclipse.jetty.util.ajax.JSON.Convertor,java.lang.Object)">appendJSON</a></span>​(java.lang.Appendable buffer, |
| <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a> convertor, |
| java.lang.Object object)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#appendJSON(java.lang.Appendable,org.eclipse.jetty.util.ajax.JSON.Generator)">appendJSON</a></span>​(java.lang.Appendable buffer, |
| <a href="JSON.Generator.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Generator</a> generator)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#appendMap(java.lang.Appendable,java.util.Map)">appendMap</a></span>​(java.lang.Appendable buffer, |
| java.util.Map<?,​?> map)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#appendNull(java.lang.Appendable)">appendNull</a></span>​(java.lang.Appendable buffer)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#appendNumber(java.lang.Appendable,java.lang.Number)">appendNumber</a></span>​(java.lang.Appendable buffer, |
| java.lang.Number number)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#appendString(java.lang.Appendable,java.lang.String)">appendString</a></span>​(java.lang.Appendable buffer, |
| java.lang.String string)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>protected static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#complete(java.lang.String,org.eclipse.jetty.util.ajax.JSON.Source)">complete</a></span>​(java.lang.String seek, |
| <a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>protected <a href="JSON.html" title="class in org.eclipse.jetty.util.ajax">JSON</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#contextFor(java.lang.String)">contextFor</a></span>​(java.lang.String field)</code></th> |
| <td class="colLast"> |
| <div class="block">Every time a JSON object field representation <code>{"name": value}</code> is parsed, |
| this method is called to (possibly) return a different JSON instance (for example |
| configured with different converters) to parse the object field.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>protected <a href="JSON.html" title="class in org.eclipse.jetty.util.ajax">JSON</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#contextForArray()">contextForArray</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Every time a JSON array representation <code>[...]</code> is parsed, this method is called |
| to (possibly) return a different JSON instance (for example configured with different |
| converters) to parse the array items.</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code>protected java.lang.Object</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#convertTo(java.lang.Class,java.util.Map)">convertTo</a></span>​(java.lang.Class<?> type, |
| java.util.Map<java.lang.String,​java.lang.Object> map)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#escapeString(java.lang.Appendable,java.lang.String)">escapeString</a></span>​(java.lang.Appendable buffer, |
| java.lang.String input)</code></th> |
| <td class="colLast"> |
| <div class="block">Escapes the characters of the given <code>input</code> string into the given buffer.</div> |
| </td> |
| </tr> |
| <tr id="i18" class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#escapeUnicode(java.lang.Appendable,char)">escapeUnicode</a></span>​(java.lang.Appendable buffer, |
| char c)</code></th> |
| <td class="colLast"> |
| <div class="block">Per JSON specification, unicode characters are by default NOT escaped.</div> |
| </td> |
| </tr> |
| <tr id="i19" class="rowColor"> |
| <td class="colFirst"><code>java.lang.Object</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fromJSON(java.io.Reader)">fromJSON</a></span>​(java.io.Reader reader)</code></th> |
| <td class="colLast"> |
| <div class="block">Parses the JSON from the given Reader into an object.</div> |
| </td> |
| </tr> |
| <tr id="i20" class="altColor"> |
| <td class="colFirst"><code>java.lang.Object</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fromJSON(java.lang.String)">fromJSON</a></span>​(java.lang.String string)</code></th> |
| <td class="colLast"> |
| <div class="block">Parses the given JSON string into an object.</div> |
| </td> |
| </tr> |
| <tr id="i21" class="rowColor"> |
| <td class="colFirst"><code>protected <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getConvertor(java.lang.Class)">getConvertor</a></span>​(java.lang.Class<?> forClass)</code></th> |
| <td class="colLast"> |
| <div class="block">Looks up a convertor for a class.</div> |
| </td> |
| </tr> |
| <tr id="i22" class="altColor"> |
| <td class="colFirst"><code><a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getConvertorFor(java.lang.String)">getConvertorFor</a></span>​(java.lang.String name)</code></th> |
| <td class="colLast"> |
| <div class="block">Looks up a convertor for a class name.</div> |
| </td> |
| </tr> |
| <tr id="i23" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getStringBufferSize()">getStringBufferSize</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i24" class="altColor"> |
| <td class="colFirst"><code>protected java.lang.Object</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#handleUnknown(org.eclipse.jetty.util.ajax.JSON.Source,char)">handleUnknown</a></span>​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source, |
| char c)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i25" class="rowColor"> |
| <td class="colFirst"><code>protected java.lang.Object[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newArray(int)">newArray</a></span>​(int size)</code></th> |
| <td class="colLast"> |
| <div class="block">Factory method that creates an array when a JSON representation of <code>[...]</code> is parsed.</div> |
| </td> |
| </tr> |
| <tr id="i26" class="altColor"> |
| <td class="colFirst"><code>protected java.util.Map<java.lang.String,​java.lang.Object></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newMap()">newMap</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Factory method that creates a Map when a JSON representation of <code>{...}</code> is parsed.</div> |
| </td> |
| </tr> |
| <tr id="i27" class="rowColor"> |
| <td class="colFirst"><code>java.lang.Object</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parse(org.eclipse.jetty.util.ajax.JSON.Source)">parse</a></span>​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</code></th> |
| <td class="colLast"> |
| <div class="block">Parses the given JSON source into an object.</div> |
| </td> |
| </tr> |
| <tr id="i28" class="altColor"> |
| <td class="colFirst"><code>java.lang.Object</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parse(org.eclipse.jetty.util.ajax.JSON.Source,boolean)">parse</a></span>​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source, |
| boolean stripOuterComment)</code></th> |
| <td class="colLast"> |
| <div class="block">Parses the given JSON source into an object.</div> |
| </td> |
| </tr> |
| <tr id="i29" class="rowColor"> |
| <td class="colFirst"><code>protected java.lang.Object</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parseArray(org.eclipse.jetty.util.ajax.JSON.Source)">parseArray</a></span>​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i30" class="altColor"> |
| <td class="colFirst"><code>java.lang.Number</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parseNumber(org.eclipse.jetty.util.ajax.JSON.Source)">parseNumber</a></span>​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i31" class="rowColor"> |
| <td class="colFirst"><code>protected java.lang.Object</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parseObject(org.eclipse.jetty.util.ajax.JSON.Source)">parseObject</a></span>​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i32" class="altColor"> |
| <td class="colFirst"><code>protected java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parseString(org.eclipse.jetty.util.ajax.JSON.Source)">parseString</a></span>​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i33" class="rowColor"> |
| <td class="colFirst"><code><a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeConvertor(java.lang.Class)">removeConvertor</a></span>​(java.lang.Class<?> forClass)</code></th> |
| <td class="colLast"> |
| <div class="block">Unregisters a <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> for a class.</div> |
| </td> |
| </tr> |
| <tr id="i34" class="altColor"> |
| <td class="colFirst"><code><a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeConvertorFor(java.lang.String)">removeConvertorFor</a></span>​(java.lang.String name)</code></th> |
| <td class="colLast"> |
| <div class="block">Unregisters a <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> for a named class.</div> |
| </td> |
| </tr> |
| <tr id="i35" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#seekTo(char,org.eclipse.jetty.util.ajax.JSON.Source)">seekTo</a></span>​(char seek, |
| <a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i36" class="altColor"> |
| <td class="colFirst"><code>protected char</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#seekTo(java.lang.String,org.eclipse.jetty.util.ajax.JSON.Source)">seekTo</a></span>​(java.lang.String seek, |
| <a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i37" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setStringBufferSize(int)">setStringBufferSize</a></span>​(int stringBufferSize)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i38" class="altColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toJSON(java.lang.Object)">toJSON</a></span>​(java.lang.Object object)</code></th> |
| <td class="colLast"> |
| <div class="block">Converts any object to JSON.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>JSON</h4> |
| <pre>public JSON()</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="getStringBufferSize()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getStringBufferSize</h4> |
| <pre class="methodSignature">public int getStringBufferSize()</pre> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the initial stringBuffer size to use when creating JSON strings |
| (default 1024)</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setStringBufferSize(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setStringBufferSize</h4> |
| <pre class="methodSignature">public void setStringBufferSize​(int stringBufferSize)</pre> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stringBufferSize</code> - the initial stringBuffer size to use when creating JSON |
| strings (default 1024)</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="escapeString(java.lang.Appendable,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>escapeString</h4> |
| <pre class="methodSignature">public void escapeString​(java.lang.Appendable buffer, |
| java.lang.String input) |
| throws java.io.IOException</pre> |
| <div class="block"><p>Escapes the characters of the given <code>input</code> string into the given buffer.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - the buffer to escape the string into</dd> |
| <dd><code>input</code> - the string to escape</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code> - if appending to the buffer fails</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#escapeUnicode(java.lang.Appendable,char)"><code>escapeUnicode(Appendable, char)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="escapeUnicode(java.lang.Appendable,char)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>escapeUnicode</h4> |
| <pre class="methodSignature">protected void escapeUnicode​(java.lang.Appendable buffer, |
| char c) |
| throws java.io.IOException</pre> |
| <div class="block"><p>Per JSON specification, unicode characters are by default NOT escaped.</p> |
| <p>Overriding this method allows for alternate behavior to escape those |
| with your choice of encoding.</p> |
| |
| <pre> |
| protected void escapeUnicode(Appendable buffer, char c) throws IOException |
| { |
| // Unicode is backslash-u escaped |
| buffer.append(String.format("\\u%04x", (int)c)); |
| } |
| </pre></div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toJSON(java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toJSON</h4> |
| <pre class="methodSignature">public java.lang.String toJSON​(java.lang.Object object)</pre> |
| <div class="block"><p>Converts any object to JSON.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>object</code> - the object to convert</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the JSON string representation of the object</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#append(java.lang.Appendable,java.lang.Object)"><code>append(Appendable, Object)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="append(java.lang.Appendable,java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public void append​(java.lang.Appendable buffer, |
| java.lang.Object object)</pre> |
| <div class="block"><p>Appends the given object as JSON to string buffer.</p> |
| <p>This method tests the given object type and calls other |
| appends methods for each object type, see for example |
| <a href="#appendMap(java.lang.Appendable,java.util.Map)"><code>appendMap(Appendable, Map)</code></a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - the buffer to append to</dd> |
| <dd><code>object</code> - the object to convert to JSON</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="appendNull(java.lang.Appendable)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>appendNull</h4> |
| <pre class="methodSignature">public void appendNull​(java.lang.Appendable buffer)</pre> |
| </li> |
| </ul> |
| <a id="appendJSON(java.lang.Appendable,org.eclipse.jetty.util.ajax.JSON.Convertor,java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>appendJSON</h4> |
| <pre class="methodSignature">public void appendJSON​(java.lang.Appendable buffer, |
| <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a> convertor, |
| java.lang.Object object)</pre> |
| </li> |
| </ul> |
| <a id="appendJSON(java.lang.Appendable,org.eclipse.jetty.util.ajax.JSON.Convertible)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>appendJSON</h4> |
| <pre class="methodSignature">public void appendJSON​(java.lang.Appendable buffer, |
| <a href="JSON.Convertible.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertible</a> converter)</pre> |
| </li> |
| </ul> |
| <a id="appendJSON(java.lang.Appendable,org.eclipse.jetty.util.ajax.JSON.Generator)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>appendJSON</h4> |
| <pre class="methodSignature">public void appendJSON​(java.lang.Appendable buffer, |
| <a href="JSON.Generator.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Generator</a> generator)</pre> |
| </li> |
| </ul> |
| <a id="appendMap(java.lang.Appendable,java.util.Map)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>appendMap</h4> |
| <pre class="methodSignature">public void appendMap​(java.lang.Appendable buffer, |
| java.util.Map<?,​?> map)</pre> |
| </li> |
| </ul> |
| <a id="appendArray(java.lang.Appendable,java.util.Collection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>appendArray</h4> |
| <pre class="methodSignature">public void appendArray​(java.lang.Appendable buffer, |
| java.util.Collection<?> collection)</pre> |
| </li> |
| </ul> |
| <a id="appendArray(java.lang.Appendable,java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>appendArray</h4> |
| <pre class="methodSignature">public void appendArray​(java.lang.Appendable buffer, |
| java.lang.Object array)</pre> |
| </li> |
| </ul> |
| <a id="appendBoolean(java.lang.Appendable,java.lang.Boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>appendBoolean</h4> |
| <pre class="methodSignature">public void appendBoolean​(java.lang.Appendable buffer, |
| java.lang.Boolean b)</pre> |
| </li> |
| </ul> |
| <a id="appendNumber(java.lang.Appendable,java.lang.Number)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>appendNumber</h4> |
| <pre class="methodSignature">public void appendNumber​(java.lang.Appendable buffer, |
| java.lang.Number number)</pre> |
| </li> |
| </ul> |
| <a id="appendString(java.lang.Appendable,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>appendString</h4> |
| <pre class="methodSignature">public void appendString​(java.lang.Appendable buffer, |
| java.lang.String string)</pre> |
| </li> |
| </ul> |
| <a id="newMap()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>newMap</h4> |
| <pre class="methodSignature">protected java.util.Map<java.lang.String,​java.lang.Object> newMap()</pre> |
| <div class="block"><p>Factory method that creates a Map when a JSON representation of <code>{...}</code> is parsed.</p></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a new Map representing the JSON object</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="newArray(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>newArray</h4> |
| <pre class="methodSignature">protected java.lang.Object[] newArray​(int size)</pre> |
| <div class="block"><p>Factory method that creates an array when a JSON representation of <code>[...]</code> is parsed.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>size</code> - the size of the array</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a new array representing the JSON array</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="contextForArray()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>contextForArray</h4> |
| <pre class="methodSignature">protected <a href="JSON.html" title="class in org.eclipse.jetty.util.ajax">JSON</a> contextForArray()</pre> |
| <div class="block"><p>Every time a JSON array representation <code>[...]</code> is parsed, this method is called |
| to (possibly) return a different JSON instance (for example configured with different |
| converters) to parse the array items.</p></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a JSON instance to parse array items</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="contextFor(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>contextFor</h4> |
| <pre class="methodSignature">protected <a href="JSON.html" title="class in org.eclipse.jetty.util.ajax">JSON</a> contextFor​(java.lang.String field)</pre> |
| <div class="block"><p>Every time a JSON object field representation <code>{"name": value}</code> is parsed, |
| this method is called to (possibly) return a different JSON instance (for example |
| configured with different converters) to parse the object field.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>field</code> - the field name</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a JSON instance to parse the object field</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="convertTo(java.lang.Class,java.util.Map)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>convertTo</h4> |
| <pre class="methodSignature">protected java.lang.Object convertTo​(java.lang.Class<?> type, |
| java.util.Map<java.lang.String,​java.lang.Object> map)</pre> |
| </li> |
| </ul> |
| <a id="addConvertor(java.lang.Class,org.eclipse.jetty.util.ajax.JSON.Convertor)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>addConvertor</h4> |
| <pre class="methodSignature">public void addConvertor​(java.lang.Class<?> forClass, |
| <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a> convertor)</pre> |
| <div class="block"><p>Registers a <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> for the given class.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>forClass</code> - the class the convertor applies to</dd> |
| <dd><code>convertor</code> - the convertor for the class</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="addConvertorFor(java.lang.String,org.eclipse.jetty.util.ajax.JSON.Convertor)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>addConvertorFor</h4> |
| <pre class="methodSignature">public void addConvertorFor​(java.lang.String name, |
| <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a> convertor)</pre> |
| <div class="block"><p>Registers a <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> for a named class.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the class the convertor applies to</dd> |
| <dd><code>convertor</code> - the convertor for the class</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="removeConvertor(java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>removeConvertor</h4> |
| <pre class="methodSignature">public <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a> removeConvertor​(java.lang.Class<?> forClass)</pre> |
| <div class="block"><p>Unregisters a <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> for a class.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>forClass</code> - the class the convertor applies to</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the convertor for the class</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="removeConvertorFor(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>removeConvertorFor</h4> |
| <pre class="methodSignature">public <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a> removeConvertorFor​(java.lang.String name)</pre> |
| <div class="block"><p>Unregisters a <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> for a named class.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the class the convertor applies to</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the convertor for the class</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getConvertor(java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getConvertor</h4> |
| <pre class="methodSignature">protected <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a> getConvertor​(java.lang.Class<?> forClass)</pre> |
| <div class="block"><p>Looks up a convertor for a class.</p> |
| <p>If no match is found for the class, then the interfaces |
| for the class are tried. |
| If still no match is found, then the super class and its |
| interfaces are tried iteratively.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>forClass</code> - the class to look up the convertor</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> or null if none was found for the class</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getConvertorFor(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getConvertorFor</h4> |
| <pre class="methodSignature">public <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Convertor</a> getConvertorFor​(java.lang.String name)</pre> |
| <div class="block"><p>Looks up a convertor for a class name.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - name of the class to look up the convertor</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a <a href="JSON.Convertor.html" title="interface in org.eclipse.jetty.util.ajax"><code>JSON.Convertor</code></a> or null if none were found.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="parse(org.eclipse.jetty.util.ajax.JSON.Source,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parse</h4> |
| <pre class="methodSignature">public java.lang.Object parse​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source, |
| boolean stripOuterComment)</pre> |
| <div class="block"><p>Parses the given JSON source into an object.</p> |
| <p>Although the JSON specification does not allow comments (of any kind) |
| this method optionally strips out outer comments of this form:</p> |
| <pre> |
| // An outer comment line. |
| /* Another outer comment, multiline. |
| // Yet another comment line. |
| { |
| "name": "the real JSON" |
| } |
| */ End of outer comment, multiline. |
| </pre></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>source</code> - the JSON source to parse</dd> |
| <dd><code>stripOuterComment</code> - whether to strip outer comments</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the object constructed from the JSON string representation</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="fromJSON(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>fromJSON</h4> |
| <pre class="methodSignature">public java.lang.Object fromJSON​(java.lang.String string)</pre> |
| <div class="block"><p>Parses the given JSON string into an object.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>string</code> - the JSON string to parse</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the object constructed from the JSON string representation</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="fromJSON(java.io.Reader)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>fromJSON</h4> |
| <pre class="methodSignature">public java.lang.Object fromJSON​(java.io.Reader reader)</pre> |
| <div class="block"><p>Parses the JSON from the given Reader into an object.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>reader</code> - the Reader to read the JSON from</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the object constructed from the JSON string representation</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="parse(org.eclipse.jetty.util.ajax.JSON.Source)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parse</h4> |
| <pre class="methodSignature">public java.lang.Object parse​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</pre> |
| <div class="block"><p>Parses the given JSON source into an object.</p> |
| <p>Although the JSON specification does not allow comments (of any kind) |
| this method strips out initial comments of this form:</p> |
| <pre> |
| // An initial comment line. |
| /* An initial |
| multiline comment */ |
| { |
| "name": "foo" |
| } |
| </pre> |
| <p>This method detects the object type and calls other |
| parse methods for each object type, see for example |
| <a href="#parseArray(org.eclipse.jetty.util.ajax.JSON.Source)"><code>parseArray(Source)</code></a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>source</code> - the JSON source to parse</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the object constructed from the JSON string representation</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="handleUnknown(org.eclipse.jetty.util.ajax.JSON.Source,char)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>handleUnknown</h4> |
| <pre class="methodSignature">protected java.lang.Object handleUnknown​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source, |
| char c)</pre> |
| </li> |
| </ul> |
| <a id="parseObject(org.eclipse.jetty.util.ajax.JSON.Source)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parseObject</h4> |
| <pre class="methodSignature">protected java.lang.Object parseObject​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</pre> |
| </li> |
| </ul> |
| <a id="parseArray(org.eclipse.jetty.util.ajax.JSON.Source)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parseArray</h4> |
| <pre class="methodSignature">protected java.lang.Object parseArray​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</pre> |
| </li> |
| </ul> |
| <a id="parseString(org.eclipse.jetty.util.ajax.JSON.Source)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parseString</h4> |
| <pre class="methodSignature">protected java.lang.String parseString​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</pre> |
| </li> |
| </ul> |
| <a id="parseNumber(org.eclipse.jetty.util.ajax.JSON.Source)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parseNumber</h4> |
| <pre class="methodSignature">public java.lang.Number parseNumber​(<a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</pre> |
| </li> |
| </ul> |
| <a id="seekTo(char,org.eclipse.jetty.util.ajax.JSON.Source)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>seekTo</h4> |
| <pre class="methodSignature">protected void seekTo​(char seek, |
| <a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</pre> |
| </li> |
| </ul> |
| <a id="seekTo(java.lang.String,org.eclipse.jetty.util.ajax.JSON.Source)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>seekTo</h4> |
| <pre class="methodSignature">protected char seekTo​(java.lang.String seek, |
| <a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</pre> |
| </li> |
| </ul> |
| <a id="complete(java.lang.String,org.eclipse.jetty.util.ajax.JSON.Source)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>complete</h4> |
| <pre class="methodSignature">protected static void complete​(java.lang.String seek, |
| <a href="JSON.Source.html" title="interface in org.eclipse.jetty.util.ajax">JSON.Source</a> source)</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/JSON.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 1995–2020 <a href="https://webtide.com">Webtide</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |