| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| |
| --> |
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- **************************************************************** --> |
| <!-- * PLEASE KEEP COMPLICATED EXPRESSIONS OUT OF THESE TEMPLATES, * --> |
| <!-- * i.e. only iterate & print data where possible. Thanks, Jez. * --> |
| <!-- **************************************************************** --> |
| |
| <html> |
| <head> |
| <!-- Generated by groovydoc (4.0.30) --> |
| <title>JsonGenerator.Options (Grails 7.0.9)</title> |
| |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <link href="../../../../groovy.ico" type="image/x-icon" rel="shortcut icon"> |
| <link href="../../../../groovy.ico" type="image/x-icon" rel="icon"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| |
| <body class="center"> |
| <script type="text/javascript"><!-- |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="JsonGenerator.Options (Grails 7.0.9)"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar_top"> |
| <!-- --> |
| </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="../../../../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"> |
| <div> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?grails/plugin/json/builder/JsonGenerator.Options" target="_top">Frames</a></li> |
| <li><a href="JsonGenerator.Options.html" target="_top">No Frames</a></li> |
| </ul> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| Nested <li><a href="#field_summary">Field</a></li> <li><a href="#constructor_summary">Constructor</a></li> <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li> | Detail: </li> |
| <li><a href="#field_detail">Field</a></li> <li><a href="#constructor_detail">Constructor</a></li> <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| |
| <div class="subTitle">Package: <strong>grails.plugin.json.builder</strong></div> |
| |
| <h2 title="[Java] Class JsonGenerator.Options" class="title">[Java] Class JsonGenerator.Options</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><ul class="inheritance"></ul></li><li>grails.plugin.json.builder.JsonGenerator.Options |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| |
| |
| <!-- todo: direct known subclasses --> |
| <hr> |
| |
| <pre>public class JsonGenerator.Options |
| extends java.lang.Object</pre> |
| |
| <p> A builder used to construct a <a href='../../../../grails/plugin/json/builder/JsonGenerator.html' title='JsonGenerator'>JsonGenerator</a> instance that allows |
| control over the serialized JSON output. If you do not need to customize the |
| output it is recommended to use the static <CODE>JsonOutput.toJson</CODE> methods. |
| |
| <p> |
| Example: |
| <pre><code class="groovyTestCase"> |
| def generator = new groovy.json.JsonGenerator.Options() |
| .excludeNulls() |
| .dateFormat('yyyy') |
| .excludeFieldsByName('bar', 'baz') |
| .excludeFieldsByType(java.sql.Date) |
| .build() |
| |
| def input = [foo: null, lastUpdated: Date.parse('yyyy-MM-dd', '2014-10-24'), |
| bar: 'foo', baz: 'foo', systemDate: new java.sql.Date(new Date().getTime())] |
| |
| assert generator.toJson(input) == '{"lastUpdated":"2014"}' |
| </code></pre> |
| <DL><DT><B>Since:</B></DT><DD>2.5</DD></DL></p> |
| |
| </li> |
| </ul> |
| </div> |
| |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== NESTED CLASS SUMMARY =========== --> |
| |
| |
| <!-- =========== ENUM CONSTANT SUMMARY =========== --> |
| |
| <!-- =========== FIELD SUMMARY =========== --> |
| |
| <ul class="blockList"> |
| <li class="blockList"><a name="field_summary"><!-- --></a> |
| <h3>Field Summary</h3> |
| <ul class="blockList"> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum constants summary table"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifiers</th> |
| <th class="colLast" scope="col">Name</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code><strong>protected static java.lang.String</strong></code> </td> |
| <td class="colLast"><code><a href="#DEFAULT_TIMEZONE">DEFAULT_TIMEZONE</a></code></td> |
| <td class="colLast"></td> |
| </tr> |
| |
| <tr class="rowColor"> |
| <td class="colFirst"><code><strong>protected static java.lang.String</strong></code> </td> |
| <td class="colLast"><code><a href="#JSON_DATE_FORMAT">JSON_DATE_FORMAT</a></code></td> |
| <td class="colLast"></td> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code><strong>protected static java.util.Locale</strong></code> </td> |
| <td class="colLast"><code><a href="#JSON_DATE_FORMAT_LOCALE">JSON_DATE_FORMAT_LOCALE</a></code></td> |
| <td class="colLast"></td> |
| </tr> |
| |
| <tr class="rowColor"> |
| <td class="colFirst"><code><strong>protected java.util.Set<Converter></strong></code> </td> |
| <td class="colLast"><code><a href="#converters">converters</a></code></td> |
| <td class="colLast"></td> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code><strong>protected java.lang.String</strong></code> </td> |
| <td class="colLast"><code><a href="#dateFormat">dateFormat</a></code></td> |
| <td class="colLast"></td> |
| </tr> |
| |
| <tr class="rowColor"> |
| <td class="colFirst"><code><strong>protected java.util.Locale</strong></code> </td> |
| <td class="colLast"><code><a href="#dateLocale">dateLocale</a></code></td> |
| <td class="colLast"></td> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code><strong>protected boolean</strong></code> </td> |
| <td class="colLast"><code><a href="#disableUnicodeEscaping">disableUnicodeEscaping</a></code></td> |
| <td class="colLast"></td> |
| </tr> |
| |
| <tr class="rowColor"> |
| <td class="colFirst"><code><strong>protected boolean</strong></code> </td> |
| <td class="colLast"><code><a href="#excludeNulls">excludeNulls</a></code></td> |
| <td class="colLast"></td> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code><strong>protected java.util.Set<java.lang.String></strong></code> </td> |
| <td class="colLast"><code><a href="#excludedFieldNames">excludedFieldNames</a></code></td> |
| <td class="colLast"></td> |
| </tr> |
| |
| <tr class="rowColor"> |
| <td class="colFirst"><code><strong>protected java.util.Set<java.lang.Class<?>></strong></code> </td> |
| <td class="colLast"><code><a href="#excludedFieldTypes">excludedFieldTypes</a></code></td> |
| <td class="colLast"></td> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code><strong>protected java.util.TimeZone</strong></code> </td> |
| <td class="colLast"><code><a href="#timezone">timezone</a></code></td> |
| <td class="colLast"></td> |
| </tr> |
| |
| </table> |
| </ul> |
| </li> |
| |
| </ul> |
| |
| |
| <!-- =========== PROPERTY SUMMARY =========== --> |
| |
| |
| <!-- =========== ELEMENT SUMMARY =========== --> |
| |
| |
| |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_summary"><!-- --></a> |
| <h3>Constructor Summary</h3> |
| <ul class="blockList"> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructors Summary table"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor and description</th> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"> |
| <code><strong><a href="#Options()">Options</a></strong>()</code><br></td> |
| </tr> |
| |
| </table> |
| </ul> |
| </li> |
| </ul> |
| |
| |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| |
| <li class="blockList"><a name="method_summary"><!-- --></a> |
| <h3>Methods Summary</h3> |
| <ul class="blockList"> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Methods Summary table"> |
| <caption><span>Methods</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Type Params</th> |
| <th class="colLast" scope="col">Return Type</th> |
| <th class="colLast" scope="col">Name and description</th> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code></code></td> |
| <td class="colLast"><code>public <a href='../../../../Options.html'>Options</a></code></td> |
| <td class="colLast"><code><strong><a href="#addConverter(org.grails.web.converters.Converter)">addConverter</a></strong>(<a href='../../../../org/grails/web/converters/Converter.html'>Converter</a> converter)</code><br>Registers a converter that will be called when a type it handles is encountered.</td> |
| </tr> |
| |
| <tr class="rowColor"> |
| <td class="colFirst"><code><T></code></td> |
| <td class="colLast"><code>public <a href='../../../../Options.html'>Options</a></code></td> |
| <td class="colLast"><code><strong><a href="#addConverter(Class, Closure)">addConverter</a></strong>(java.lang.Class<T> type, groovy.lang.Closure<?> closure)</code><br>Registers a closure that will be called when the specified type or subtype |
| is serialized.</td> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code></code></td> |
| <td class="colLast"><code>public <a href='../../../../grails/plugin/json/builder/JsonGenerator.html'>JsonGenerator</a></code></td> |
| <td class="colLast"><code><strong><a href="#build()">build</a></strong>()</code><br>Creates a <a href='../../../../grails/plugin/json/builder/JsonGenerator.html' title='JsonGenerator'>JsonGenerator</a> that is based on the current options.</td> |
| </tr> |
| |
| <tr class="rowColor"> |
| <td class="colFirst"><code></code></td> |
| <td class="colLast"><code>public <a href='../../../../Options.html'>Options</a></code></td> |
| <td class="colLast"><code><strong><a href="#dateFormat(java.lang.String)">dateFormat</a></strong>(java.lang.String format)</code><br>Sets the date format that will be used to serialize <CODE>Date</CODE> objects. |
| </td> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code></code></td> |
| <td class="colLast"><code>public <a href='../../../../Options.html'>Options</a></code></td> |
| <td class="colLast"><code><strong><a href="#dateFormat(java.lang.String, java.util.Locale)">dateFormat</a></strong>(java.lang.String format, java.util.Locale locale)</code><br>Sets the date format that will be used to serialize <CODE>Date</CODE> objects. |
| </td> |
| </tr> |
| |
| <tr class="rowColor"> |
| <td class="colFirst"><code></code></td> |
| <td class="colLast"><code>public <a href='../../../../Options.html'>Options</a></code></td> |
| <td class="colLast"><code><strong><a href="#disableUnicodeEscaping()">disableUnicodeEscaping</a></strong>()</code><br>Disables the escaping of Unicode characters in JSON String values.</td> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code></code></td> |
| <td class="colLast"><code>public <a href='../../../../Options.html'>Options</a></code></td> |
| <td class="colLast"><code><strong><a href="#excludeFieldsByName(java.lang.CharSequence)">excludeFieldsByName</a></strong>(java.lang.CharSequence fieldNames)</code><br>Excludes from the output any fields that match the specified names.</td> |
| </tr> |
| |
| <tr class="rowColor"> |
| <td class="colFirst"><code></code></td> |
| <td class="colLast"><code>public <a href='../../../../Options.html'>Options</a></code></td> |
| <td class="colLast"><code><strong><a href="#excludeFieldsByName(Iterable)">excludeFieldsByName</a></strong>(java.lang.Iterable<? extends java.lang.CharSequence> fieldNames)</code><br>Excludes from the output any fields that match the specified names.</td> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code></code></td> |
| <td class="colLast"><code>public <a href='../../../../Options.html'>Options</a></code></td> |
| <td class="colLast"><code><strong><a href="#excludeFieldsByType(Class)">excludeFieldsByType</a></strong>(java.lang.Class<?> types)</code><br>Excludes from the output any fields whose type is the same or is |
| assignable to any of the given types.</td> |
| </tr> |
| |
| <tr class="rowColor"> |
| <td class="colFirst"><code></code></td> |
| <td class="colLast"><code>public <a href='../../../../Options.html'>Options</a></code></td> |
| <td class="colLast"><code><strong><a href="#excludeFieldsByType(Iterable)">excludeFieldsByType</a></strong>(java.lang.Iterable<java.lang.Class<?>> types)</code><br>Excludes from the output any fields whose type is the same or is |
| assignable to any of the given types.</td> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code></code></td> |
| <td class="colLast"><code>public <a href='../../../../Options.html'>Options</a></code></td> |
| <td class="colLast"><code><strong><a href="#excludeNulls()">excludeNulls</a></strong>()</code><br>Do not serialize <CODE>null</CODE> values.</td> |
| </tr> |
| |
| <tr class="rowColor"> |
| <td class="colFirst"><code></code></td> |
| <td class="colLast"><code>public <a href='../../../../Options.html'>Options</a></code></td> |
| <td class="colLast"><code><strong><a href="#timezone(java.lang.String)">timezone</a></strong>(java.lang.String timezone)</code><br>Sets the time zone that will be used to serialize dates.</td> |
| </tr> |
| |
| </table> |
| </ul> |
| </li> |
| |
| <li class="blockList"><a name="method_summary"><!-- --></a> |
| <h3>Inherited Methods Summary</h3> |
| <ul class="blockList"> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Inherited Methods Summary table"> |
| <caption><span>Inherited Methods</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Methods inherited from class</th> |
| <th class="colLast" scope="col">Name</th> |
| </tr> |
| |
| <tr class="altColor"> |
| <td class="colFirst"><code>class java.lang.Object</code></td> |
| <td class="colLast"><code>java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int)</code></td> |
| </tr> |
| </table> |
| </ul> |
| </li> |
| |
| </ul> |
| |
| </li> |
| </ul> |
| </div> |
| |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| |
| |
| |
| <!-- =========== FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field_detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| |
| <a name="DEFAULT_TIMEZONE"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>protected static final java.lang.String <strong>DEFAULT_TIMEZONE</strong></h4> |
| <p></p> |
| </li> |
| </ul> |
| |
| <a name="JSON_DATE_FORMAT"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>protected static final java.lang.String <strong>JSON_DATE_FORMAT</strong></h4> |
| <p></p> |
| </li> |
| </ul> |
| |
| <a name="JSON_DATE_FORMAT_LOCALE"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>protected static final java.util.Locale <strong>JSON_DATE_FORMAT_LOCALE</strong></h4> |
| <p></p> |
| </li> |
| </ul> |
| |
| <a name="converters"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>protected final java.util.Set<Converter> <strong>converters</strong></h4> |
| <p></p> |
| </li> |
| </ul> |
| |
| <a name="dateFormat"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>protected java.lang.String <strong>dateFormat</strong></h4> |
| <p></p> |
| </li> |
| </ul> |
| |
| <a name="dateLocale"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>protected java.util.Locale <strong>dateLocale</strong></h4> |
| <p></p> |
| </li> |
| </ul> |
| |
| <a name="disableUnicodeEscaping"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>protected boolean <strong>disableUnicodeEscaping</strong></h4> |
| <p></p> |
| </li> |
| </ul> |
| |
| <a name="excludeNulls"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>protected boolean <strong>excludeNulls</strong></h4> |
| <p></p> |
| </li> |
| </ul> |
| |
| <a name="excludedFieldNames"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>protected final java.util.Set<java.lang.String> <strong>excludedFieldNames</strong></h4> |
| <p></p> |
| </li> |
| </ul> |
| |
| <a name="excludedFieldTypes"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>protected final java.util.Set<java.lang.Class<?>> <strong>excludedFieldTypes</strong></h4> |
| <p></p> |
| </li> |
| </ul> |
| |
| <a name="timezone"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>protected java.util.TimeZone <strong>timezone</strong></h4> |
| <p></p> |
| </li> |
| </ul> |
| |
| </li> |
| </ul> |
| |
| |
| |
| |
| |
| |
| |
| <!-- =========== CONSTRUCTOR DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| |
| <a name="Options()"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>public <strong>Options</strong>()</h4> |
| <p></p> |
| </li> |
| </ul> |
| |
| </li> |
| </ul> |
| |
| |
| |
| |
| <!-- =========== METHOD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| |
| <a name="addConverter(org.grails.web.converters.Converter)"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>public <a href='../../../../Options.html'>Options</a> <strong>addConverter</strong>(<a href='../../../../org/grails/web/converters/Converter.html'>Converter</a> converter)</h4> |
| <p> Registers a converter that will be called when a type it handles is encountered. |
| <DL><DT><B>Parameters:</B></DT><DD><code>converter</code> - to register</DD></DL><DL><DT><B>Returns:</B></DT><DD>a reference to this <CODE>Options</CODE> instance</DD></DL></p> |
| </li> |
| </ul> |
| |
| <a name="addConverter(Class, Closure)"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4><T> public <a href='../../../../Options.html'>Options</a> <strong>addConverter</strong>(java.lang.Class<T> type, @groovy.transform.stc.ClosureParams(value = FromString.class, options = {"T", "T,String"})<br>groovy.lang.Closure<?> closure)</h4> |
| <p> Registers a closure that will be called when the specified type or subtype |
| is serialized. |
| |
| <p>The closure must accept either 1 or 2 parameters. The first parameter |
| is required and will be an instance of the <CODE>type</CODE> for which the closure |
| is registered. The second optional parameter should be of type <CODE>String</CODE> |
| and, if available, will be passed the name of the key associated with this |
| value if serializing a JSON Object. This parameter will be <CODE>null</CODE> when |
| serializing a JSON Array or when there is no way to determine the name of the key. |
| |
| <p> |
| Example: |
| <pre><code class="groovyTestCase"> |
| def generator = new groovy.json.JsonGenerator.Options() |
| .addConverter(URL) { URL u -> |
| "\"${u.getHost()}\"" |
| } |
| .build() |
| |
| def input = [domain: new URL('http://groovy-lang.org/json.html#_parser_variants')] |
| |
| assert generator.toJson(input) == '{"domain":"groovy-lang.org"}' |
| </code></pre> |
| |
| <p>If two or more closures are registered for the exact same type the last |
| closure based on the order they were specified will be used. When serializing an |
| object its type is compared to the list of registered types in the order they were |
| given and the closure for the first suitable type will be called. Therefore, it is |
| important to register more specific types first. |
| <DL><DT><B>Parameters:</B></DT><DD><code>type</code> - the type to convert</DD><DD><code>closure</code> - called when the registered type or any type assignable to the given |
| type is encountered</DD></DL><DL><DT><B>Type Parameters:</B></DT><DD><code>T</code> - the type this converter is registered to handle</DD></DL><DL><DT><B>Returns:</B></DT><DD>a reference to this <CODE>Options</CODE> instance</DD></DL><DL><DT><B>Throws:</B></DT><DD>NullPointerException if the given type or closure is null</DD><DD>IllegalArgumentException if the given closure does not accept |
| a parameter of the given type</DD></DL></p> |
| </li> |
| </ul> |
| |
| <a name="build()"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>public <a href='../../../../grails/plugin/json/builder/JsonGenerator.html'>JsonGenerator</a> <strong>build</strong>()</h4> |
| <p> Creates a <a href='../../../../grails/plugin/json/builder/JsonGenerator.html' title='JsonGenerator'>JsonGenerator</a> that is based on the current options. |
| <DL><DT><B>Returns:</B></DT><DD>a fully configured <a href='../../../../grails/plugin/json/builder/JsonGenerator.html' title='JsonGenerator'>JsonGenerator</a></DD></DL></p> |
| </li> |
| </ul> |
| |
| <a name="dateFormat(java.lang.String)"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>public <a href='../../../../Options.html'>Options</a> <strong>dateFormat</strong>(java.lang.String format)</h4> |
| <p> Sets the date format that will be used to serialize <CODE>Date</CODE> objects. |
| This must be a valid pattern for java.text.SimpleDateFormat and the |
| date formatter will be constructed with the default locale of java.util.Locale#US. |
| <DL><DT><B>Parameters:</B></DT><DD><code>format</code> - date format pattern used to serialize dates</DD></DL><DL><DT><B>Returns:</B></DT><DD>a reference to this <CODE>Options</CODE> instance</DD></DL><DL><DT><B>Throws:</B></DT><DD>NullPointerException if the given pattern is null</DD><DD>IllegalArgumentException if the given pattern is invalid</DD></DL></p> |
| </li> |
| </ul> |
| |
| <a name="dateFormat(java.lang.String, java.util.Locale)"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>public <a href='../../../../Options.html'>Options</a> <strong>dateFormat</strong>(java.lang.String format, java.util.Locale locale)</h4> |
| <p> Sets the date format that will be used to serialize <CODE>Date</CODE> objects. |
| This must be a valid pattern for java.text.SimpleDateFormat. |
| <DL><DT><B>Parameters:</B></DT><DD><code>format</code> - date format pattern used to serialize dates</DD><DD><code>locale</code> - the locale whose date format symbols will be used</DD></DL><DL><DT><B>Returns:</B></DT><DD>a reference to this <CODE>Options</CODE> instance</DD></DL><DL><DT><B>Throws:</B></DT><DD>IllegalArgumentException if the given pattern is invalid</DD></DL></p> |
| </li> |
| </ul> |
| |
| <a name="disableUnicodeEscaping()"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>public <a href='../../../../Options.html'>Options</a> <strong>disableUnicodeEscaping</strong>()</h4> |
| <p> Disables the escaping of Unicode characters in JSON String values. |
| <DL><DT><B>Returns:</B></DT><DD>a reference to this <CODE>Options</CODE> instance</DD></DL></p> |
| </li> |
| </ul> |
| |
| <a name="excludeFieldsByName(java.lang.CharSequence)"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>public <a href='../../../../Options.html'>Options</a> <strong>excludeFieldsByName</strong>(java.lang.CharSequence fieldNames)</h4> |
| <p> Excludes from the output any fields that match the specified names. |
| <DL><DT><B>Parameters:</B></DT><DD><code>fieldNames</code> - name of the field to exclude from the output</DD></DL><DL><DT><B>Returns:</B></DT><DD>a reference to this <CODE>Options</CODE> instance</DD></DL></p> |
| </li> |
| </ul> |
| |
| <a name="excludeFieldsByName(Iterable)"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>public <a href='../../../../Options.html'>Options</a> <strong>excludeFieldsByName</strong>(java.lang.Iterable<? extends java.lang.CharSequence> fieldNames)</h4> |
| <p> Excludes from the output any fields that match the specified names. |
| <DL><DT><B>Parameters:</B></DT><DD><code>fieldNames</code> - collection of names to exclude from the output</DD></DL><DL><DT><B>Returns:</B></DT><DD>a reference to this <CODE>Options</CODE> instance</DD></DL></p> |
| </li> |
| </ul> |
| |
| <a name="excludeFieldsByType(Class)"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>public <a href='../../../../Options.html'>Options</a> <strong>excludeFieldsByType</strong>(java.lang.Class<?> types)</h4> |
| <p> Excludes from the output any fields whose type is the same or is |
| assignable to any of the given types. |
| <DL><DT><B>Parameters:</B></DT><DD><code>types</code> - excluded from the output</DD></DL><DL><DT><B>Returns:</B></DT><DD>a reference to this <CODE>Options</CODE> instance</DD></DL></p> |
| </li> |
| </ul> |
| |
| <a name="excludeFieldsByType(Iterable)"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>public <a href='../../../../Options.html'>Options</a> <strong>excludeFieldsByType</strong>(java.lang.Iterable<java.lang.Class<?>> types)</h4> |
| <p> Excludes from the output any fields whose type is the same or is |
| assignable to any of the given types. |
| <DL><DT><B>Parameters:</B></DT><DD><code>types</code> - collection of types to exclude from the output</DD></DL><DL><DT><B>Returns:</B></DT><DD>a reference to this <CODE>Options</CODE> instance</DD></DL></p> |
| </li> |
| </ul> |
| |
| <a name="excludeNulls()"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>public <a href='../../../../Options.html'>Options</a> <strong>excludeNulls</strong>()</h4> |
| <p> Do not serialize <CODE>null</CODE> values. |
| <DL><DT><B>Returns:</B></DT><DD>a reference to this <CODE>Options</CODE> instance</DD></DL></p> |
| </li> |
| </ul> |
| |
| <a name="timezone(java.lang.String)"><!-- --></a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>public <a href='../../../../Options.html'>Options</a> <strong>timezone</strong>(java.lang.String timezone)</h4> |
| <p> Sets the time zone that will be used to serialize dates. |
| <DL><DT><B>Parameters:</B></DT><DD><code>timezone</code> - used to serialize dates</DD></DL><DL><DT><B>Returns:</B></DT><DD>a reference to this <CODE>Options</CODE> instance</DD></DL><DL><DT><B>Throws:</B></DT><DD>NullPointerException if the given timezone is null</DD></DL></p> |
| </li> |
| </ul> |
| |
| </li> |
| </ul> |
| |
| </li> |
| </ul> |
| </div> |
| |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar_bottom"> |
| <!-- --> |
| </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="../../../../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"> |
| <div> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?grails/plugin/json/builder/JsonGenerator.Options" target="_top">Frames</a></li> |
| <li><a href="JsonGenerator.Options.html" target="_top">No Frames</a></li> |
| </ul> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| Nested <li><a href="#field_summary">Field</a></li> <li><a href="#constructor_summary">Constructor</a></li> <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li> | Detail: </li> |
| <li><a href="#field_detail">Field</a></li> <li><a href="#constructor_detail">Constructor</a></li> <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <p><!-- Matomo --> |
| <script> |
| var _paq = window._paq = window._paq || []; |
| /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ |
| _paq.push(["setDoNotTrack", true]); |
| _paq.push(["disableCookies"]); |
| _paq.push(['trackPageView']); |
| _paq.push(['enableLinkTracking']); |
| (function() { |
| var u="https://analytics.apache.org/"; |
| _paq.push(['setTrackerUrl', u+'matomo.php']); |
| _paq.push(['setSiteId', '79']); |
| var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; |
| g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); |
| })(); |
| </script> |
| <!-- End Matomo Code --></p> |
| <a name="skip-navbar_bottom"> |
| <!-- --> |
| </a> |
| </div> |
| </div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |