blob: 56dba246fa671aaf6fbc6e9cd3d7b075272dd092 [file]
<!--
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:&nbsp;</li>
Nested&nbsp;&nbsp;&nbsp;<li><a href="#field_summary">Field</a></li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#constructor_summary">Constructor</a></li>&nbsp;&nbsp;&nbsp;<li><a href="#method_summary">Method</a></li>&nbsp;&nbsp;&nbsp;
</ul>
<ul class="subNavList">
<li>&nbsp;|&nbsp;Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a></li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#constructor_detail">Constructor</a></li>&nbsp;&nbsp;&nbsp;<li><a href="#method_detail">Method</a></li>&nbsp;&nbsp;&nbsp;
</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">&nbsp;</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&nbsp;static&nbsp;java.lang.String</strong></code>&nbsp;</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&nbsp;static&nbsp;java.lang.String</strong></code>&nbsp;</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&nbsp;static&nbsp;java.util.Locale</strong></code>&nbsp;</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&nbsp;java.util.Set&lt;Converter&gt;</strong></code>&nbsp;</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&nbsp;java.lang.String</strong></code>&nbsp;</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&nbsp;java.util.Locale</strong></code>&nbsp;</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&nbsp;boolean</strong></code>&nbsp;</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&nbsp;boolean</strong></code>&nbsp;</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&nbsp;java.util.Set&lt;java.lang.String&gt;</strong></code>&nbsp;</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&nbsp;java.util.Set&lt;java.lang.Class&lt;?&gt;&gt;</strong></code>&nbsp;</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&nbsp;java.util.TimeZone</strong></code>&nbsp;</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">&nbsp;</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">&nbsp;</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&nbsp;<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>&lt;T&gt;</code></td>
<td class="colLast"><code>public&nbsp;<a href='../../../../Options.html'>Options</a></code></td>
<td class="colLast"><code><strong><a href="#addConverter(Class, Closure)">addConverter</a></strong>(java.lang.Class&lt;T&gt; type, groovy.lang.Closure&lt;?&gt; 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&nbsp;<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&nbsp;<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&nbsp;<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&nbsp;<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&nbsp;<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&nbsp;<a href='../../../../Options.html'>Options</a></code></td>
<td class="colLast"><code><strong><a href="#excludeFieldsByName(Iterable)">excludeFieldsByName</a></strong>(java.lang.Iterable&lt;? extends java.lang.CharSequence&gt; 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&nbsp;<a href='../../../../Options.html'>Options</a></code></td>
<td class="colLast"><code><strong><a href="#excludeFieldsByType(Class)">excludeFieldsByType</a></strong>(java.lang.Class&lt;?&gt; 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&nbsp;<a href='../../../../Options.html'>Options</a></code></td>
<td class="colLast"><code><strong><a href="#excludeFieldsByType(Iterable)">excludeFieldsByType</a></strong>(java.lang.Iterable&lt;java.lang.Class&lt;?&gt;&gt; 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&nbsp;<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&nbsp;<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">&nbsp;</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&nbsp;static&nbsp;final&nbsp;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&nbsp;static&nbsp;final&nbsp;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&nbsp;static&nbsp;final&nbsp;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&nbsp;final&nbsp;java.util.Set&lt;Converter&gt; <strong>converters</strong></h4>
<p></p>
</li>
</ul>
<a name="dateFormat"><!-- --></a>
<ul class="blockListLast">
<li class="blockList">
<h4>protected&nbsp;java.lang.String <strong>dateFormat</strong></h4>
<p></p>
</li>
</ul>
<a name="dateLocale"><!-- --></a>
<ul class="blockListLast">
<li class="blockList">
<h4>protected&nbsp;java.util.Locale <strong>dateLocale</strong></h4>
<p></p>
</li>
</ul>
<a name="disableUnicodeEscaping"><!-- --></a>
<ul class="blockListLast">
<li class="blockList">
<h4>protected&nbsp;boolean <strong>disableUnicodeEscaping</strong></h4>
<p></p>
</li>
</ul>
<a name="excludeNulls"><!-- --></a>
<ul class="blockListLast">
<li class="blockList">
<h4>protected&nbsp;boolean <strong>excludeNulls</strong></h4>
<p></p>
</li>
</ul>
<a name="excludedFieldNames"><!-- --></a>
<ul class="blockListLast">
<li class="blockList">
<h4>protected&nbsp;final&nbsp;java.util.Set&lt;java.lang.String&gt; <strong>excludedFieldNames</strong></h4>
<p></p>
</li>
</ul>
<a name="excludedFieldTypes"><!-- --></a>
<ul class="blockListLast">
<li class="blockList">
<h4>protected&nbsp;final&nbsp;java.util.Set&lt;java.lang.Class&lt;?&gt;&gt; <strong>excludedFieldTypes</strong></h4>
<p></p>
</li>
</ul>
<a name="timezone"><!-- --></a>
<ul class="blockListLast">
<li class="blockList">
<h4>protected&nbsp;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&nbsp;<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&nbsp;<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>&lt;T&gt; public&nbsp;<a href='../../../../Options.html'>Options</a> <strong>addConverter</strong>(java.lang.Class&lt;T&gt; type, @groovy.transform.stc.ClosureParams(value = FromString.class, options = {"T", "T,String"})<br>groovy.lang.Closure&lt;?&gt; 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 -&gt;
"\"${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&nbsp;<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&nbsp;<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&nbsp;<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&nbsp;<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&nbsp;<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&nbsp;<a href='../../../../Options.html'>Options</a> <strong>excludeFieldsByName</strong>(java.lang.Iterable&lt;? extends java.lang.CharSequence&gt; 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&nbsp;<a href='../../../../Options.html'>Options</a> <strong>excludeFieldsByType</strong>(java.lang.Class&lt;?&gt; 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&nbsp;<a href='../../../../Options.html'>Options</a> <strong>excludeFieldsByType</strong>(java.lang.Iterable&lt;java.lang.Class&lt;?&gt;&gt; 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&nbsp;<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&nbsp;<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:&nbsp;</li>
Nested&nbsp;&nbsp;&nbsp;<li><a href="#field_summary">Field</a></li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#constructor_summary">Constructor</a></li>&nbsp;&nbsp;&nbsp;<li><a href="#method_summary">Method</a></li>&nbsp;&nbsp;&nbsp;
</ul>
<ul class="subNavList">
<li>&nbsp;|&nbsp;Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a></li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#constructor_detail">Constructor</a></li>&nbsp;&nbsp;&nbsp;<li><a href="#method_detail">Method</a></li>&nbsp;&nbsp;&nbsp;
</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>