blob: f00540d28f56edcc53116fb0d65789684e1e9444 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (18) -->
<title>Parser.Builder (Apache Juneau 9.0.1)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.juneau.parser, class: Parser, class: Builder">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../javadoc.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
var pathtoroot = "../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"></span><span class="nav-bar-toggle-icon"></span><span class="nav-bar-toggle-icon"></span></button>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html#class">Help</a></li>
</ul>
<ul class="sub-nav-list-small">
<li>
<p>Summary:</p>
<ul>
<li>Nested</li>
<li>Field</li>
<li><a href="#constructor-summary">Constr</a></li>
<li><a href="#method-summary">Method</a></li>
</ul>
</li>
<li>
<p>Detail:</p>
<ul>
<li>Field</li>
<li><a href="#constructor-detail">Constr</a></li>
<li><a href="#method-detail">Method</a></li>
</ul>
</li>
</ul>
</div>
<div class="sub-nav">
<div id="navbar-sub-list">
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" disabled placeholder="Search">
<input type="reset" id="reset-button" disabled value="reset">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.juneau.parser</a></div>
<h1 title="Class Parser.Builder" class="title">Class Parser.Builder</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance"><a href="../Context.Builder.html" title="class in org.apache.juneau">org.apache.juneau.Context.Builder</a>
<div class="inheritance"><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">org.apache.juneau.BeanContextable.Builder</a>
<div class="inheritance">org.apache.juneau.parser.Parser.Builder</div>
</div>
</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="InputStreamParser.Builder.html" title="class in org.apache.juneau.parser">InputStreamParser.Builder</a></code>, <code><a href="ReaderParser.Builder.html" title="class in org.apache.juneau.parser">ReaderParser.Builder</a></code></dd>
</dl>
<dl class="notes">
<dt>Enclosing class:</dt>
<dd><code><a href="Parser.html" title="class in org.apache.juneau.parser">Parser</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public static class </span><span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.html#line-184">Parser.Builder</a></span>
<span class="extends-implements">extends <a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></span></div>
<div class="block">Builder class.</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier</div>
<div class="table-header col-second">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>protected </code></div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">Builder</a>()</code></div>
<div class="col-last even-row-color">
<div class="block">Constructor, default settings.</div>
</div>
<div class="col-first odd-row-color"><code>protected </code></div>
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(org.apache.juneau.parser.Parser)" class="member-name-link">Builder</a><wbr>(<a href="Parser.html" title="class in org.apache.juneau.parser">Parser</a>&nbsp;copyFrom)</code></div>
<div class="col-last odd-row-color">
<div class="block">Copy constructor.</div>
</div>
<div class="col-first even-row-color"><code>protected </code></div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(org.apache.juneau.parser.Parser.Builder)" class="member-name-link">Builder</a><wbr>(<a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a>&nbsp;copyFrom)</code></div>
<div class="col-last even-row-color">
<div class="block">Copy constructor.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#annotations(java.lang.annotation.Annotation...)" class="member-name-link">annotations</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html" title="class or interface in java.lang.annotation" class="external-link">Annotation</a>...&nbsp;values)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Defines annotations to apply to specific classes and methods.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#apply(org.apache.juneau.AnnotationWorkList)" class="member-name-link">apply</a><wbr>(<a href="../AnnotationWorkList.html" title="class in org.apache.juneau">AnnotationWorkList</a>&nbsp;work)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Applies a set of applied to this builder.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#applyAnnotations(java.lang.Class...)" class="member-name-link">applyAnnotations</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;fromClasses)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Applies any of the various <ja>@XConfig</ja> annotations on the specified class to this context.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#applyAnnotations(java.lang.reflect.Method...)" class="member-name-link">applyAnnotations</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html" title="class or interface in java.lang.reflect" class="external-link">Method</a>...&nbsp;fromMethods)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Applies any of the various <ja>@XConfig</ja> annotations on the specified method to this context.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#autoCloseStreams()" class="member-name-link">autoCloseStreams</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Auto-close streams.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#autoCloseStreams(boolean)" class="member-name-link">autoCloseStreams</a><wbr>(boolean&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Same as <a href="#autoCloseStreams()"><code>autoCloseStreams()</code></a> but allows you to explicitly specify the value.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanClassVisibility(org.apache.juneau.Visibility)" class="member-name-link">beanClassVisibility</a><wbr>(<a href="../Visibility.html" title="enum in org.apache.juneau">Visibility</a>&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Minimum bean class visibility.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanConstructorVisibility(org.apache.juneau.Visibility)" class="member-name-link">beanConstructorVisibility</a><wbr>(<a href="../Visibility.html" title="enum in org.apache.juneau">Visibility</a>&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Minimum bean constructor visibility.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanContext(org.apache.juneau.BeanContext)" class="member-name-link">beanContext</a><wbr>(<a href="../BeanContext.html" title="class in org.apache.juneau">BeanContext</a>&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Specifies an already-instantiated bean context to use.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanContext(org.apache.juneau.BeanContext.Builder)" class="member-name-link">beanContext</a><wbr>(<a href="../BeanContext.Builder.html" title="class in org.apache.juneau">BeanContext.Builder</a>&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Overrides the bean context builder.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanDictionary(java.lang.Class...)" class="member-name-link">beanDictionary</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;values)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean dictionary.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanFieldVisibility(org.apache.juneau.Visibility)" class="member-name-link">beanFieldVisibility</a><wbr>(<a href="../Visibility.html" title="enum in org.apache.juneau">Visibility</a>&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Minimum bean field visibility.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanInterceptor(java.lang.Class,java.lang.Class)" class="member-name-link">beanInterceptor</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;? extends <a href="../swap/BeanInterceptor.html" title="class in org.apache.juneau.swap">BeanInterceptor</a>&lt;?&gt;&gt;&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean interceptor.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanMapPutReturnsOldValue()" class="member-name-link">beanMapPutReturnsOldValue</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">BeanMap.put() returns old property value.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanMethodVisibility(org.apache.juneau.Visibility)" class="member-name-link">beanMethodVisibility</a><wbr>(<a href="../Visibility.html" title="enum in org.apache.juneau">Visibility</a>&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Minimum bean method visibility.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanProperties(java.lang.Class,java.lang.String)" class="member-name-link">beanProperties</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;beanClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean property includes.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanProperties(java.lang.String,java.lang.String)" class="member-name-link">beanProperties</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;beanClassName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean property includes.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanProperties(java.util.Map)" class="member-name-link">beanProperties</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&gt;&nbsp;values)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean property includes.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanPropertiesExcludes(java.lang.Class,java.lang.String)" class="member-name-link">beanPropertiesExcludes</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;beanClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean property excludes.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanPropertiesExcludes(java.lang.String,java.lang.String)" class="member-name-link">beanPropertiesExcludes</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;beanClassName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean property excludes.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanPropertiesExcludes(java.util.Map)" class="member-name-link">beanPropertiesExcludes</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&gt;&nbsp;values)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean property excludes.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanPropertiesReadOnly(java.lang.Class,java.lang.String)" class="member-name-link">beanPropertiesReadOnly</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;beanClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Read-only bean properties.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanPropertiesReadOnly(java.lang.String,java.lang.String)" class="member-name-link">beanPropertiesReadOnly</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;beanClassName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Read-only bean properties.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanPropertiesReadOnly(java.util.Map)" class="member-name-link">beanPropertiesReadOnly</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&gt;&nbsp;values)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Read-only bean properties.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanPropertiesWriteOnly(java.lang.Class,java.lang.String)" class="member-name-link">beanPropertiesWriteOnly</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;beanClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Write-only bean properties.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanPropertiesWriteOnly(java.lang.String,java.lang.String)" class="member-name-link">beanPropertiesWriteOnly</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;beanClassName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Write-only bean properties.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beanPropertiesWriteOnly(java.util.Map)" class="member-name-link">beanPropertiesWriteOnly</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&gt;&nbsp;values)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Write-only bean properties.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beansRequireDefaultConstructor()" class="member-name-link">beansRequireDefaultConstructor</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Beans require no-arg constructors.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beansRequireSerializable()" class="member-name-link">beansRequireSerializable</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Beans require Serializable interface.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#beansRequireSettersForGetters()" class="member-name-link">beansRequireSettersForGetters</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Beans require setters for getters.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.html" title="class in org.apache.juneau.parser">Parser</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#build()" class="member-name-link">build</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Build the object.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#cache(org.apache.juneau.internal.Cache)" class="member-name-link">cache</a><wbr>(<a href="../internal/Cache.html" title="class in org.apache.juneau.internal">Cache</a>&lt;<a href="../utils/HashKey.html" title="class in org.apache.juneau.utils">HashKey</a>,<wbr>? extends <a href="../Context.html" title="class in org.apache.juneau">Context</a>&gt;&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Specifies a cache to use for hashkey-based caching.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#consumes(java.lang.String)" class="member-name-link">consumes</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Specifies the media type that this parser consumes.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#copy()" class="member-name-link">copy</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Copy creator.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#debug()" class="member-name-link">debug</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block"><i><l>Context</l> configuration property:&emsp;</i> Debug mode.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#debug(boolean)" class="member-name-link">debug</a><wbr>(boolean&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Same as <a href="../Context.Builder.html#debug()"><code>Context.Builder.debug()</code></a> but allows you to explicitly specify the value.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#debugOutputLines(int)" class="member-name-link">debugOutputLines</a><wbr>(int&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Debug output lines.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#dictionaryOn(java.lang.Class,java.lang.Class...)" class="member-name-link">dictionaryOn</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;values)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean dictionary.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#disableBeansRequireSomeProperties()" class="member-name-link">disableBeansRequireSomeProperties</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Beans don't require at least one property.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#disableIgnoreMissingSetters()" class="member-name-link">disableIgnoreMissingSetters</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Don't silently ignore missing setters.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#disableIgnoreTransientFields()" class="member-name-link">disableIgnoreTransientFields</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Don't ignore transient fields.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#disableIgnoreUnknownNullBeanProperties()" class="member-name-link">disableIgnoreUnknownNullBeanProperties</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Don't ignore unknown properties with null values.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#disableInterfaceProxies()" class="member-name-link">disableInterfaceProxies</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Don't use interface proxies.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;T&gt;&nbsp;<a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#example(java.lang.Class,java.lang.String)" class="member-name-link">example</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;T&gt;&nbsp;pojoClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;json)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">POJO example.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;T&gt;&nbsp;<a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#example(java.lang.Class,T)" class="member-name-link">example</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;T&gt;&nbsp;pojoClass,
T&nbsp;o)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">POJO example.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#findFluentSetters()" class="member-name-link">findFluentSetters</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Find fluent setters.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#findFluentSetters(java.lang.Class)" class="member-name-link">findFluentSetters</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Find fluent setters.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getConsumes()" class="member-name-link">getConsumes</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the current value for the 'consumes' property.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../utils/HashKey.html" title="class in org.apache.juneau.utils">HashKey</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#hashKey()" class="member-name-link">hashKey</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the hashkey of this builder.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#ignoreInvocationExceptionsOnGetters()" class="member-name-link">ignoreInvocationExceptionsOnGetters</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Ignore invocation errors on getters.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#ignoreInvocationExceptionsOnSetters()" class="member-name-link">ignoreInvocationExceptionsOnSetters</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Ignore invocation errors on setters.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#ignoreUnknownBeanProperties()" class="member-name-link">ignoreUnknownBeanProperties</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Ignore unknown properties.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#ignoreUnknownEnumValues()" class="member-name-link">ignoreUnknownEnumValues</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Ignore unknown enum values.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#impl(org.apache.juneau.Context)" class="member-name-link">impl</a><wbr>(<a href="../Context.html" title="class in org.apache.juneau">Context</a>&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Specifies a pre-instantiated bean for the <a href="../Context.Builder.html#build()"><code>Context.Builder.build()</code></a> method to return.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#implClass(java.lang.Class,java.lang.Class)" class="member-name-link">implClass</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;interfaceClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;implClass)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Implementation classes.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#implClasses(java.util.Map)" class="member-name-link">implClasses</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&gt;&nbsp;values)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Implementation classes.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#interfaceClass(java.lang.Class,java.lang.Class)" class="member-name-link">interfaceClass</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Identifies a class to be used as the interface class for the specified class and all subclasses.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#interfaces(java.lang.Class...)" class="member-name-link">interfaces</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Identifies a set of interfaces.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#listener(java.lang.Class)" class="member-name-link">listener</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;? extends <a href="ParserListener.html" title="class in org.apache.juneau.parser">ParserListener</a>&gt;&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Parser listener.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#locale(java.util.Locale)" class="member-name-link">locale</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html" title="class or interface in java.util" class="external-link">Locale</a>&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block"><i><l>Context</l> configuration property:&emsp;</i> Locale.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#mediaType(org.apache.juneau.MediaType)" class="member-name-link">mediaType</a><wbr>(<a href="../MediaType.html" title="class in org.apache.juneau">MediaType</a>&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block"><i><l>Context</l> configuration property:&emsp;</i> Media type.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#notBeanClasses(java.lang.Class...)" class="member-name-link">notBeanClasses</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;values)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean class exclusions.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#notBeanPackages(java.lang.String...)" class="member-name-link">notBeanPackages</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>...&nbsp;values)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean package exclusions.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#propertyNamer(java.lang.Class,java.lang.Class)" class="member-name-link">propertyNamer</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;? extends <a href="../PropertyNamer.html" title="interface in org.apache.juneau">PropertyNamer</a>&gt;&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean property namer</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#propertyNamer(java.lang.Class)" class="member-name-link">propertyNamer</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;? extends <a href="../PropertyNamer.html" title="interface in org.apache.juneau">PropertyNamer</a>&gt;&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean property namer</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#sortProperties()" class="member-name-link">sortProperties</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sort bean properties.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#sortProperties(java.lang.Class...)" class="member-name-link">sortProperties</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;on)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sort bean properties.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#stopClass(java.lang.Class,java.lang.Class)" class="member-name-link">stopClass</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Identifies a stop class for the annotated class.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#strict()" class="member-name-link">strict</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Strict mode.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#strict(boolean)" class="member-name-link">strict</a><wbr>(boolean&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Same as <a href="#strict()"><code>strict()</code></a> but allows you to explicitly specify the value.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;T,<wbr>
S&gt;&nbsp;<a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#swap(java.lang.Class,java.lang.Class,org.apache.juneau.utils.ThrowingFunction)" class="member-name-link">swap</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;T&gt;&nbsp;normalClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;S&gt;&nbsp;swappedClass,
<a href="../utils/ThrowingFunction.html" title="interface in org.apache.juneau.utils">ThrowingFunction</a>&lt;T,<wbr>S&gt;&nbsp;swapFunction)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">A shortcut for defining a <a href="../swap/FunctionalSwap.html" title="class in org.apache.juneau.swap"><code>FunctionalSwap</code></a>.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;T,<wbr>
S&gt;&nbsp;<a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#swap(java.lang.Class,java.lang.Class,org.apache.juneau.utils.ThrowingFunction,org.apache.juneau.utils.ThrowingFunction)" class="member-name-link">swap</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;T&gt;&nbsp;normalClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;S&gt;&nbsp;swappedClass,
<a href="../utils/ThrowingFunction.html" title="interface in org.apache.juneau.utils">ThrowingFunction</a>&lt;T,<wbr>S&gt;&nbsp;swapFunction,
<a href="../utils/ThrowingFunction.html" title="interface in org.apache.juneau.utils">ThrowingFunction</a>&lt;S,<wbr>T&gt;&nbsp;unswapFunction)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">A shortcut for defining a <a href="../swap/FunctionalSwap.html" title="class in org.apache.juneau.swap"><code>FunctionalSwap</code></a>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#swaps(java.lang.Class...)" class="member-name-link">swaps</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;values)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Java object swaps.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#timeZone(java.util.TimeZone)" class="member-name-link">timeZone</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html" title="class or interface in java.util" class="external-link">TimeZone</a>&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block"><i><l>Context</l> configuration property:&emsp;</i> TimeZone.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#trimStrings()" class="member-name-link">trimStrings</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Trim parsed strings.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#trimStrings(boolean)" class="member-name-link">trimStrings</a><wbr>(boolean&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Same as <a href="#trimStrings()"><code>trimStrings()</code></a> but allows you to explicitly specify the value.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#type(java.lang.Class)" class="member-name-link">type</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;? extends <a href="../Context.html" title="class in org.apache.juneau">Context</a>&gt;&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Associates a context class with this builder.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#typeName(java.lang.Class,java.lang.String)" class="member-name-link">typeName</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">An identifying name for this class.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#typePropertyName(java.lang.Class,java.lang.String)" class="member-name-link">typePropertyName</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean type property name.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#typePropertyName(java.lang.String)" class="member-name-link">typePropertyName</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Bean type property name.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#unbuffered()" class="member-name-link">unbuffered</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Unbuffered.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#unbuffered(boolean)" class="member-name-link">unbuffered</a><wbr>(boolean&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Same as <a href="#unbuffered()"><code>unbuffered()</code></a> but allows you to explicitly specify the value.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#useEnumNames()" class="member-name-link">useEnumNames</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Use enum names.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#useJavaBeanIntrospector()" class="member-name-link">useJavaBeanIntrospector</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Use Java Introspector.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-org.apache.juneau.BeanContextable.Builder">Methods inherited from class&nbsp;org.apache.juneau.<a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></h3>
<code><a href="../BeanContextable.Builder.html#beanContext()">beanContext</a>, <a href="../BeanContextable.Builder.html#beanContext(java.util.function.Consumer)">beanContext</a></code></div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-org.apache.juneau.Context.Builder">Methods inherited from class&nbsp;org.apache.juneau.<a href="../Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></h3>
<code><a href="../Context.Builder.html#apply(java.lang.Class,java.util.function.Consumer)">apply</a>, <a href="../Context.Builder.html#build(java.lang.Class)">build</a>, <a href="../Context.Builder.html#canApply(org.apache.juneau.AnnotationWorkList)">canApply</a>, <a href="../Context.Builder.html#env(java.lang.String)">env</a>, <a href="../Context.Builder.html#env(java.lang.String,T)">env</a>, <a href="../Context.Builder.html#getApplied()">getApplied</a>, <a href="../Context.Builder.html#getType()">getType</a>, <a href="../Context.Builder.html#isDebug()">isDebug</a>, <a href="../Context.Builder.html#registerBuilders(java.lang.Object...)">registerBuilders</a></code></div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;()">
<h3>Builder</h3>
<div class="member-signature"><span class="modifiers">protected</span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-195">Builder</a></span>()</div>
<div class="block">Constructor, default settings.</div>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(org.apache.juneau.parser.Parser)">
<h3>Builder</h3>
<div class="member-signature"><span class="modifiers">protected</span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-210">Builder</a></span><wbr><span class="parameters">(<a href="Parser.html" title="class in org.apache.juneau.parser">Parser</a>&nbsp;copyFrom)</span></div>
<div class="block">Copy constructor.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>copyFrom</code> - The bean to copy from.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(org.apache.juneau.parser.Parser.Builder)">
<h3>Builder</h3>
<div class="member-signature"><span class="modifiers">protected</span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-226">Builder</a></span><wbr><span class="parameters">(<a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a>&nbsp;copyFrom)</span></div>
<div class="block">Copy constructor.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>copyFrom</code> - The builder to copy from.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="copy()">
<h3>copy</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-237">copy</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../Context.Builder.html#copy()">Context.Builder</a></code></span></div>
<div class="block">Copy creator.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../BeanContextable.Builder.html#copy()">copy</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>A new mutable copy of this builder.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="build()">
<h3>build</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.html" title="class in org.apache.juneau.parser">Parser</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-242">build</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../Context.Builder.html#build()">Context.Builder</a></code></span></div>
<div class="block">Build the object.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../Context.Builder.html#build()">build</a></code>&nbsp;in class&nbsp;<code><a href="../Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>The built object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="hashKey()">
<h3>hashKey</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../utils/HashKey.html" title="class in org.apache.juneau.utils">HashKey</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-247">hashKey</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../Context.Builder.html#hashKey()">Context.Builder</a></code></span></div>
<div class="block">Returns the hashkey of this builder.
<p>
Used to return previously instantiated context beans that have matching hashkeys.
The <a href="../utils/HashKey.html" title="class in org.apache.juneau.utils"><code>HashKey</code></a> object is suitable for use as a hashmap key of a map of context beans.
A context bean is considered equivalent if the <a href="../utils/HashKey.html#equals(java.lang.Object)"><code>HashKey.equals(Object)</code></a> method is the same.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#hashKey()">hashKey</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>The hashkey of this builder.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="consumes(java.lang.String)">
<h3>consumes</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-271">consumes</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</span></div>
<div class="block">Specifies the media type that this parser consumes.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getConsumes()">
<h3>getConsumes</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-282">getConsumes</a></span>()</div>
<div class="block">Returns the current value for the 'consumes' property.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>The current value for the 'consumes' property.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="autoCloseStreams()">
<h3>autoCloseStreams</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-309">autoCloseStreams</a></span>()</div>
<div class="block">Auto-close streams.
<p>
When enabled, <l>InputStreams</l> and <l>Readers</l> passed into parsers will be closed
after parsing is complete.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a parser using strict mode.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.autoCloseStreams()
.build();
Reader <jv>myReader</jv> = <jk>new</jk> FileReader(<js>"/tmp/myfile.json"</js>);
MyBean <jv>myBean</jv> = <jv>parser</jv>.parse(<jv>myReader</jv>, MyBean.<jk>class</jk>);
<jsm>assertTrue</jsm>(<jv>myReader</jv>.isClosed());
</p></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="autoCloseStreams(boolean)">
<h3>autoCloseStreams</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-320">autoCloseStreams</a></span><wbr><span class="parameters">(boolean&nbsp;value)</span></div>
<div class="block">Same as <a href="#autoCloseStreams()"><code>autoCloseStreams()</code></a> but allows you to explicitly specify the value.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="debugOutputLines(int)">
<h3>debugOutputLines</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-355">debugOutputLines</a></span><wbr><span class="parameters">(int&nbsp;value)</span></div>
<div class="block">Debug output lines.
<p>
When parse errors occur, this specifies the number of lines of input before and after the
error location to be printed as part of the exception message.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a parser whose exceptions print out 100 lines before and after the parse error location.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.debug() <jc>// Enable debug mode to capture Reader contents as strings.</jc>
.debugOuputLines(100)
.build();
Reader <jv>myReader</jv> = <jk>new</jk> FileReader(<js>"/tmp/mybadfile.json"</js>);
<jk>try</jk> {
<jv>parser</jv>.parse(<jv>myReader</jv>, Object.<jk>class</jk>);
} <jk>catch</jk> (ParseException <jv>e</jv>) {
System.<jsf>err</jsf>.println(<jv>e</jv>.getMessage()); <jc>// Will display 200 lines of the output.</jc>
}
</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this property.
<br>The default value is <c>5</c>.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="listener(java.lang.Class)">
<h3>listener</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-407">listener</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;? extends <a href="ParserListener.html" title="class in org.apache.juneau.parser">ParserListener</a>&gt;&nbsp;value)</span></div>
<div class="block">Parser listener.
<p>
Class used to listen for errors and warnings that occur during parsing.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Define our parser listener.</jc>
<jc>// Simply captures all unknown bean property events.</jc>
<jk>public class</jk> MyParserListener <jk>extends</jk> ParserListener {
<jc>// A simple property to store our events.</jc>
<jk>public</jk> List&lt;String&gt; <jf>events</jf> = <jk>new</jk> LinkedList&lt;&gt;();
<ja>@Override</ja>
<jk>public</jk> &lt;T&gt; <jk>void</jk> onUnknownBeanProperty(ParserSession <jv>session</jv>, String <jv>propertyName</jv>, Class&lt;T&gt; <jv>beanClass</jv>, T <jv>bean</jv>) {
Position <jv>position</jv> = <jv>parser</jv>.getPosition();
<jf>events</jf>.add(<jv>propertyName</jv> + <js>","</js> + <jv>position</jv>.getLine() + <js>","</js> + <jv>position</jv>.getColumn());
}
}
<jc>// Create a parser using our listener.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.listener(MyParserListener.<jk>class</jk>)
.build();
<jc>// Create a session object.</jc>
<jc>// Needed because listeners are created per-session.</jc>
<jk>try</jk> (ReaderParserSession <jv>session</jv> = <jv>parser</jv>.createSession()) {
<jc>// Parse some JSON object.</jc>
MyBean <jv>myBean</jv> = <jv>session</jv>.parse(<js>"{...}"</js>, MyBean.<jk>class</jk>);
<jc>// Get the listener.</jc>
MyParserListener <jv>listener</jv> = <jv>session</jv>.getListener(MyParserListener.<jk>class</jk>);
<jc>// Dump the results to the console.</jc>
Json5.<jsf>DEFAULT</jsf>.println(<jv>listener</jv>.<jf>events</jf>);
}
</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this property.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="strict()">
<h3>strict</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-466">strict</a></span>()</div>
<div class="block">Strict mode.
<p>
When enabled, strict mode for the parser is enabled.
<p>
Strict mode can mean different things for different parsers.
<table class='styled'>
<tr><th>Parser class</th><th>Strict behavior</th></tr>
<tr>
<td>All reader-based parsers</td>
<td>
When enabled, throws <a href="ParseException.html" title="class in org.apache.juneau.parser"><code>ParseExceptions</code></a> on malformed charset input.
Otherwise, malformed input is ignored.
</td>
</tr>
<tr>
<td><a href="../json/JsonParser.html" title="class in org.apache.juneau.json"><code>JsonParser</code></a></td>
<td>
When enabled, throws exceptions on the following invalid JSON syntax:
<ul>
<li>Unquoted attributes.
<li>Missing attribute values.
<li>Concatenated strings.
<li>Javascript comments.
<li>Numbers and booleans when Strings are expected.
<li>Numbers valid in Java but not JSON (e.g. octal notation, etc...)
</ul>
</td>
</tr>
</table>
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a parser using strict mode.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.strict()
.build();
<jc>// Use it.</jc>
<jk>try</jk> {
String <jv>json</jv> = <js>"{unquotedAttr:'value'}"</js>;
<jv>parser</jv>.parse(<jv>json</jv>, MyBean.<jk>class</jk>);
} <jk>catch</jk> (ParseException <jv>e</jv>) {
<jsm>assertTrue</jsm>(<jv>e</jv>.getMessage().contains(<js>"Unquoted attribute detected."</js>);
}
</p></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="strict(boolean)">
<h3>strict</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-477">strict</a></span><wbr><span class="parameters">(boolean&nbsp;value)</span></div>
<div class="block">Same as <a href="#strict()"><code>strict()</code></a> but allows you to explicitly specify the value.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="trimStrings()">
<h3>trimStrings</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-508">trimStrings</a></span>()</div>
<div class="block">Trim parsed strings.
<p>
When enabled, string values will be trimmed of whitespace using <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#trim()" title="class or interface in java.lang" class="external-link"><code>String.trim()</code></a> before being added to
the POJO.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a parser with trim-strings enabled.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.trimStrings()
.build();
<jc>// Use it.</jc>
String <jv>json</jv> = <js>"{' foo ':' bar '}"</js>;
Map&lt;String,String&gt; <jv>myMap</jv> = <jv>parser</jv>.parse(<jv>json</jv>, HashMap.<jk>class</jk>, String.<jk>class</jk>, String.<jk>class</jk>);
<jc>// Make sure strings are parsed.</jc>
<jsm>assertEquals</jsm>(<js>"bar"</js>, <jv>myMap</jv>.get(<js>"foo"</js>));
</p></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="trimStrings(boolean)">
<h3>trimStrings</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-519">trimStrings</a></span><wbr><span class="parameters">(boolean&nbsp;value)</span></div>
<div class="block">Same as <a href="#trimStrings()"><code>trimStrings()</code></a> but allows you to explicitly specify the value.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="unbuffered()">
<h3>unbuffered</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-571">unbuffered</a></span>()</div>
<div class="block">Unbuffered.
<p>
When enabled, don't use internal buffering during parsing.
<p>
This is useful in cases when you want to parse the same input stream or reader multiple times
because it may contain multiple independent POJOs to parse.
<br>Buffering would cause the parser to read past the current POJO in the stream.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a parser using strict mode.</jc>
ReaderParser <jv>parser</jv> = JsonParser.
.<jsm>create</jsm>()
.unbuffered(<jk>true</jk>)
.build();
<jc>// If you're calling parse on the same input multiple times, use a session instead of the parser directly.</jc>
<jc>// It's more efficient because we don't need to recalc the session settings again. </jc>
ReaderParserSession <jv>session</jv> = <jv>parser</jv>.createSession();
<jc>// Read input with multiple POJOs</jc>
Reader <jv>json</jv> = <jk>new</jk> StringReader(<js>"{foo:'bar'}{foo:'baz'}"</js>);
MyBean <jv>myBean1</jv> = <jv>session</jv>.parse(<jv>json</jv>, MyBean.<jk>class</jk>);
MyBean <jv>myBean2</jv> = <jv>session</jv>.parse(<jv>json</jv>, MyBean.<jk>class</jk>);
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>
This only allows for multi-input streams for the following parsers:
<ul>
<li class='jc'><a href="../json/JsonParser.html" title="class in org.apache.juneau.json"><code>JsonParser</code></a>
<li class='jc'><a href="../uon/UonParser.html" title="class in org.apache.juneau.uon"><code>UonParser</code></a>
</ul>
It has no effect on the following parsers:
<ul>
<li class='jc'><a href="../msgpack/MsgPackParser.html" title="class in org.apache.juneau.msgpack"><code>MsgPackParser</code></a> - It already doesn't use buffering.
<li class='jc'><a href="../xml/XmlParser.html" title="class in org.apache.juneau.xml"><code>XmlParser</code></a>, <a href="../html/HtmlParser.html" title="class in org.apache.juneau.html"><code>HtmlParser</code></a> - These use StAX which doesn't allow for more than one root element anyway.
<li>RDF parsers - These read everything into an internal model before any parsing begins.
</ul>
</ul></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="unbuffered(boolean)">
<h3>unbuffered</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-582">unbuffered</a></span><wbr><span class="parameters">(boolean&nbsp;value)</span></div>
<div class="block">Same as <a href="#unbuffered()"><code>unbuffered()</code></a> but allows you to explicitly specify the value.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="annotations(java.lang.annotation.Annotation...)">
<h3>annotations</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-590">annotations</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html" title="class or interface in java.lang.annotation" class="external-link">Annotation</a>...&nbsp;values)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../Context.Builder.html#annotations(java.lang.annotation.Annotation...)">Context.Builder</a></code></span></div>
<div class="block">Defines annotations to apply to specific classes and methods.
<p>
Allows you to dynamically apply Juneau annotations typically applied directly to classes and methods.
Useful in cases where you want to use the functionality of the annotation on beans and bean properties but
do not have access to the code to do so.
<p>
As a rule, any Juneau annotation with an <l>on()</l> method can be used with this setting.
<p>
The following example shows the equivalent methods for applying the <a href="../annotation/Bean.html" title="annotation in org.apache.juneau.annotation"><code>@Bean</code></a> annotation:
<p class='bjava'>
<jc>// Class with explicit annotation.</jc>
<ja>@Bean</ja>(properties=<js>"street,city,state"</js>)
<jk>public class</jk> A {...}
<jc>// Class with annotation applied via @BeanConfig</jc>
<jk>public class</jk> B {...}
<jc>// Java REST method with @BeanConfig annotation.</jc>
<ja>@RestGet</ja>(...)
<ja>@Bean</ja>(on=<js>"B"</js>, properties=<js>"street,city,state"</js>)
<jk>public void</jk> doFoo() {...}
</p>
<p>
In general, the underlying framework uses this method when it finds dynamically applied annotations on
config annotations. However, concrete implementations of annotations are also provided that can be passed
directly into builder classes like so:
<p class='bjava'>
<jc>// Create a concrete @Bean annotation.</jc>
<ja>Bean</ja> <jv>annotation</jv> = BeanAnnotation.<jsm>create</jsm>(B.<jk>class</jk>).properties(<js>"street,city,state"</js>).build();
<jc>// Apply it to a serializer.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer.<jsm>create</jsm>().annotations(<jv>annotation</jv>).build();
<jc>// Serialize a bean with the dynamically applied annotation.</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> B());
</p>
<p>
The following is the list of annotations builders provided that can be constructed
and passed into the builder class:
<ul class='javatreec'>
<li class='ja'><a href="../annotation/BeanAnnotation.html" title="class in org.apache.juneau.annotation"><code>BeanAnnotation</code></a>
<li class='ja'><a href="../annotation/BeancAnnotation.html" title="class in org.apache.juneau.annotation"><code>BeancAnnotation</code></a>
<li class='ja'><a href="../annotation/BeanIgnoreAnnotation.html" title="class in org.apache.juneau.annotation"><code>BeanIgnoreAnnotation</code></a>
<li class='ja'><a href="../annotation/BeanpAnnotation.html" title="class in org.apache.juneau.annotation"><code>BeanpAnnotation</code></a>
<li class='ja'><a href="../annotation/ExampleAnnotation.html" title="class in org.apache.juneau.annotation"><code>ExampleAnnotation</code></a>
<li class='ja'><a href="../annotation/NamePropertyAnnotation.html" title="class in org.apache.juneau.annotation"><code>NamePropertyAnnotation</code></a>
<li class='ja'><a href="../annotation/ParentPropertyAnnotation.html" title="class in org.apache.juneau.annotation"><code>ParentPropertyAnnotation</code></a>
<li class='ja'><a href="../annotation/SwapAnnotation.html" title="class in org.apache.juneau.annotation"><code>SwapAnnotation</code></a>
<li class='ja'><a href="../annotation/UriAnnotation.html" title="class in org.apache.juneau.annotation"><code>UriAnnotation</code></a>
<li class='ja'><a href="../csv/annotation/CsvAnnotation.html" title="class in org.apache.juneau.csv.annotation"><code>CsvAnnotation</code></a>
<li class='ja'><a href="../html/annotation/HtmlAnnotation.html" title="class in org.apache.juneau.html.annotation"><code>HtmlAnnotation</code></a>
<li class='ja'><a href="../json/annotation/JsonAnnotation.html" title="class in org.apache.juneau.json.annotation"><code>JsonAnnotation</code></a>
<li class='ja'><a href="../annotation/SchemaAnnotation.html" title="class in org.apache.juneau.annotation"><code>SchemaAnnotation</code></a>
<li class='ja'><a href="../msgpack/annotation/MsgPackAnnotation.html" title="class in org.apache.juneau.msgpack.annotation"><code>MsgPackAnnotation</code></a>
<li class='ja'><a href="../oapi/annotation/OpenApiAnnotation.html" title="class in org.apache.juneau.oapi.annotation"><code>OpenApiAnnotation</code></a>
<li class='ja'><a href="../plaintext/annotation/PlainTextAnnotation.html" title="class in org.apache.juneau.plaintext.annotation"><code>PlainTextAnnotation</code></a>
<li class='ja'><a href="../soap/annotation/SoapXmlAnnotation.html" title="class in org.apache.juneau.soap.annotation"><code>SoapXmlAnnotation</code></a>
<li class='ja'><a href="../uon/annotation/UonAnnotation.html" title="class in org.apache.juneau.uon.annotation"><code>UonAnnotation</code></a>
<li class='ja'><a href="../urlencoding/annotation/UrlEncodingAnnotation.html" title="class in org.apache.juneau.urlencoding.annotation"><code>UrlEncodingAnnotation</code></a>
<li class='ja'><a href="../xml/annotation/XmlAnnotation.html" title="class in org.apache.juneau.xml.annotation"><code>XmlAnnotation</code></a>
</ul>
<p>
The syntax for the <l>on()</l> pattern match parameter depends on whether it applies to a class, method, field, or constructor.
The valid pattern matches are:
<ul class='spaced-list'>
<li>Classes:
<ul>
<li>Fully qualified:
<ul>
<li><js>"com.foo.MyClass"</js>
</ul>
<li>Fully qualified inner class:
<ul>
<li><js>"com.foo.MyClass$Inner1$Inner2"</js>
</ul>
<li>Simple:
<ul>
<li><js>"MyClass"</js>
</ul>
<li>Simple inner:
<ul>
<li><js>"MyClass$Inner1$Inner2"</js>
<li><js>"Inner1$Inner2"</js>
<li><js>"Inner2"</js>
</ul>
</ul>
<li>Methods:
<ul>
<li>Fully qualified with args:
<ul>
<li><js>"com.foo.MyClass.myMethod(String,int)"</js>
<li><js>"com.foo.MyClass.myMethod(java.lang.String,int)"</js>
<li><js>"com.foo.MyClass.myMethod()"</js>
</ul>
<li>Fully qualified:
<ul>
<li><js>"com.foo.MyClass.myMethod"</js>
</ul>
<li>Simple with args:
<ul>
<li><js>"MyClass.myMethod(String,int)"</js>
<li><js>"MyClass.myMethod(java.lang.String,int)"</js>
<li><js>"MyClass.myMethod()"</js>
</ul>
<li>Simple:
<ul>
<li><js>"MyClass.myMethod"</js>
</ul>
<li>Simple inner class:
<ul>
<li><js>"MyClass$Inner1$Inner2.myMethod"</js>
<li><js>"Inner1$Inner2.myMethod"</js>
<li><js>"Inner2.myMethod"</js>
</ul>
</ul>
<li>Fields:
<ul>
<li>Fully qualified:
<ul>
<li><js>"com.foo.MyClass.myField"</js>
</ul>
<li>Simple:
<ul>
<li><js>"MyClass.myField"</js>
</ul>
<li>Simple inner class:
<ul>
<li><js>"MyClass$Inner1$Inner2.myField"</js>
<li><js>"Inner1$Inner2.myField"</js>
<li><js>"Inner2.myField"</js>
</ul>
</ul>
<li>Constructors:
<ul>
<li>Fully qualified with args:
<ul>
<li><js>"com.foo.MyClass(String,int)"</js>
<li><js>"com.foo.MyClass(java.lang.String,int)"</js>
<li><js>"com.foo.MyClass()"</js>
</ul>
<li>Simple with args:
<ul>
<li><js>"MyClass(String,int)"</js>
<li><js>"MyClass(java.lang.String,int)"</js>
<li><js>"MyClass()"</js>
</ul>
<li>Simple inner class:
<ul>
<li><js>"MyClass$Inner1$Inner2()"</js>
<li><js>"Inner1$Inner2()"</js>
<li><js>"Inner2()"</js>
</ul>
</ul>
<li>A comma-delimited list of anything on this list.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html" title="annotation in org.apache.juneau.annotation"><code>BeanConfig</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#annotations(java.lang.annotation.Annotation...)">annotations</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>values</code> - The annotations to register with the context.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="apply(org.apache.juneau.AnnotationWorkList)">
<h3>apply</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-596">apply</a></span><wbr><span class="parameters">(<a href="../AnnotationWorkList.html" title="class in org.apache.juneau">AnnotationWorkList</a>&nbsp;work)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../Context.Builder.html#apply(org.apache.juneau.AnnotationWorkList)">Context.Builder</a></code></span></div>
<div class="block">Applies a set of applied to this builder.
<p>
An <a href="../AnnotationWork.html" title="class in org.apache.juneau"><code>AnnotationWork</code></a> consists of a single pair of <a href="../reflect/AnnotationInfo.html" title="class in org.apache.juneau.reflect"><code>AnnotationInfo</code></a> that represents an annotation instance,
and <a href="../AnnotationApplier.html" title="class in org.apache.juneau"><code>AnnotationApplier</code></a> which represents the code used to apply the values in that annotation to a specific builder.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A class annotated with a config annotation.</jc>
<ja>@BeanConfig</ja>(sortProperties=<js>"$S{sortProperties,false}"</js>)
<jk>public class</jk> MyClass {...}
<jc>// Find all annotations that themselves are annotated with @ContextPropertiesApply.</jc>
AnnotationList <jv>annotations</jv> = ClassInfo.<jsm>of</jsm>(MyClass.<jk>class</jk>).getAnnotationList(<jsf>CONTEXT_APPLY_FILTER</jsf>);
VarResolverSession <jv>vrs</jv> = VarResolver.<jsf>DEFAULT</jsf>.createSession();
AnnotationWorkList <jv>work</jv> = AnnotationWorkList.of(<jv>vrs</jv>, <jv>annotations</jv>);
<jc>// Apply any settings found on the annotations.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.apply(<jv>work</jv>)
.build();
</p></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#apply(org.apache.juneau.AnnotationWorkList)">apply</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>work</code> - The list of annotations and appliers to apply to this builder.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="applyAnnotations(java.lang.Class...)">
<h3>applyAnnotations</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-602">applyAnnotations</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;fromClasses)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../Context.Builder.html#applyAnnotations(java.lang.Class...)">Context.Builder</a></code></span></div>
<div class="block">Applies any of the various <ja>@XConfig</ja> annotations on the specified class to this context.
<p>
Any annotations found that themselves are annotated with <a href="../annotation/ContextApply.html" title="annotation in org.apache.juneau.annotation"><code>ContextApply</code></a> will be resolved and
applied as properties to this builder. These annotations include:
<ul class='javatreec'>
<li class='ja'><a href="../annotation/BeanConfig.html" title="annotation in org.apache.juneau.annotation"><code>BeanConfig</code></a>
<li class='ja'><a href="../csv/annotation/CsvConfig.html" title="annotation in org.apache.juneau.csv.annotation"><code>CsvConfig</code></a>
<li class='ja'><a href="../html/annotation/HtmlConfig.html" title="annotation in org.apache.juneau.html.annotation"><code>HtmlConfig</code></a>
<li class='ja'><a href="../html/annotation/HtmlDocConfig.html" title="annotation in org.apache.juneau.html.annotation"><code>HtmlDocConfig</code></a>
<li class='ja'><a href="../json/annotation/JsonConfig.html" title="annotation in org.apache.juneau.json.annotation"><code>JsonConfig</code></a>
<li class='ja'><a href="../jsonschema/annotation/JsonSchemaConfig.html" title="annotation in org.apache.juneau.jsonschema.annotation"><code>JsonSchemaConfig</code></a>
<li class='ja'><a href="../msgpack/annotation/MsgPackConfig.html" title="annotation in org.apache.juneau.msgpack.annotation"><code>MsgPackConfig</code></a>
<li class='ja'><a href="../oapi/annotation/OpenApiConfig.html" title="annotation in org.apache.juneau.oapi.annotation"><code>OpenApiConfig</code></a>
<li class='ja'><a href="annotation/ParserConfig.html" title="annotation in org.apache.juneau.parser.annotation"><code>ParserConfig</code></a>
<li class='ja'><a href="../plaintext/annotation/PlainTextConfig.html" title="annotation in org.apache.juneau.plaintext.annotation"><code>PlainTextConfig</code></a>
<li class='ja'><a href="../serializer/annotation/SerializerConfig.html" title="annotation in org.apache.juneau.serializer.annotation"><code>SerializerConfig</code></a>
<li class='ja'><a href="../soap/annotation/SoapXmlConfig.html" title="annotation in org.apache.juneau.soap.annotation"><code>SoapXmlConfig</code></a>
<li class='ja'><a href="../uon/annotation/UonConfig.html" title="annotation in org.apache.juneau.uon.annotation"><code>UonConfig</code></a>
<li class='ja'><a href="../urlencoding/annotation/UrlEncodingConfig.html" title="annotation in org.apache.juneau.urlencoding.annotation"><code>UrlEncodingConfig</code></a>
<li class='ja'><a href="../xml/annotation/XmlConfig.html" title="annotation in org.apache.juneau.xml.annotation"><code>XmlConfig</code></a>
<li class='ja'><c>RdfConfig</c>
</ul>
<p>
Annotations on classes are appended in the following order:
<ol>
<li>On the package of this class.
<li>On interfaces ordered parent-to-child.
<li>On parent classes ordered parent-to-child.
<li>On this class.
</ol>
<p>
The default var resolver <a href="../svl/VarResolver.html#DEFAULT"><code>VarResolver.DEFAULT</code></a> is used to resolve any variables in annotation field values.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A class annotated with a config annotation.</jc>
<ja>@BeanConfig</ja>(sortProperties=<js>"$S{sortProperties,false}"</js>)
<jk>public class</jk> MyClass {...}
<jc>// Apply any settings found on the annotations.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.applyAnnotations(MyClass.<jk>class</jk>)
.build();
</p></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#applyAnnotations(java.lang.Class...)">applyAnnotations</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>fromClasses</code> - The classes on which the annotations are defined.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="applyAnnotations(java.lang.reflect.Method...)">
<h3>applyAnnotations</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-608">applyAnnotations</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html" title="class or interface in java.lang.reflect" class="external-link">Method</a>...&nbsp;fromMethods)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../Context.Builder.html#applyAnnotations(java.lang.reflect.Method...)">Context.Builder</a></code></span></div>
<div class="block">Applies any of the various <ja>@XConfig</ja> annotations on the specified method to this context.
<p>
Any annotations found that themselves are annotated with <a href="../annotation/ContextApply.html" title="annotation in org.apache.juneau.annotation"><code>ContextApply</code></a> will be resolved and
applied as properties to this builder. These annotations include:
<ul class='javatreec'>
<li class='ja'><a href="../annotation/BeanConfig.html" title="annotation in org.apache.juneau.annotation"><code>BeanConfig</code></a>
<li class='ja'><a href="../csv/annotation/CsvConfig.html" title="annotation in org.apache.juneau.csv.annotation"><code>CsvConfig</code></a>
<li class='ja'><a href="../html/annotation/HtmlConfig.html" title="annotation in org.apache.juneau.html.annotation"><code>HtmlConfig</code></a>
<li class='ja'><a href="../html/annotation/HtmlDocConfig.html" title="annotation in org.apache.juneau.html.annotation"><code>HtmlDocConfig</code></a>
<li class='ja'><a href="../json/annotation/JsonConfig.html" title="annotation in org.apache.juneau.json.annotation"><code>JsonConfig</code></a>
<li class='ja'><a href="../jsonschema/annotation/JsonSchemaConfig.html" title="annotation in org.apache.juneau.jsonschema.annotation"><code>JsonSchemaConfig</code></a>
<li class='ja'><a href="../msgpack/annotation/MsgPackConfig.html" title="annotation in org.apache.juneau.msgpack.annotation"><code>MsgPackConfig</code></a>
<li class='ja'><a href="../oapi/annotation/OpenApiConfig.html" title="annotation in org.apache.juneau.oapi.annotation"><code>OpenApiConfig</code></a>
<li class='ja'><a href="annotation/ParserConfig.html" title="annotation in org.apache.juneau.parser.annotation"><code>ParserConfig</code></a>
<li class='ja'><a href="../plaintext/annotation/PlainTextConfig.html" title="annotation in org.apache.juneau.plaintext.annotation"><code>PlainTextConfig</code></a>
<li class='ja'><a href="../serializer/annotation/SerializerConfig.html" title="annotation in org.apache.juneau.serializer.annotation"><code>SerializerConfig</code></a>
<li class='ja'><a href="../soap/annotation/SoapXmlConfig.html" title="annotation in org.apache.juneau.soap.annotation"><code>SoapXmlConfig</code></a>
<li class='ja'><a href="../uon/annotation/UonConfig.html" title="annotation in org.apache.juneau.uon.annotation"><code>UonConfig</code></a>
<li class='ja'><a href="../urlencoding/annotation/UrlEncodingConfig.html" title="annotation in org.apache.juneau.urlencoding.annotation"><code>UrlEncodingConfig</code></a>
<li class='ja'><a href="../xml/annotation/XmlConfig.html" title="annotation in org.apache.juneau.xml.annotation"><code>XmlConfig</code></a>
<li class='ja'><c>RdfConfig</c>
</ul>
<p>
Annotations on methods are appended in the following order:
<ol>
<li>On the package of the method class.
<li>On interfaces ordered parent-to-child.
<li>On parent classes ordered parent-to-child.
<li>On the method class.
<li>On this method and matching methods ordered parent-to-child.
</ol>
<p>
The default var resolver <a href="../svl/VarResolver.html#DEFAULT"><code>VarResolver.DEFAULT</code></a> is used to resolve any variables in annotation field values.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A method annotated with a config annotation.</jc>
<jk>public class</jk> MyClass {
<ja>@BeanConfig</ja>(sortProperties=<js>"$S{sortProperties,false}"</js>)
<jk>public void</jk> myMethod() {...}
}
<jc>// Apply any settings found on the annotations.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.applyAnnotations(MyClass.<jk>class</jk>.getMethod(<js>"myMethod"</js>))
.build();
</p></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#applyAnnotations(java.lang.reflect.Method...)">applyAnnotations</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>fromMethods</code> - The methods on which the annotations are defined.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="cache(org.apache.juneau.internal.Cache)">
<h3>cache</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-614">cache</a></span><wbr><span class="parameters">(<a href="../internal/Cache.html" title="class in org.apache.juneau.internal">Cache</a>&lt;<a href="../utils/HashKey.html" title="class in org.apache.juneau.utils">HashKey</a>,<wbr>? extends <a href="../Context.html" title="class in org.apache.juneau">Context</a>&gt;&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../Context.Builder.html#cache(org.apache.juneau.internal.Cache)">Context.Builder</a></code></span></div>
<div class="block">Specifies a cache to use for hashkey-based caching.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#cache(org.apache.juneau.internal.Cache)">cache</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The cache.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="debug()">
<h3>debug</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-620">debug</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../Context.Builder.html#debug()">Context.Builder</a></code></span></div>
<div class="block"><i><l>Context</l> configuration property:&emsp;</i> Debug mode.
<p>
Enables the following additional information during serialization:
<ul class='spaced-list'>
<li>
When bean getters throws exceptions, the exception includes the object stack information
in order to determine how that method was invoked.
<li>
Enables <a href="../BeanTraverseContext.Builder.html#detectRecursions()"><code>BeanTraverseContext.Builder.detectRecursions()</code></a>.
</ul>
<p>
Enables the following additional information during parsing:
<ul class='spaced-list'>
<li>
When bean setters throws exceptions, the exception includes the object stack information
in order to determine how that method was invoked.
</ul>
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a serializer with debug enabled.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.debug()
.build();
<jc>// Create a POJO model with a recursive loop.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> Object <jf>f</jf>;
}
MyBean <jv>bean</jv> = <jk>new</jk> MyBean();
<jv>bean</jv>.<jf>f</jf> = <jv>bean</jv>;
<jc>// Throws a SerializeException and not a StackOverflowError</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jv>bean</jv>);
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#debug()"><code>BeanConfig.debug()</code></a>
<li class='jm'><a href="../ContextSession.Builder.html#debug(java.lang.Boolean)"><code>ContextSession.Builder.debug(Boolean)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#debug()">debug</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="debug(boolean)">
<h3>debug</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-626">debug</a></span><wbr><span class="parameters">(boolean&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../Context.Builder.html#debug(boolean)">Context.Builder</a></code></span></div>
<div class="block">Same as <a href="../Context.Builder.html#debug()"><code>Context.Builder.debug()</code></a> but allows you to explicitly specify the value.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../Context.Builder.html#debug(boolean)">debug</a></code>&nbsp;in class&nbsp;<code><a href="../Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="impl(org.apache.juneau.Context)">
<h3>impl</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-632">impl</a></span><wbr><span class="parameters">(<a href="../Context.html" title="class in org.apache.juneau">Context</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../Context.Builder.html#impl(org.apache.juneau.Context)">Context.Builder</a></code></span></div>
<div class="block">Specifies a pre-instantiated bean for the <a href="../Context.Builder.html#build()"><code>Context.Builder.build()</code></a> method to return.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#impl(org.apache.juneau.Context)">impl</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="type(java.lang.Class)">
<h3>type</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-638">type</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;? extends <a href="../Context.html" title="class in org.apache.juneau">Context</a>&gt;&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../Context.Builder.html#type(java.lang.Class)">Context.Builder</a></code></span></div>
<div class="block">Associates a context class with this builder.
<p>
This is the type of object that this builder creates when the <a href="../Context.Builder.html#build()"><code>Context.Builder.build()</code></a> method is called.
<p>
By default, it's the outer class of where the builder class is defined.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#type(java.lang.Class)">type</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The context class that this builder should create.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanClassVisibility(org.apache.juneau.Visibility)">
<h3>beanClassVisibility</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-644">beanClassVisibility</a></span><wbr><span class="parameters">(<a href="../Visibility.html" title="enum in org.apache.juneau">Visibility</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanClassVisibility(org.apache.juneau.Visibility)">BeanContextable.Builder</a></code></span></div>
<div class="block">Minimum bean class visibility.
<p>
Classes are not considered beans unless they meet the minimum visibility requirements.
For example, if the visibility is <jsf>PUBLIC</jsf> and the bean class is <jk>protected</jk>, then the class
will not be interpreted as a bean class and be serialized as a string.
Use this setting to reduce the visibility requirement.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a protected class and one field.</jc>
<jk>protected class</jk> MyBean {
<jk>public</jk> String <jf>foo</jf> = <js>"bar"</js>;
}
<jc>// Create a serializer that's capable of serializing the class.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanClassVisibility(<jsf>PROTECTED</jsf>)
.build();
<jc>// Produces: {"foo","bar"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>Notes:</h5>
<ul>
<li class='note'>The <a href="../annotation/Bean.html" title="annotation in org.apache.juneau.annotation"><code>@Bean</code></a> annotation can be used on a non-public bean class to override this setting.
<li class='note'>The <a href="../annotation/BeanIgnore.html" title="annotation in org.apache.juneau.annotation"><code>@BeanIgnore</code></a> annotation can also be used on a public bean class to ignore it as a bean.
</ul>
<h5 class='section'>See Also:</h5>
<ul>
<li class='ja'><a href="../annotation/BeanConfig.html#beanClassVisibility()"><code>BeanConfig.beanClassVisibility()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanClassVisibility(org.apache.juneau.Visibility)">beanClassVisibility</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this setting.
<br>The default is <a href="../Visibility.html#PUBLIC"><code>Visibility.PUBLIC</code></a>.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanConstructorVisibility(org.apache.juneau.Visibility)">
<h3>beanConstructorVisibility</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-650">beanConstructorVisibility</a></span><wbr><span class="parameters">(<a href="../Visibility.html" title="enum in org.apache.juneau">Visibility</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanConstructorVisibility(org.apache.juneau.Visibility)">BeanContextable.Builder</a></code></span></div>
<div class="block">Minimum bean constructor visibility.
<p>
Only look for constructors with the specified minimum visibility.
<p>
This setting affects the logic for finding no-arg constructors for bean. Normally, only <jk>public</jk> no-arg
constructors are used. Use this setting if you want to reduce the visibility requirement.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a protected constructor and one field.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>foo</jf>;
<jk>protected</jk> MyBean() {}
}
<jc>// Create a parser capable of calling the protected constructor.</jc>
ReaderParser <jv>parser</jv> = ReaderParser
.<jsm>create</jsm>()
.beanConstructorVisibility(<jsf>PROTECTED</jsf>)
.build();
<jc>// Use it.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'bar'}"</js>, MyBean.<jk>class</jk>);
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Beanc.html" title="annotation in org.apache.juneau.annotation"><code>@Beanc</code></a> annotation can also be used to expose a non-public constructor.
<li class='note'>The <a href="../annotation/BeanIgnore.html" title="annotation in org.apache.juneau.annotation"><code>@BeanIgnore</code></a> annotation can also be used on a public bean constructor to ignore it.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#beanConstructorVisibility()"><code>BeanConfig.beanConstructorVisibility()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanConstructorVisibility(org.apache.juneau.Visibility)">beanConstructorVisibility</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this setting.
<br>The default is <a href="../Visibility.html#PUBLIC"><code>Visibility.PUBLIC</code></a>.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanContext(org.apache.juneau.BeanContext)">
<h3>beanContext</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-656">beanContext</a></span><wbr><span class="parameters">(<a href="../BeanContext.html" title="class in org.apache.juneau">BeanContext</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanContext(org.apache.juneau.BeanContext)">BeanContextable.Builder</a></code></span></div>
<div class="block">Specifies an already-instantiated bean context to use.
<p>
Provides an optimization for cases where serializers and parsers can use an existing
bean context without having to go through <c><jv>beanContext</jv>.copy().build()</c>.
An example is <a href="../BeanContext.html#getBeanToStringSerializer()"><code>BeanContext.getBeanToStringSerializer()</code></a>.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanContext(org.apache.juneau.BeanContext)">beanContext</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The bean context to use.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanContext(org.apache.juneau.BeanContext.Builder)">
<h3>beanContext</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-662">beanContext</a></span><wbr><span class="parameters">(<a href="../BeanContext.Builder.html" title="class in org.apache.juneau">BeanContext.Builder</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanContext(org.apache.juneau.BeanContext.Builder)">BeanContextable.Builder</a></code></span></div>
<div class="block">Overrides the bean context builder.
<p>
Used when sharing bean context builders across multiple context objects.
For example, <a href="../jsonschema/JsonSchemaGenerator.Builder.html" title="class in org.apache.juneau.jsonschema"><code>JsonSchemaGenerator.Builder</code></a> uses this to apply common bean settings with the JSON
serializer and parser.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanContext(org.apache.juneau.BeanContext.Builder)">beanContext</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanDictionary(java.lang.Class...)">
<h3>beanDictionary</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-668">beanDictionary</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;values)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanDictionary(java.lang.Class...)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean dictionary.
<p>
The list of classes that make up the bean dictionary in this bean context.
<p>
Values are prepended to the list so that later calls can override classes of earlier calls.
<p>
A dictionary is a name/class mapping used to find class types during parsing when they cannot be inferred
through reflection. The names are defined through the <a href="../annotation/Bean.html#typeName()"><code>@Bean(typeName)</code></a> annotation defined
on the bean class. For example, if a class <c>Foo</c> has a type-name of <js>"myfoo"</js>, then it would end up
serialized as <js>"{_type:'myfoo',...}"</js> in JSON
or <js>"&lt;myfoo&gt;...&lt;/myfoo&gt;"</js> in XML.
<p>
This setting tells the parsers which classes to look for when resolving <js>"_type"</js> attributes.
<p>
Values can consist of any of the following types:
<ul>
<li>Any bean class that specifies a value for <a href="../annotation/Bean.html#typeName()"><code>@Bean(typeName)</code></a>.
<li>Any subclass of <a href="../BeanDictionaryList.html" title="class in org.apache.juneau"><code>BeanDictionaryList</code></a> containing a collection of bean classes with type name annotations.
<li>Any subclass of <a href="../BeanDictionaryMap.html" title="class in org.apache.juneau"><code>BeanDictionaryMap</code></a> containing a mapping of type names to classes without type name annotations.
<li>Any array or collection of the objects above.
</ul>
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// POJOs with @Bean(name) annotations.</jc>
<ja>@Bean</ja>(typeName=<js>"foo"</js>)
<jk>public class</jk> Foo {...}
<ja>@Bean</ja>(typeName=<js>"bar"</js>)
<jk>public class</jk> Bar {...}
<jc>// Create a parser and tell it which classes to try to resolve.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.dictionary(Foo.<jk>class</jk>, Bar.<jk>class</jk>)
.addBeanTypes()
.build();
<jc>// A bean with a field with an indeterminate type.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> Object <jf>mySimpleField</jf>;
}
<jc>// Parse bean.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{mySimpleField:{_type:'foo',...}}"</js>, MyBean.<jk>class</jk>);
</p>
<p>
Another option is to use the <a href="../annotation/Bean.html#dictionary()"><code>Bean.dictionary()</code></a> annotation on the POJO class itself:
<p class='bjava'>
<jc>// Instead of by parser, define a bean dictionary on a class through an annotation.</jc>
<jc>// This applies to all properties on this class and all subclasses.</jc>
<ja>@Bean</ja>(dictionary={Foo.<jk>class</jk>,Bar.<jk>class</jk>})
<jk>public class</jk> MyBean {
<jk>public</jk> Object <jf>mySimpleField</jf>; <jc>// May contain Foo or Bar object.</jc>
<jk>public</jk> Map&lt;String,Object&gt; <jf>myMapField</jf>; <jc>// May contain Foo or Bar objects.</jc>
}
</p>
<p>
A typical usage is to allow for HTML documents to be parsed back into HTML beans:
<p class='bjava'>
<jc>// Use the predefined HTML5 bean dictionary which is a BeanDictionaryList.</jc>
ReaderParser <jv>parser</jv> = HtmlParser
.<jsm>create</jsm>()
.dictionary(HtmlBeanDictionary.<jk>class</jk>)
.build();
<jc>// Parse an HTML body into HTML beans.</jc>
Body <jv>body</jv> = <jv>parser</jv>.parse(<js>"&lt;body&gt;&lt;ul&gt;&lt;li&gt;foo&lt;/li&gt;&lt;li&gt;bar&lt;/li&gt;&lt;/ul&gt;"</js>, Body.<jk>class</jk>);
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/Bean.html#dictionary()"><code>Bean.dictionary()</code></a>
<li class='ja'><a href="../annotation/Beanp.html#dictionary()"><code>Beanp.dictionary()</code></a>
<li class='ja'><a href="../annotation/BeanConfig.html#dictionary()"><code>BeanConfig.dictionary()</code></a>
<li class='ja'><a href="../annotation/BeanConfig.html#dictionary_replace()"><code>BeanConfig.dictionary_replace()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanDictionary(java.lang.Class...)">beanDictionary</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>values</code> - The values to add to this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanFieldVisibility(org.apache.juneau.Visibility)">
<h3>beanFieldVisibility</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-674">beanFieldVisibility</a></span><wbr><span class="parameters">(<a href="../Visibility.html" title="enum in org.apache.juneau">Visibility</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanFieldVisibility(org.apache.juneau.Visibility)">BeanContextable.Builder</a></code></span></div>
<div class="block">Minimum bean field visibility.
<p>
Only look for bean fields with the specified minimum visibility.
<p>
This affects which fields on a bean class are considered bean properties. Normally only <jk>public</jk> fields are considered.
Use this setting if you want to reduce the visibility requirement.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a protected field.</jc>
<jk>public class</jk> MyBean {
<jk>protected</jk> String <jf>foo</jf> = <js>"bar"</js>;
}
<jc>// Create a serializer that recognizes the protected field.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanFieldVisibility(<jsf>PROTECTED</jsf>)
.build();
<jc>// Produces: {"foo":"bar"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<p>
Bean fields can be ignored as properties entirely by setting the value to <a href="../Visibility.html#NONE"><code>Visibility.NONE</code></a>
<p class='bjava'>
<jc>// Disable using fields as properties entirely.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanFieldVisibility(<jsf>NONE</jsf>)
.build();
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Beanp.html" title="annotation in org.apache.juneau.annotation"><code>@Beanp</code></a> annotation can also be used to expose a non-public field.
<li class='note'>The <a href="../annotation/BeanIgnore.html" title="annotation in org.apache.juneau.annotation"><code>@BeanIgnore</code></a> annotation can also be used on a public bean field to ignore it as a bean property.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#beanFieldVisibility()"><code>BeanConfig.beanFieldVisibility()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanFieldVisibility(org.apache.juneau.Visibility)">beanFieldVisibility</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this setting.
<br>The default is <a href="../Visibility.html#PUBLIC"><code>Visibility.PUBLIC</code></a>.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanInterceptor(java.lang.Class,java.lang.Class)">
<h3>beanInterceptor</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-680">beanInterceptor</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;? extends <a href="../swap/BeanInterceptor.html" title="class in org.apache.juneau.swap">BeanInterceptor</a>&lt;?&gt;&gt;&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanInterceptor(java.lang.Class,java.lang.Class)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean interceptor.
<p>
Bean interceptors can be used to intercept calls to getters and setters and alter their values in transit.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Interceptor that strips out sensitive information.</jc>
<jk>public class</jk> AddressInterceptor <jk>extends</jk> BeanInterceptor&lt;Address&gt; {
<jk>public</jk> Object readProperty(Address <jv>bean</jv>, String <jv>name</jv>, Object <jv>value</jv>) {
<jk>if</jk> (<js>"taxInfo"</js>.equals(<jv>name</jv>))
<jk>return</jk> <js>"redacted"</js>;
<jk>return</jk> <jv>value</jv>;
}
<jk>public</jk> Object writeProperty(Address <jv>bean</jv>, String <jv>name</jv>, Object <jv>value</jv>) {
<jk>if</jk> (<js>"taxInfo"</js>.equals(<jv>name</jv>) &amp;&amp; <js>"redacted"</js>.equals(<jv>value</jv>))
<jk>return</jk> TaxInfoUtils.<jsm>lookup</jsm>(<jv>bean</jv>.getStreet(), <jv>bean</jv>.getCity(), <jv>bean</jv>.getState());
<jk>return</jk> <jv>value</jv>;
}
}
<jc>// Our bean class.</jc>
<jk>public class</jk> Address {
<jk>public</jk> String getTaxInfo() {...}
<jk>public void</jk> setTaxInfo(String <jv>value</jv>) {...}
}
<jc>// Register filter on serializer or parser.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanInterceptor(Address.<jk>class</jk>, AddressInterceptor.<jk>class</jk>)
.build();
<jc>// Produces: {"taxInfo":"redacted"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> Address());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jc'><a href="../swap/BeanInterceptor.html" title="class in org.apache.juneau.swap"><code>BeanInterceptor</code></a>
<li class='ja'><a href="../annotation/Bean.html#interceptor()"><code>Bean(interceptor)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanInterceptor(java.lang.Class,java.lang.Class)">beanInterceptor</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>on</code> - The bean that the filter applies to.</dd>
<dd><code>value</code> - The new value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanMapPutReturnsOldValue()">
<h3>beanMapPutReturnsOldValue</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-686">beanMapPutReturnsOldValue</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanMapPutReturnsOldValue()">BeanContextable.Builder</a></code></span></div>
<div class="block">BeanMap.put() returns old property value.
<p>
When enabled, then the <a href="../BeanMap.html#put(java.lang.String,java.lang.Object)"><code>BeanMap.put()</code></a> method will return old property
values. Otherwise, it returns <jk>null</jk>.
<p>
Disabled by default because it introduces a slight performance penalty during serialization.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a context that creates BeanMaps with normal put() behavior.</jc>
BeanContext <jv>context</jv> = BeanContext
.<jsm>create</jsm>()
.beanMapPutReturnsOldValue()
.build();
BeanMap&lt;MyBean&gt; <jv>beanMap</jv> = <jv>context</jv>.createSession().toBeanMap(<jk>new</jk> MyBean());
<jv>beanMap</jv>.put(<js>"foo"</js>, <js>"bar"</js>);
Object <jv>oldValue</jv> = <jv>beanMap</jv>.put(<js>"foo"</js>, <js>"baz"</js>); <jc>// oldValue == "bar"</jc>
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#beanMapPutReturnsOldValue()"><code>BeanConfig.beanMapPutReturnsOldValue()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#beanMapPutReturnsOldValue()"><code>BeanContext.Builder.beanMapPutReturnsOldValue()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanMapPutReturnsOldValue()">beanMapPutReturnsOldValue</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanMethodVisibility(org.apache.juneau.Visibility)">
<h3>beanMethodVisibility</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-692">beanMethodVisibility</a></span><wbr><span class="parameters">(<a href="../Visibility.html" title="enum in org.apache.juneau">Visibility</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanMethodVisibility(org.apache.juneau.Visibility)">BeanContextable.Builder</a></code></span></div>
<div class="block">Minimum bean method visibility.
<p>
Only look for bean methods with the specified minimum visibility.
<p>
This affects which methods are detected as getters and setters on a bean class. Normally only <jk>public</jk> getters and setters are considered.
Use this setting if you want to reduce the visibility requirement.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a protected getter.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String getFoo() { <jk>return</jk> <js>"foo"</js>; }
<jk>protected</jk> String getBar() { <jk>return</jk> <js>"bar"</js>; }
}
<jc>// Create a serializer that looks for protected getters and setters.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanMethodVisibility(<jsf>PROTECTED</jsf>)
.build();
<jc>// Produces: {"foo":"foo","bar":"bar"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Beanp.html" title="annotation in org.apache.juneau.annotation"><code>@Beanp</code></a> annotation can also be used to expose a non-public method.
<li class='note'>The <a href="../annotation/BeanIgnore.html" title="annotation in org.apache.juneau.annotation"><code>@BeanIgnore</code></a> annotation can also be used on a public bean getter/setter to ignore it as a bean property.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#beanMethodVisibility()"><code>BeanConfig.beanMethodVisibility()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanMethodVisibility(org.apache.juneau.Visibility)">beanMethodVisibility</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this setting.
<br>The default is <a href="../Visibility.html#PUBLIC"><code>Visibility.PUBLIC</code></a></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanProperties(java.util.Map)">
<h3>beanProperties</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-698">beanProperties</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&gt;&nbsp;values)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanProperties(java.util.Map)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean property includes.
<p>
Specifies the set and order of names of properties associated with bean classes.
<p>
For example, <c>beanProperties(AMap.<jsm>of</jsm>(<js>"MyBean"</js>, <js>"foo,bar"</js>))</c> means only serialize the <c>foo</c> and
<c>bar</c> properties on the specified bean. Likewise, parsing will ignore any bean properties not specified
and either throw an exception or silently ignore them depending on whether <a href="../BeanContextable.Builder.html#ignoreUnknownBeanProperties()"><code>BeanContextable.Builder.ignoreUnknownBeanProperties()</code></a>
has been called.
<p>
This value is entirely optional if you simply want to expose all the getters and public fields on
a class as bean properties. However, it's useful if you want certain getters to be ignored or you want the properties to be
serialized in a particular order. Note that on IBM JREs, the property order is the same as the order in the source code,
whereas on Oracle JREs, the order is entirely random.
<p>
Setting applies to specified class and all subclasses.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String
<jf>foo</jf> = <js>"foo"</js>,
<jf>bar</jf> = <js>"bar"</js>,
<jf>baz</jf> = <js>"baz"</js>;
}
<jc>// Create a serializer that includes only the 'foo' and 'bar' properties on the MyBean class.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanProperties(AMap.<jsm>of</jsm>(<js>"MyBean"</js>, <js>"foo,bar"</js>))
.build();
<jc>// Produces: {"foo":"foo","bar":"bar"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<p>
This method is functionally equivalent to the following code for each entry:
<p class='bjava'>
<jv>builder</jv>.annotations(BeanAnnotation.<jsm>create</jsm>(<jv>key</jv>).properties(<jv>value</jv>.toString()).build());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jma'><a href="../annotation/Bean.html#properties()"><code>Bean.properties()</code></a> / <a href="../annotation/Bean.html#p()"><code>Bean.p()</code></a>- On an annotation on the bean class itself.
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanProperties(java.util.Map)">beanProperties</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>values</code> - The values to add to this builder.
<br>Keys are bean class names which can be a simple name, fully-qualified name, or <js>"*"</js> for all beans.
<br>Values are comma-delimited lists of property names. Non-String objects are first converted to Strings.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanProperties(java.lang.Class,java.lang.String)">
<h3>beanProperties</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-704">beanProperties</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;beanClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanProperties(java.lang.Class,java.lang.String)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean property includes.
<p>
Specifies the set and order of names of properties associated with the bean class.
<p>
For example, <c>beanProperties(MyBean.<jk>class</jk>, <js>"foo,bar"</js>)</c> means only serialize the <c>foo</c> and
<c>bar</c> properties on the specified bean. Likewise, parsing will ignore any bean properties not specified
and either throw an exception or silently ignore them depending on whether <a href="../BeanContextable.Builder.html#ignoreUnknownBeanProperties()"><code>BeanContextable.Builder.ignoreUnknownBeanProperties()</code></a>
has been called.
<p>
This value is entirely optional if you simply want to expose all the getters and public fields on
a class as bean properties. However, it's useful if you want certain getters to be ignored or you want the properties to be
serialized in a particular order. Note that on IBM JREs, the property order is the same as the order in the source code,
whereas on Oracle JREs, the order is entirely random.
<p>
Setting applies to specified class and all subclasses.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String
<jf>foo</jf> = <js>"foo"</js>,
<jf>bar</jf> = <js>"bar"</js>,
<jf>baz</jf> = <js>"baz"</js>;
}
<jc>// Create a serializer that includes only the 'foo' and 'bar' properties on the MyBean class.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanProperties(MyBean.<jk>class</jk>, <js>"foo,bar"</js>)
.build();
<jc>// Produces: {"foo":"foo","bar":"bar"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<p>
This method is functionally equivalent to the following code:
<p class='bjava'>
<jv>builder</jv>.annotations(BeanAnnotation.<jsm>create</jsm>(<jv>beanClass</jv>).properties(<jv>properties</jv>).build());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jm'><a href="../annotation/Bean.html#properties()"><code>Bean.properties()</code></a>/<a href="../annotation/Bean.html#p()"><code>Bean.p()</code></a> - On an annotation on the bean class itself.
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanProperties(java.lang.Class,java.lang.String)">beanProperties</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>beanClass</code> - The bean class.</dd>
<dd><code>properties</code> - Comma-delimited list of property names.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanProperties(java.lang.String,java.lang.String)">
<h3>beanProperties</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-710">beanProperties</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;beanClassName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanProperties(java.lang.String,java.lang.String)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean property includes.
<p>
Specifies the set and order of names of properties associated with the bean class.
<p>
For example, <c>beanProperties(<js>"MyBean"</js>, <js>"foo,bar"</js>)</c> means only serialize the <c>foo</c> and
<c>bar</c> properties on the specified bean. Likewise, parsing will ignore any bean properties not specified
and either throw an exception or silently ignore them depending on whether <a href="../BeanContextable.Builder.html#ignoreUnknownBeanProperties()"><code>BeanContextable.Builder.ignoreUnknownBeanProperties()</code></a>
has been called.
<p>
This value is entirely optional if you simply want to expose all the getters and public fields on
a class as bean properties. However, it's useful if you want certain getters to be ignored or you want the properties to be
serialized in a particular order. Note that on IBM JREs, the property order is the same as the order in the source code,
whereas on Oracle JREs, the order is entirely random.
<p>
Setting applies to specified class and all subclasses.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String
<jf>foo</jf> = <js>"foo"</js>,
<jf>bar</jf> = <js>"bar"</js>,
<jf>baz</jf> = <js>"baz"</js>;
}
<jc>// Create a serializer that includes only the 'foo' and 'bar' properties on the MyBean class.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanProperties(<js>"MyBean"</js>, <js>"foo,bar"</js>)
.build();
<jc>// Produces: {"foo":"foo","bar":"bar"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<p>
This method is functionally equivalent to the following code:
<p class='bjava'>
<jv>builder</jv>.annotations(BeanAnnotation.<jsm>create</jsm>(<jv>beanClassName</jv>).properties(<jv>properties</jv>).build());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jma'><a href="../annotation/Bean.html#properties()"><code>Bean.properties()</code></a> / <a href="../annotation/Bean.html#p()"><code>Bean.p()</code></a> - On an annotation on the bean class itself.
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanProperties(java.lang.String,java.lang.String)">beanProperties</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>beanClassName</code> - The bean class name.
<br>Can be a simple name, fully-qualified name, or <js>"*"</js> for all beans.</dd>
<dd><code>properties</code> - Comma-delimited list of property names.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanPropertiesExcludes(java.util.Map)">
<h3>beanPropertiesExcludes</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-716">beanPropertiesExcludes</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&gt;&nbsp;values)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.util.Map)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean property excludes.
<p>
Specifies to exclude the specified list of properties for the specified bean classes.
<p>
Same as <a href="../BeanContextable.Builder.html#beanProperties(java.util.Map)"><code>BeanContextable.Builder.beanProperties(Map)</code></a> except you specify a list of bean property names that you want to exclude from
serialization.
<p>
Setting applies to specified class and all subclasses.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String
<jf>foo</jf> = <js>"foo"</js>,
<jf>bar</jf> = <js>"bar"</js>,
<jf>baz</jf> = <js>"baz"</js>;
}
<jc>// Create a serializer that excludes the "bar" and "baz" properties on the MyBean class.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanPropertiesExcludes(AMap.of(<js>"MyBean"</js>, <js>"bar,baz"</js>))
.build();
<jc>// Produces: {"foo":"foo"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<p>
This method is functionally equivalent to the following code for each entry:
<p class='bjava'>
<jv>builder</jv>.annotations(BeanAnnotation.<jsm>create</jsm>(<jv>key</jv>).excludeProperties(<jv>value</jv>.toString()).build());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jma'><a href="../annotation/Bean.html#excludeProperties()"><code>Bean.excludeProperties()</code></a> / <a href="../annotation/Bean.html#xp()"><code>Bean.xp()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.util.Map)">beanPropertiesExcludes</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>values</code> - The values to add to this builder.
<br>Keys are bean class names which can be a simple name, fully-qualified name, or <js>"*"</js> for all beans.
<br>Values are comma-delimited lists of property names. Non-String objects are first converted to Strings.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanPropertiesExcludes(java.lang.Class,java.lang.String)">
<h3>beanPropertiesExcludes</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-722">beanPropertiesExcludes</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;beanClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.lang.Class,java.lang.String)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean property excludes.
<p>
Specifies to exclude the specified list of properties for the specified bean class.
<p>
Same as <a href="../BeanContextable.Builder.html#beanProperties(java.lang.Class,java.lang.String)"><code>BeanContextable.Builder.beanProperties(Class, String)</code></a> except you specify a list of bean property names that you want to exclude from
serialization.
<p>
Setting applies to specified class and all subclasses.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String
<jf>foo</jf> = <js>"foo"</js>,
<jf>bar</jf> = <js>"bar"</js>,
<jf>baz</jf> = <js>"baz"</js>;
}
<jc>// Create a serializer that excludes the "bar" and "baz" properties on the MyBean class.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanPropertiesExcludes(MyBean.<jk>class</jk>, <js>"bar,baz"</js>)
.build();
<jc>// Produces: {"foo":"foo"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<p>
This method is functionally equivalent to the following code:
<p class='bjava'>
<jv>builder</jv>.annotations(BeanAnnotation.<jsm>create</jsm>(<jv>beanClass</jv>).excludeProperties(<jv>properties</jv>).build());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jma'><a href="../annotation/Bean.html#excludeProperties()"><code>Bean.excludeProperties()</code></a> / <a href="../annotation/Bean.html#xp()"><code>Bean.xp()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.lang.Class,java.lang.String)">beanPropertiesExcludes</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>beanClass</code> - The bean class.</dd>
<dd><code>properties</code> - Comma-delimited list of property names.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanPropertiesExcludes(java.lang.String,java.lang.String)">
<h3>beanPropertiesExcludes</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-728">beanPropertiesExcludes</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;beanClassName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.lang.String,java.lang.String)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean property excludes.
<p>
Specifies to exclude the specified list of properties for the specified bean class.
<p>
Same as <a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.lang.String,java.lang.String)"><code>BeanContextable.Builder.beanPropertiesExcludes(String, String)</code></a> except you specify a list of bean property names that you want to exclude from
serialization.
<p>
Setting applies to specified class and all subclasses.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String
<jf>foo</jf> = <js>"foo"</js>,
<jf>bar</jf> = <js>"bar"</js>,
<jf>baz</jf> = <js>"baz"</js>;
}
<jc>// Create a serializer that excludes the "bar" and "baz" properties on the MyBean class.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanPropertiesExcludes(<js>"MyBean"</js>, <js>"bar,baz"</js>)
.build();
<jc>// Produces: {"foo":"foo"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<p>
This method is functionally equivalent to the following code:
<p class='bjava'>
<jv>builder</jv>.annotations(BeanAnnotation.<jsm>create</jsm>(<jv>beanClassName</jv>).excludeProperties(<jv>properties</jv>).build());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jma'><a href="../annotation/Bean.html#excludeProperties()"><code>Bean.excludeProperties()</code></a> / <a href="../annotation/Bean.html#xp()"><code>Bean.xp()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.lang.String,java.lang.String)">beanPropertiesExcludes</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>beanClassName</code> - The bean class name.
<br>Can be a simple name, fully-qualified name, or <js>"*"</js> for all bean classes.</dd>
<dd><code>properties</code> - Comma-delimited list of property names.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanPropertiesReadOnly(java.util.Map)">
<h3>beanPropertiesReadOnly</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-734">beanPropertiesReadOnly</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&gt;&nbsp;values)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanPropertiesReadOnly(java.util.Map)">BeanContextable.Builder</a></code></span></div>
<div class="block">Read-only bean properties.
<p>
Specifies one or more properties on beans that are read-only despite having valid getters.
Serializers will serialize such properties as usual, but parsers will silently ignore them.
Note that this is different from the <a href="../BeanContextable.Builder.html#beanProperties(java.lang.Class,java.lang.String)"><code>beanProperties</code></a>/<a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.lang.Class,java.lang.String)"><code>beanPropertiesExcludes</code></a> settings which include or exclude properties
for both serializers and parsers.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>foo</jf>, <jf>bar</jf>, <jf>baz</jf>;
}
<jc>// Create a serializer with read-only property settings.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanPropertiesReadOnly(AMap.<jsm>of</jsm>(<js>"MyBean"</js>, <js>"bar,baz"</js>))
.build();
<jc>// All 3 properties will be serialized.</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
<jc>// Create a parser with read-only property settings.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.beanPropertiesReadOnly(AMap.<jsm>of</jsm>(<js>"MyBean"</js>, <js>"bar,baz"</js>))
.ignoreUnknownBeanProperties()
.build();
<jc>// Parser ignores bar and baz properties.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'foo',bar:'bar',baz:'baz'}"</js>, MyBean.<jk>class</jk>);
</p>
<p>
This method is functionally equivalent to the following code for each entry:
<p class='bjava'>
<jv>builder</jv>.annotations(BeanAnnotation.<jsm>create</jsm>(<jv>key</jv>).readOnlyProperties(<jv>value</jv>.toString()).build());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jma'><a href="../annotation/Bean.html#readOnlyProperties()"><code>Bean.readOnlyProperties()</code></a> / <a href="../annotation/Bean.html#ro()"><code>Bean.ro()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanPropertiesReadOnly(java.util.Map)">beanPropertiesReadOnly</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>values</code> - The values to add to this builder.
<br>Keys are bean class names which can be a simple name, fully-qualified name, or <js>"*"</js> for all beans.
<br>Values are comma-delimited lists of property names. Non-String objects are first converted to Strings.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanPropertiesReadOnly(java.lang.Class,java.lang.String)">
<h3>beanPropertiesReadOnly</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-740">beanPropertiesReadOnly</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;beanClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanPropertiesReadOnly(java.lang.Class,java.lang.String)">BeanContextable.Builder</a></code></span></div>
<div class="block">Read-only bean properties.
<p>
Specifies one or more properties on a bean that are read-only despite having valid getters.
Serializers will serialize such properties as usual, but parsers will silently ignore them.
Note that this is different from the <a href="../BeanContextable.Builder.html#beanProperties(java.lang.Class,java.lang.String)"><code>beanProperties</code></a>/<a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.lang.Class,java.lang.String)"><code>beanPropertiesExcludes</code></a> settings which include or exclude properties
for both serializers and parsers.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>foo</jf>, <jf>bar</jf>, <jf>baz</jf>;
}
<jc>// Create a serializer with read-only property settings.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanPropertiesReadOnly(MyBean.<jk>class</jk>, <js>"bar,baz"</js>)
.build();
<jc>// All 3 properties will be serialized.</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
<jc>// Create a parser with read-only property settings.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.beanPropertiesReadOnly(MyBean.<jk>class</jk>, <js>"bar,baz"</js>)
.ignoreUnknownBeanProperties()
.build();
<jc>// Parser ignores bar and baz properties.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'foo',bar:'bar',baz:'baz'}"</js>, MyBean.<jk>class</jk>);
</p>
<p>
This method is functionally equivalent to the following code:
<p class='bjava'>
<jv>builder</jv>.annotations(BeanAnnotation.<jsm>create</jsm>(<jv>beanClass</jv>).readOnlyProperties(<jv>properties</jv>).build());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jma'><a href="../annotation/Bean.html#readOnlyProperties()"><code>Bean.readOnlyProperties()</code></a> / <a href="../annotation/Bean.html#ro()"><code>Bean.ro()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanPropertiesReadOnly(java.lang.Class,java.lang.String)">beanPropertiesReadOnly</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>beanClass</code> - The bean class.</dd>
<dd><code>properties</code> - Comma-delimited list of property names.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanPropertiesReadOnly(java.lang.String,java.lang.String)">
<h3>beanPropertiesReadOnly</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-746">beanPropertiesReadOnly</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;beanClassName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanPropertiesReadOnly(java.lang.String,java.lang.String)">BeanContextable.Builder</a></code></span></div>
<div class="block">Read-only bean properties.
<p>
Specifies one or more properties on a bean that are read-only despite having valid getters.
Serializers will serialize such properties as usual, but parsers will silently ignore them.
Note that this is different from the <a href="../BeanContextable.Builder.html#beanProperties(java.lang.Class,java.lang.String)"><code>beanProperties</code></a>/<a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.lang.Class,java.lang.String)"><code>beanPropertiesExcludes</code></a> settings which include or exclude properties
for both serializers and parsers.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>foo</jf>, <jf>bar</jf>, <jf>baz</jf>;
}
<jc>// Create a serializer with read-only property settings.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanPropertiesReadOnly(<js>"MyBean"</js>, <js>"bar,baz"</js>)
.build();
<jc>// All 3 properties will be serialized.</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
<jc>// Create a parser with read-only property settings.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.beanPropertiesReadOnly(<js>"MyBean"</js>, <js>"bar,baz"</js>)
.ignoreUnknownBeanProperties()
.build();
<jc>// Parser ignores bar and baz properties.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'foo',bar:'bar',baz:'baz'}"</js>, MyBean.<jk>class</jk>);
</p>
<p>
This method is functionally equivalent to the following code:
<p class='bjava'>
<jv>builder</jv>.annotations(BeanAnnotation.<jsm>create</jsm>(<jv>beanClassName</jv>).readOnlyProperties(<jv>properties</jv>).build());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jma'><a href="../annotation/Bean.html#readOnlyProperties()"><code>Bean.readOnlyProperties()</code></a> / <a href="../annotation/Bean.html#ro()"><code>Bean.ro()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanPropertiesReadOnly(java.lang.String,java.lang.String)">beanPropertiesReadOnly</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>beanClassName</code> - The bean class name.
<br>Can be a simple name, fully-qualified name, or <js>"*"</js> for all bean classes.</dd>
<dd><code>properties</code> - Comma-delimited list of property names.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanPropertiesWriteOnly(java.util.Map)">
<h3>beanPropertiesWriteOnly</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-752">beanPropertiesWriteOnly</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&gt;&nbsp;values)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanPropertiesWriteOnly(java.util.Map)">BeanContextable.Builder</a></code></span></div>
<div class="block">Write-only bean properties.
<p>
Specifies one or more properties on a bean that are write-only despite having valid setters.
Parsers will parse such properties as usual, but serializers will silently ignore them.
Note that this is different from the <a href="../BeanContextable.Builder.html#beanProperties(java.lang.Class,java.lang.String)"><code>beanProperties</code></a>/<a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.lang.Class,java.lang.String)"><code>beanPropertiesExcludes</code></a> settings which include or exclude properties
for both serializers and parsers.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>foo</jf>, <jf>bar</jf>, <jf>baz</jf>;
}
<jc>// Create a serializer with write-only property settings.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanPropertiesWriteOnly(AMap.<jsm>of</jsm>(<js>"MyBean"</js>, <js>"bar,baz"</js>))
.build();
<jc>// Only foo will be serialized.</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
<jc>// Create a parser with write-only property settings.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.beanPropertiesWriteOnly(AMap.<jsm>of</jsm>(<js>"MyBean"</js>, <js>"bar,baz"</js>))
.build();
<jc>// Parser parses all 3 properties.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'foo',bar:'bar',baz:'baz'}"</js>, MyBean.<jk>class</jk>);
</p>
<p>
This method is functionally equivalent to the following code for each entry:
<p class='bjava'>
<jv>builder</jv>.annotations(BeanAnnotation.<jsm>create</jsm>(<jv>key</jv>).writeOnlyProperties(<jv>value</jv>.toString()).build());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jma'><a href="../annotation/Bean.html#writeOnlyProperties()"><code>Bean.writeOnlyProperties()</code></a> / <a href="../annotation/Bean.html#wo()"><code>Bean.wo()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanPropertiesWriteOnly(java.util.Map)">beanPropertiesWriteOnly</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>values</code> - The values to add to this builder.
<br>Keys are bean class names which can be a simple name, fully-qualified name, or <js>"*"</js> for all beans.
<br>Values are comma-delimited lists of property names. Non-String objects are first converted to Strings.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanPropertiesWriteOnly(java.lang.Class,java.lang.String)">
<h3>beanPropertiesWriteOnly</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-758">beanPropertiesWriteOnly</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;beanClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanPropertiesWriteOnly(java.lang.Class,java.lang.String)">BeanContextable.Builder</a></code></span></div>
<div class="block">Write-only bean properties.
<p>
Specifies one or more properties on a bean that are write-only despite having valid setters.
Parsers will parse such properties as usual, but serializers will silently ignore them.
Note that this is different from the <a href="../BeanContextable.Builder.html#beanProperties(java.lang.Class,java.lang.String)"><code>beanProperties</code></a>/<a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.lang.Class,java.lang.String)"><code>beanPropertiesExcludes</code></a> settings which include or exclude properties
for both serializers and parsers.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>foo</jf>, <jf>bar</jf>, <jf>baz</jf>;
}
<jc>// Create a serializer with write-only property settings.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanPropertiesWriteOnly(MyBean.<jk>class</jk>, <js>"bar,baz"</js>)
.build();
<jc>// Only foo will be serialized.</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
<jc>// Create a parser with write-only property settings.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.beanPropertiesWriteOnly(MyBean.<jk>class</jk>, <js>"bar,baz"</js>)
.build();
<jc>// Parser parses all 3 properties.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'foo',bar:'bar',baz:'baz'}"</js>, MyBean.<jk>class</jk>);
</p>
<p>
This method is functionally equivalent to the following code:
<p class='bjava'>
<jv>builder</jv>.annotations(BeanAnnotation.<jsm>create</jsm>(<jv>beanClass</jv>).writeOnlyProperties(<jv>properties</jv>).build());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jma'><a href="../annotation/Bean.html#writeOnlyProperties()"><code>Bean.writeOnlyProperties()</code></a> / <a href="../annotation/Bean.html#wo()"><code>Bean.wo()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanPropertiesWriteOnly(java.lang.Class,java.lang.String)">beanPropertiesWriteOnly</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>beanClass</code> - The bean class.</dd>
<dd><code>properties</code> - Comma-delimited list of property names.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beanPropertiesWriteOnly(java.lang.String,java.lang.String)">
<h3>beanPropertiesWriteOnly</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-764">beanPropertiesWriteOnly</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;beanClassName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;properties)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beanPropertiesWriteOnly(java.lang.String,java.lang.String)">BeanContextable.Builder</a></code></span></div>
<div class="block">Write-only bean properties.
<p>
Specifies one or more properties on a bean that are write-only despite having valid setters.
Parsers will parse such properties as usual, but serializers will silently ignore them.
Note that this is different from the <a href="../BeanContextable.Builder.html#beanProperties(java.lang.Class,java.lang.String)"><code>beanProperties</code></a>/<a href="../BeanContextable.Builder.html#beanPropertiesExcludes(java.lang.Class,java.lang.String)"><code>beanPropertiesExcludes</code></a> settings which include or exclude properties
for both serializers and parsers.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>foo</jf>, <jf>bar</jf>, <jf>baz</jf>;
}
<jc>// Create a serializer with write-only property settings.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beanPropertiesWriteOnly(<js>"MyBean"</js>, <js>"bar,baz"</js>)
.build();
<jc>// Only foo will be serialized.</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
<jc>// Create a parser with write-only property settings.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.beanPropertiesWriteOnly(<js>"MyBean"</js>, <js>"bar,baz"</js>)
.build();
<jc>// Parser parses all 3 properties.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'foo',bar:'bar',baz:'baz'}"</js>, MyBean.<jk>class</jk>);
</p>
<p>
This method is functionally equivalent to the following code:
<p class='bjava'>
<jv>builder</jv>.annotations(BeanAnnotation.<jsm>create</jsm>(<jv>beanClassName</jv>).writeOnlyProperties(<jv>properties</jv>).build());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jma'><a href="../annotation/Bean.html#writeOnlyProperties()"><code>Bean.writeOnlyProperties()</code></a> / <a href="../annotation/Bean.html#wo()"><code>Bean.wo()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beanPropertiesWriteOnly(java.lang.String,java.lang.String)">beanPropertiesWriteOnly</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>beanClassName</code> - The bean class name.
<br>Can be a simple name, fully-qualified name, or <js>"*"</js> for all bean classes.</dd>
<dd><code>properties</code> - Comma-delimited list of property names.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beansRequireDefaultConstructor()">
<h3>beansRequireDefaultConstructor</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-770">beansRequireDefaultConstructor</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beansRequireDefaultConstructor()">BeanContextable.Builder</a></code></span></div>
<div class="block">Beans require no-arg constructors.
<p>
When enabled, a Java class must implement a default no-arg constructor to be considered a bean.
Otherwise, the bean will be serialized as a string using the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link"><code>Object.toString()</code></a> method.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean without a no-arg constructor.</jc>
<jk>public class</jk> MyBean {
<jc>// A property method.</jc>
<jk>public</jk> String <jf>foo</jf> = <js>"bar"</js>;
<jc>// A no-arg constructor</jc>
<jk>public</jk> MyBean(String <jv>foo</jv>) {
<jk>this</jk>.<jf>foo</jf> = <jv>foo</jv>;
}
<ja>@Override</ja>
<jk>public</jk> String toString() {
<jk>return</jk> <js>"bar"</js>;
}
}
<jc>// Create a serializer that ignores beans without default constructors.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beansRequireDefaultConstructor()
.build();
<jc>// Produces: "bar"</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Bean.html" title="annotation in org.apache.juneau.annotation"><code>@Bean</code></a> annotation can be used on a bean class to override this setting.
<li class='note'>The <a href="../annotation/BeanIgnore.html" title="annotation in org.apache.juneau.annotation"><code>@BeanIgnore</code></a> annotation can also be used on a class to ignore it as a bean.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#beansRequireDefaultConstructor()"><code>BeanConfig.beansRequireDefaultConstructor()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#beansRequireDefaultConstructor()"><code>BeanContext.Builder.beansRequireDefaultConstructor()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beansRequireDefaultConstructor()">beansRequireDefaultConstructor</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beansRequireSerializable()">
<h3>beansRequireSerializable</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-776">beansRequireSerializable</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beansRequireSerializable()">BeanContextable.Builder</a></code></span></div>
<div class="block">Beans require Serializable interface.
<p>
When enabled, a Java class must implement the <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html" title="class or interface in java.io" class="external-link"><code>Serializable</code></a> interface to be considered a bean.
Otherwise, the bean will be serialized as a string using the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link"><code>Object.toString()</code></a> method.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean without a Serializable interface.</jc>
<jk>public class</jk> MyBean {
<jc>// A property method.</jc>
<jk>public</jk> String <jf>foo</jf> = <js>"bar"</js>;
<ja>@Override</ja>
<jk>public</jk> String toString() {
<jk>return</jk> <js>"bar"</js>;
}
}
<jc>// Create a serializer that ignores beans not implementing Serializable.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beansRequireSerializable()
.build();
<jc>// Produces: "bar"</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Bean.html" title="annotation in org.apache.juneau.annotation"><code>@Bean</code></a> annotation can be used on a bean class to override this setting.
<li class='note'>The <a href="../annotation/BeanIgnore.html" title="annotation in org.apache.juneau.annotation"><code>@BeanIgnore</code></a> annotation can also be used on a class to ignore it as a bean.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#beansRequireSerializable()"><code>BeanConfig.beansRequireSerializable()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#beansRequireSerializable()"><code>BeanContext.Builder.beansRequireSerializable()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beansRequireSerializable()">beansRequireSerializable</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="beansRequireSettersForGetters()">
<h3>beansRequireSettersForGetters</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-782">beansRequireSettersForGetters</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#beansRequireSettersForGetters()">BeanContextable.Builder</a></code></span></div>
<div class="block">Beans require setters for getters.
<p>
When enabled, ignore read-only properties (properties with getters but not setters).
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean without a Serializable interface.</jc>
<jk>public class</jk> MyBean {
<jc>// A read/write property.</jc>
<jk>public</jk> String getFoo() { <jk>return</jk> <js>"foo"</js>; }
<jk>public void</jk> setFoo(String <jv>foo</jv>) { ... }
<jc>// A read-only property.</jc>
<jk>public</jk> String getBar() { <jk>return</jk> <js>"bar"</js>; }
}
<jc>// Create a serializer that ignores bean properties without setters.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.beansRequireSettersForGetters()
.build();
<jc>// Produces: {"foo":"foo"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Beanp.html" title="annotation in org.apache.juneau.annotation"><code>@Beanp</code></a> annotation can be used on the getter to override this setting.
<li class='note'>The <a href="../annotation/BeanIgnore.html" title="annotation in org.apache.juneau.annotation"><code>@BeanIgnore</code></a> annotation can also be used on getters to ignore them as bean properties.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#beansRequireSettersForGetters()"><code>BeanConfig.beansRequireSettersForGetters()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#beansRequireSettersForGetters()"><code>BeanContext.Builder.beansRequireSettersForGetters()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#beansRequireSettersForGetters()">beansRequireSettersForGetters</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="dictionaryOn(java.lang.Class,java.lang.Class...)">
<h3>dictionaryOn</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-788">dictionaryOn</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;values)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#dictionaryOn(java.lang.Class,java.lang.Class...)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean dictionary.
<p>
This is identical to <a href="../BeanContextable.Builder.html#beanDictionary(java.lang.Class...)"><code>BeanContextable.Builder.beanDictionary(Class...)</code></a>, but specifies a dictionary within the context of
a single class as opposed to globally.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// POJOs with @Bean(name) annotations.</jc>
<ja>@Bean</ja>(typeName=<js>"foo"</js>)
<jk>public class</jk> Foo {...}
<ja>@Bean</ja>(typeName=<js>"bar"</js>)
<jk>public class</jk> Bar {...}
<jc>// A bean with a field with an indeterminate type.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> Object <jf>mySimpleField</jf>;
}
<jc>// Create a parser and tell it which classes to try to resolve.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.dictionaryOn(MyBean.<jk>class</jk>, Foo.<jk>class</jk>, Bar.<jk>class</jk>)
.build();
<jc>// Parse bean.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{mySimpleField:{_type:'foo',...}}"</js>, MyBean.<jk>class</jk>);
</p>
<p>
This is functionally equivalent to the <a href="../annotation/Bean.html#dictionary()"><code>Bean.dictionary()</code></a> annotation.
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/Bean.html#dictionary()"><code>Bean.dictionary()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#beanDictionary(java.lang.Class...)"><code>BeanContext.Builder.beanDictionary(Class...)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#dictionaryOn(java.lang.Class,java.lang.Class...)">dictionaryOn</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>on</code> - The class that the dictionary values apply to.</dd>
<dd><code>values</code> - The new values for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="disableBeansRequireSomeProperties()">
<h3>disableBeansRequireSomeProperties</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-794">disableBeansRequireSomeProperties</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#disableBeansRequireSomeProperties()">BeanContextable.Builder</a></code></span></div>
<div class="block">Beans don't require at least one property.
<p>
When enabled, then a Java class doesn't need to contain at least 1 property to be considered a bean.
Otherwise, the bean will be serialized as a string using the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link"><code>Object.toString()</code></a> method.
<p>
The <a href="../annotation/Bean.html" title="annotation in org.apache.juneau.annotation"><code>@Bean</code></a> annotation can be used on a class to override this setting when <jk>true</jk>.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with no properties.</jc>
<jk>public class</jk> MyBean {
}
<jc>// Create a serializer that serializes beans even if they have zero properties.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.disableBeansRequireSomeProperties()
.build();
<jc>// Produces: {}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Bean.html" title="annotation in org.apache.juneau.annotation"><code>@Bean</code></a> annotation can be used on the class to force it to be recognized as a bean class
even if it has no properties.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#disableBeansRequireSomeProperties()"><code>BeanConfig.disableBeansRequireSomeProperties()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#disableBeansRequireSomeProperties()"><code>BeanContext.Builder.disableBeansRequireSomeProperties()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#disableBeansRequireSomeProperties()">disableBeansRequireSomeProperties</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="disableIgnoreMissingSetters()">
<h3>disableIgnoreMissingSetters</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-800">disableIgnoreMissingSetters</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#disableIgnoreMissingSetters()">BeanContextable.Builder</a></code></span></div>
<div class="block">Don't silently ignore missing setters.
<p>
When enabled, trying to set a value on a bean property without a setter will throw a <a href="../BeanRuntimeException.html" title="class in org.apache.juneau"><code>BeanRuntimeException</code></a>.
Otherwise, it will be silently ignored.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a property with a getter but not a setter.</jc>
<jk>public class</jk> MyBean {
<jk>public void</jk> getFoo() {
<jk>return</jk> <js>"foo"</js>;
}
}
<jc>// Create a parser that throws an exception if a setter is not found but a getter is.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.disableIgnoreMissingSetters()
.build();
<jc>// Throws a ParseException.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'bar'}"</js>, MyBean.<jk>class</jk>);
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/BeanIgnore.html" title="annotation in org.apache.juneau.annotation"><code>@BeanIgnore</code></a> annotation can also be used on getters and fields to ignore them.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#disableIgnoreMissingSetters()"><code>BeanConfig.disableIgnoreMissingSetters()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#disableIgnoreMissingSetters()"><code>BeanContext.Builder.disableIgnoreMissingSetters()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#disableIgnoreMissingSetters()">disableIgnoreMissingSetters</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="disableIgnoreTransientFields()">
<h3>disableIgnoreTransientFields</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-806">disableIgnoreTransientFields</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#disableIgnoreTransientFields()">BeanContextable.Builder</a></code></span></div>
<div class="block">Don't ignore transient fields.
<p>
When enabled, methods and fields marked as <jk>transient</jk> will not be ignored as bean properties.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a transient field.</jc>
<jk>public class</jk> MyBean {
<jk>public transient</jk> String <jf>foo</jf> = <js>"foo"</js>;
}
<jc>// Create a serializer that doesn't ignore transient fields.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.disableIgnoreTransientFields()
.build();
<jc>// Produces: {"foo":"foo"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Beanp.html" title="annotation in org.apache.juneau.annotation"><code>@Beanp</code></a> annotation can also be used on transient fields to keep them from being ignored.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#disableIgnoreTransientFields()"><code>BeanConfig.disableIgnoreTransientFields()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#disableIgnoreTransientFields()"><code>BeanContext.Builder.disableIgnoreTransientFields()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#disableIgnoreTransientFields()">disableIgnoreTransientFields</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="disableIgnoreUnknownNullBeanProperties()">
<h3>disableIgnoreUnknownNullBeanProperties</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-812">disableIgnoreUnknownNullBeanProperties</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#disableIgnoreUnknownNullBeanProperties()">BeanContextable.Builder</a></code></span></div>
<div class="block">Don't ignore unknown properties with null values.
<p>
When enabled, trying to set a <jk>null</jk> value on a non-existent bean property will throw a <a href="../BeanRuntimeException.html" title="class in org.apache.juneau"><code>BeanRuntimeException</code></a>.
Otherwise it will be silently ignored.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a single property.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>foo</jf>;
}
<jc>// Create a parser that throws an exception on an unknown property even if the value being set is null.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.disableIgnoreUnknownNullBeanProperties()
.build();
<jc>// Throws a BeanRuntimeException wrapped in a ParseException on the unknown 'bar' property.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'foo',bar:null}"</js>, MyBean.<jk>class</jk>);
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#disableIgnoreUnknownNullBeanProperties()"><code>BeanConfig.disableIgnoreUnknownNullBeanProperties()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#disableIgnoreUnknownNullBeanProperties()"><code>BeanContext.Builder.disableIgnoreUnknownNullBeanProperties()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#disableIgnoreUnknownNullBeanProperties()">disableIgnoreUnknownNullBeanProperties</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="disableInterfaceProxies()">
<h3>disableInterfaceProxies</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-818">disableInterfaceProxies</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#disableInterfaceProxies()">BeanContextable.Builder</a></code></span></div>
<div class="block">Don't use interface proxies.
<p>
When enabled, interfaces will be instantiated as proxy classes through the use of an
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationHandler.html" title="class or interface in java.lang.reflect" class="external-link"><code>InvocationHandler</code></a> if there is no other way of instantiating them.
Otherwise, throws a <a href="../BeanRuntimeException.html" title="class in org.apache.juneau"><code>BeanRuntimeException</code></a>.
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#disableInterfaceProxies()"><code>BeanConfig.disableInterfaceProxies()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#disableInterfaceProxies()"><code>BeanContext.Builder.disableInterfaceProxies()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#disableInterfaceProxies()">disableInterfaceProxies</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="example(java.lang.Class,T)">
<h3 id="example(java.lang.Class,java.lang.Object)">example</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;T&gt;</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-824">example</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;T&gt;&nbsp;pojoClass,
T&nbsp;o)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#example(java.lang.Class,T)">BeanContextable.Builder</a></code></span></div>
<div class="block">POJO example.
<p>
Specifies an example of the specified class.
<p>
Examples are used in cases such as POJO examples in Swagger documents.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a serializer that excludes the 'foo' and 'bar' properties on the MyBean class.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.example(MyBean.<jk>class</jk>, <jk>new</jk> MyBean().setFoo(<js>"foo"</js>).setBar(123))
.build();
</p>
<p>
This is a shorthand method for the following code:
<p class='bjava'>
<jv>builder</jv>.annotations(MarshalledAnnotation.<jsm>create</jsm>(<jv>pojoClass</jv>).example(Json5.<jsf>DEFAULT</jsf>.toString(<jv>object</jv>)).build())
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>Using this method assumes the serialized form of the object is the same as that produced
by the default serializer. This may not be true based on settings or swaps on the constructed serializer.
</ul>
<p>
POJO examples can also be defined on classes via the following:
<ul class='spaced-list'>
<li>The <a href="../annotation/Marshalled.html#example()"><code>Marshalled.example()</code></a> annotation on the class itself.
<li>A static field annotated with <a href="../annotation/Example.html" title="annotation in org.apache.juneau.annotation"><code>@Example</code></a>.
<li>A static method annotated with <a href="../annotation/Example.html" title="annotation in org.apache.juneau.annotation"><code>@Example</code></a> with zero arguments or one <a href="../BeanSession.html" title="class in org.apache.juneau"><code>BeanSession</code></a> argument.
<li>A static method with name <c>example</c> with no arguments or one <a href="../BeanSession.html" title="class in org.apache.juneau"><code>BeanSession</code></a> argument.
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#example(java.lang.Class,T)">example</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Type Parameters:</dt>
<dd><code>T</code> - The POJO class.</dd>
<dt>Parameters:</dt>
<dd><code>pojoClass</code> - The POJO class.</dd>
<dd><code>o</code> - An instance of the POJO class used for examples.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="example(java.lang.Class,java.lang.String)">
<h3>example</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;T&gt;</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-830">example</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;T&gt;&nbsp;pojoClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;json)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#example(java.lang.Class,java.lang.String)">BeanContextable.Builder</a></code></span></div>
<div class="block">POJO example.
<p>
Specifies an example in JSON of the specified class.
<p>
Examples are used in cases such as POJO examples in Swagger documents.
<p>
Setting applies to specified class and all subclasses.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a serializer that excludes the 'foo' and 'bar' properties on the MyBean class.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.example(MyBean.<jk>class</jk>, <js>"{foo:'bar'}"</js>)
.build();
</p>
<p>
This is a shorthand method for the following code:
<p class='bjava'>
<jv>builder</jv>.annotations(MarshalledAnnotation.<jsm>create</jsm>(<jv>pojoClass</jv>).example(<jv>json</jv>).build())
</p>
<p>
POJO examples can also be defined on classes via the following:
<ul class='spaced-list'>
<li>A static field annotated with <a href="../annotation/Example.html" title="annotation in org.apache.juneau.annotation"><code>@Example</code></a>.
<li>A static method annotated with <a href="../annotation/Example.html" title="annotation in org.apache.juneau.annotation"><code>@Example</code></a> with zero arguments or one <a href="../BeanSession.html" title="class in org.apache.juneau"><code>BeanSession</code></a> argument.
<li>A static method with name <c>example</c> with no arguments or one <a href="../BeanSession.html" title="class in org.apache.juneau"><code>BeanSession</code></a> argument.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/Marshalled.html#example()"><code>Marshalled.example()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#example(java.lang.Class,java.lang.String)">example</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Type Parameters:</dt>
<dd><code>T</code> - The POJO class type.</dd>
<dt>Parameters:</dt>
<dd><code>pojoClass</code> - The POJO class.</dd>
<dd><code>json</code> - The JSON 5 representation of the example.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="findFluentSetters()">
<h3>findFluentSetters</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-836">findFluentSetters</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#findFluentSetters()">BeanContextable.Builder</a></code></span></div>
<div class="block">Find fluent setters.
<p>
When enabled, fluent setters are detected on beans during parsing.
<p>
Fluent setters must have the following attributes:
<ul>
<li>Public.
<li>Not static.
<li>Take in one parameter.
<li>Return the bean itself.
</ul>
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a fluent setter.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> MyBean foo(String <jv>value</jv>) {...}
}
<jc>// Create a parser that finds fluent setters.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.findFluentSetters()
.build();
<jc>// Parse into bean using fluent setter.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'bar'}"</js>, MyBean.<jk>class</jk>);
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Beanp.html" title="annotation in org.apache.juneau.annotation"><code>@Beanp</code></a> annotation can also be used on methods to individually identify them as fluent setters.
<li class='note'>The <a href="../annotation/Bean.html#findFluentSetters()"><code>@Bean.fluentSetters()</code></a> annotation can also be used on classes to specify to look for fluent setters.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/Bean.html#findFluentSetters()"><code>Bean.findFluentSetters()</code></a>
<li class='ja'><a href="../annotation/BeanConfig.html#findFluentSetters()"><code>BeanConfig.findFluentSetters()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#findFluentSetters()"><code>BeanContext.Builder.findFluentSetters()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#findFluentSetters()">findFluentSetters</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="findFluentSetters(java.lang.Class)">
<h3>findFluentSetters</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-842">findFluentSetters</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#findFluentSetters(java.lang.Class)">BeanContextable.Builder</a></code></span></div>
<div class="block">Find fluent setters.
<p>
Identical to <a href="../BeanContextable.Builder.html#findFluentSetters()"><code>BeanContextable.Builder.findFluentSetters()</code></a> but enables it on a specific class only.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a fluent setter.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> MyBean foo(String <jv>value</jv>) {...}
}
<jc>// Create a parser that finds fluent setters.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.findFluentSetters(MyBean.<jk>class</jk>)
.build();
<jc>// Parse into bean using fluent setter.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'bar'}"</js>, MyBean.<jk>class</jk>);
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>This method is functionally equivalent to using the <a href="../annotation/Bean.html#findFluentSetters()"><code>Bean.findFluentSetters()</code></a> annotation.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/Bean.html#findFluentSetters()"><code>Bean.findFluentSetters()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#findFluentSetters()"><code>BeanContext.Builder.findFluentSetters()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#findFluentSetters(java.lang.Class)">findFluentSetters</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>on</code> - The class that this applies to.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="ignoreInvocationExceptionsOnGetters()">
<h3>ignoreInvocationExceptionsOnGetters</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-848">ignoreInvocationExceptionsOnGetters</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#ignoreInvocationExceptionsOnGetters()">BeanContextable.Builder</a></code></span></div>
<div class="block">Ignore invocation errors on getters.
<p>
When enabled, errors thrown when calling bean getter methods will silently be ignored.
Otherwise, a <code>BeanRuntimeException</code> is thrown.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a property that throws an exception.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String getFoo() {
<jk>throw new</jk> RuntimeException(<js>"foo"</js>);
}
}
<jc>// Create a serializer that ignores bean getter exceptions.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.ingoreInvocationExceptionsOnGetters()
.build();
<jc>// Exception is ignored.</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#ignoreInvocationExceptionsOnGetters()"><code>BeanConfig.ignoreInvocationExceptionsOnGetters()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#ignoreInvocationExceptionsOnGetters()"><code>BeanContext.Builder.ignoreInvocationExceptionsOnGetters()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#ignoreInvocationExceptionsOnGetters()">ignoreInvocationExceptionsOnGetters</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="ignoreInvocationExceptionsOnSetters()">
<h3>ignoreInvocationExceptionsOnSetters</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-854">ignoreInvocationExceptionsOnSetters</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#ignoreInvocationExceptionsOnSetters()">BeanContextable.Builder</a></code></span></div>
<div class="block">Ignore invocation errors on setters.
<p>
When enabled, errors thrown when calling bean setter methods will silently be ignored.
Otherwise, a <code>BeanRuntimeException</code> is thrown.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a property that throws an exception.</jc>
<jk>public class</jk> MyBean {
<jk>public void</jk> setFoo(String <jv>foo</jv>) {
<jk>throw new</jk> RuntimeException(<js>"foo"</js>);
}
}
<jc>// Create a parser that ignores bean setter exceptions.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.ignoreInvocationExceptionsOnSetters()
.build();
<jc>// Exception is ignored.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'bar'}"</js>, MyBean.<jk>class</jk>);
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#ignoreInvocationExceptionsOnSetters()"><code>BeanConfig.ignoreInvocationExceptionsOnSetters()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#ignoreInvocationExceptionsOnSetters()"><code>BeanContext.Builder.ignoreInvocationExceptionsOnSetters()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#ignoreInvocationExceptionsOnSetters()">ignoreInvocationExceptionsOnSetters</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="ignoreUnknownBeanProperties()">
<h3>ignoreUnknownBeanProperties</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-860">ignoreUnknownBeanProperties</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#ignoreUnknownBeanProperties()">BeanContextable.Builder</a></code></span></div>
<div class="block">Ignore unknown properties.
<p>
When enabled, trying to set a value on a non-existent bean property will silently be ignored.
Otherwise, a <code>BeanRuntimeException</code> is thrown.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a single property.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>foo</jf>;
}
<jc>// Create a parser that ignores missing bean properties.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.ignoreUnknownBeanProperties()
.build();
<jc>// Doesn't throw an exception on unknown 'bar' property.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"{foo:'foo',bar:'bar'}"</js>, MyBean.<jk>class</jk>);
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#ignoreUnknownBeanProperties()"><code>BeanConfig.ignoreUnknownBeanProperties()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#ignoreUnknownBeanProperties()"><code>BeanContext.Builder.ignoreUnknownBeanProperties()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#ignoreUnknownBeanProperties()">ignoreUnknownBeanProperties</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="ignoreUnknownEnumValues()">
<h3>ignoreUnknownEnumValues</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-866">ignoreUnknownEnumValues</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#ignoreUnknownEnumValues()">BeanContextable.Builder</a></code></span></div>
<div class="block">Ignore unknown enum values.
<p>
When enabled, unknown enum values are set to <jk>null</jk> instead of throwing a parse exception.
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#ignoreUnknownEnumValues()"><code>BeanConfig.ignoreUnknownEnumValues()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#ignoreUnknownEnumValues()"><code>BeanContext.Builder.ignoreUnknownEnumValues()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#ignoreUnknownEnumValues()">ignoreUnknownEnumValues</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="implClass(java.lang.Class,java.lang.Class)">
<h3>implClass</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-872">implClass</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;interfaceClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;implClass)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#implClass(java.lang.Class,java.lang.Class)">BeanContextable.Builder</a></code></span></div>
<div class="block">Implementation classes.
<p>
For interfaces and abstract classes this method can be used to specify an implementation class for the
interface/abstract class so that instances of the implementation class are used when instantiated (e.g. during a
parse).
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean interface.</jc>
<jk>public interface</jk> MyBean {
...
}
<jc>// A bean implementation.</jc>
<jk>public class</jk> MyBeanImpl <jk>implements</jk> MyBean {
...
}
<jc>// Create a parser that instantiates MyBeanImpls when parsing MyBeans.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.implClass(MyBean.<jk>class</jk>, MyBeanImpl.<jk>class</jk>)
.build();
<jc>// Instantiates a MyBeanImpl,</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"..."</js>, MyBean.<jk>class</jk>);
</p></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#implClass(java.lang.Class,java.lang.Class)">implClass</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>interfaceClass</code> - The interface class.</dd>
<dd><code>implClass</code> - The implementation class.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="implClasses(java.util.Map)">
<h3>implClasses</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-878">implClasses</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&gt;&nbsp;values)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#implClasses(java.util.Map)">BeanContextable.Builder</a></code></span></div>
<div class="block">Implementation classes.
<p>
For interfaces and abstract classes this method can be used to specify an implementation class for the
interface/abstract class so that instances of the implementation class are used when instantiated (e.g. during a
parse).
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a single property.</jc>
<jk>public interface</jk> MyBean {
...
}
<jc>// A bean with a single property.</jc>
<jk>public class</jk> MyBeanImpl <jk>implements</jk> MyBean {
...
}
<jc>// Create a parser that instantiates MyBeanImpls when parsing MyBeans.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.implClasses(AMap.<jsm>of</jsm>(MyBean.<jk>class</jk>, MyBeanImpl.<jk>class</jk>))
.build();
<jc>// Instantiates a MyBeanImpl,</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<js>"..."</js>, MyBean.<jk>class</jk>);
</p></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#implClasses(java.util.Map)">implClasses</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>values</code> - The new value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="interfaceClass(java.lang.Class,java.lang.Class)">
<h3>interfaceClass</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-884">interfaceClass</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#interfaceClass(java.lang.Class,java.lang.Class)">BeanContextable.Builder</a></code></span></div>
<div class="block">Identifies a class to be used as the interface class for the specified class and all subclasses.
<p>
When specified, only the list of properties defined on the interface class will be used during serialization.
Additional properties on subclasses will be ignored.
<p class='bjava'>
<jc>// Parent class or interface</jc>
<jk>public abstract class</jk> A {
<jk>public</jk> String <jf>foo</jf> = <js>"foo"</js>;
}
<jc>// Sub class</jc>
<jk>public class</jk> A1 <jk>extends</jk> A {
<jk>public</jk> String <jf>bar</jf> = <js>"bar"</js>;
}
<jc>// Create a serializer and define our interface class mapping.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.interfaceClass(A1.<jk>class</jk>, A.<jk>class</jk>)
.build();
<jc>// Produces "{"foo":"foo"}"</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> A1());
</p>
<p>
This annotation can be used on the parent class so that it filters to all child classes, or can be set
individually on the child classes.
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Bean.html#interfaceClass()"><code>@Bean(interfaceClass)</code></a> annotation is the equivalent annotation-based solution.
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#interfaceClass(java.lang.Class,java.lang.Class)">interfaceClass</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>on</code> - The class that the interface class applies to.</dd>
<dd><code>value</code> - The new value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="interfaces(java.lang.Class...)">
<h3>interfaces</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-890">interfaces</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#interfaces(java.lang.Class...)">BeanContextable.Builder</a></code></span></div>
<div class="block">Identifies a set of interfaces.
<p>
When specified, only the list of properties defined on the interface class will be used during serialization
of implementation classes. Additional properties on subclasses will be ignored.
<p class='bjava'>
<jc>// Parent class or interface</jc>
<jk>public abstract class</jk> A {
<jk>public</jk> String <jf>foo</jf> = <js>"foo"</js>;
}
<jc>// Sub class</jc>
<jk>public class</jk> A1 <jk>extends</jk> A {
<jk>public</jk> String <jf>bar</jf> = <js>"bar"</js>;
}
<jc>// Create a serializer and define our interface class mapping.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.interfaces(A.<jk>class</jk>)
.build();
<jc>// Produces "{"foo":"foo"}"</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> A1());
</p>
<p>
This annotation can be used on the parent class so that it filters to all child classes, or can be set
individually on the child classes.
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Bean.html#interfaceClass()"><code>@Bean(interfaceClass)</code></a> annotation is the equivalent annotation-based solution.
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#interfaces(java.lang.Class...)">interfaces</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="locale(java.util.Locale)">
<h3>locale</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-896">locale</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html" title="class or interface in java.util" class="external-link">Locale</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#locale(java.util.Locale)">BeanContextable.Builder</a></code></span></div>
<div class="block"><i><l>Context</l> configuration property:&emsp;</i> Locale.
<p>
Specifies the default locale for serializer and parser sessions when not specified via <a href="../BeanSession.Builder.html#locale(java.util.Locale)"><code>BeanSession.Builder.locale(Locale)</code></a>.
Typically used for POJO swaps that need to deal with locales such as swaps that convert <l>Date</l> and <l>Calendar</l>
objects to strings by accessing it via the session passed into the <a href="../swap/ObjectSwap.html#swap(org.apache.juneau.BeanSession,T)"><code>ObjectSwap.swap(BeanSession, Object)</code></a> and
<a href="../swap/ObjectSwap.html#unswap(org.apache.juneau.BeanSession,S,org.apache.juneau.ClassMeta,java.lang.String)"><code>ObjectSwap.unswap(BeanSession, Object, ClassMeta, String)</code></a> methods.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Define a POJO swap that skips serializing beans if we're in the UK.</jc>
<jk>public class</jk> MyBeanSwap <jk>extends</jk> StringSwap&lt;MyBean&gt; {
<ja>@Override</ja>
<jk>public</jk> String swap(BeanSession <jv>session</jv>, MyBean <jv>bean</jv>) <jk>throws</jk> Exception {
<jk>if</jk> (<jv>session</jv>.getLocale().equals(Locale.<jsf>UK</jsf>))
<jk>return null</jk>;
<jk>return</jk> <jv>bean</jv>.toString();
}
}
<jc>// Create a serializer that uses the specified locale if it's not passed in through session args.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.locale(Locale.<jsf>UK</jsf>)
.swaps(MyBeanSwap.<jk>class</jk>)
.build();
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#locale()"><code>BeanConfig.locale()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#locale(java.util.Locale)"><code>BeanContext.Builder.locale(Locale)</code></a>
<li class='jm'><a href="../BeanSession.Builder.html#locale(java.util.Locale)"><code>BeanSession.Builder.locale(Locale)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#locale(java.util.Locale)">locale</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this property.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="mediaType(org.apache.juneau.MediaType)">
<h3>mediaType</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-902">mediaType</a></span><wbr><span class="parameters">(<a href="../MediaType.html" title="class in org.apache.juneau">MediaType</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#mediaType(org.apache.juneau.MediaType)">BeanContextable.Builder</a></code></span></div>
<div class="block"><i><l>Context</l> configuration property:&emsp;</i> Media type.
<p>
Specifies the default media type for serializer and parser sessions when not specified via <a href="../BeanSession.Builder.html#mediaType(org.apache.juneau.MediaType)"><code>BeanSession.Builder.mediaType(MediaType)</code></a>.
Typically used for POJO swaps that need to serialize the same POJO classes differently depending on
the specific requested media type. For example, a swap could handle a request for media types <js>"application/json"</js>
and <js>"application/json+foo"</js> slightly differently even though they're both being handled by the same JSON
serializer or parser.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Define a POJO swap that skips serializing beans if the media type is application/json.</jc>
<jk>public class</jk> MyBeanSwap <jk>extends</jk> StringSwap&lt;MyBean&gt; {
<ja>@Override</ja>
<jk>public</jk> String swap(BeanSession <jv>session</jv>, MyBean <jv>bean</jv>) <jk>throws</jk> Exception {
<jk>if</jk> (<jv>session</jv>.getMediaType().equals(<js>"application/json"</js>))
<jk>return null</jk>;
<jk>return</jk> <jv>bean</jv>.toString();
}
}
<jc>// Create a serializer that uses the specified media type if it's not passed in through session args.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.mediaType(MediaType.<jsf>JSON</jsf>)
.build();
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#mediaType()"><code>BeanConfig.mediaType()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#mediaType(org.apache.juneau.MediaType)"><code>BeanContext.Builder.mediaType(MediaType)</code></a>
<li class='jm'><a href="../BeanSession.Builder.html#mediaType(org.apache.juneau.MediaType)"><code>BeanSession.Builder.mediaType(MediaType)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#mediaType(org.apache.juneau.MediaType)">mediaType</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this property.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="notBeanClasses(java.lang.Class...)">
<h3>notBeanClasses</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-908">notBeanClasses</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;values)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#notBeanClasses(java.lang.Class...)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean class exclusions.
<p>
List of classes that should not be treated as beans even if they appear to be bean-like.
Not-bean classes are converted to <c>Strings</c> during serialization.
<p>
Values can consist of any of the following types:
<ul>
<li>Classes.
<li>Arrays and collections of classes.
</ul>
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a single property.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>foo</jf> = <js>"bar"</js>;
<jk>public</jk> String toString() {
<jk>return</jk> <js>"baz"</js>;
}
}
<jc>// Create a serializer that doesn't treat MyBean as a bean class.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.notBeanClasses(MyBean.<jk>class</jk>)
.build();
<jc>// Produces "baz" instead of {"foo":"bar"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/BeanIgnore.html" title="annotation in org.apache.juneau.annotation"><code>@BeanIgnore</code></a> annotation can also be used on classes to prevent them from being recognized as beans.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanIgnore.html" title="annotation in org.apache.juneau.annotation"><code>BeanIgnore</code></a>
<li class='ja'><a href="../annotation/BeanConfig.html#notBeanClasses()"><code>BeanConfig.notBeanClasses()</code></a>
<li class='jf'><a href="../BeanContext.Builder.html#notBeanClasses()"><code>BeanContext.Builder.notBeanClasses()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#notBeanClasses(java.lang.Class...)">notBeanClasses</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>values</code> - The values to add to this setting.
<br>Values can consist of any of the following types:
<ul>
<li>Classes.
<li>Arrays and collections of classes.
</ul></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="notBeanPackages(java.lang.String...)">
<h3>notBeanPackages</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-914">notBeanPackages</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>...&nbsp;values)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#notBeanPackages(java.lang.String...)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean package exclusions.
<p>
Used as a convenient way of defining the <a href="../BeanContext.Builder.html#notBeanClasses(java.lang.Class...)"><code>BeanContext.Builder.notBeanClasses(Class...)</code></a> property for entire packages.
Any classes within these packages will be serialized to strings using <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link"><code>Object.toString()</code></a>.
<p>
Note that you can specify suffix patterns to include all subpackages.
<p>
Values can consist of any of the following types:
<ul>
<li>Strings.
<li>Arrays and collections of strings.
</ul>
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a serializer that ignores beans in the specified packages.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.notBeanPackages(<js>"org.apache.foo"</js>, <js>"org.apache.bar.*"</js>)
.build();
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jm'><a href="../BeanContext.Builder.html#notBeanPackages(java.lang.String...)"><code>BeanContext.Builder.notBeanPackages(String...)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#notBeanPackages(java.lang.String...)">notBeanPackages</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>values</code> - The values to add to this setting.
<br>Values can consist of any of the following types:
<ul>
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Package.html" title="class or interface in java.lang" class="external-link"><code>Package</code></a> objects.
<li>Strings.
<li>Arrays and collections of anything in this list.
</ul></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="propertyNamer(java.lang.Class)">
<h3>propertyNamer</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-920">propertyNamer</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;? extends <a href="../PropertyNamer.html" title="interface in org.apache.juneau">PropertyNamer</a>&gt;&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#propertyNamer(java.lang.Class)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean property namer
<p>
The class to use for calculating bean property names.
<p>
Predefined classes:
<ul>
<li><a href="../BasicPropertyNamer.html" title="class in org.apache.juneau"><code>BasicPropertyNamer</code></a> - Default.
<li><a href="../PropertyNamerDLC.html" title="class in org.apache.juneau"><code>PropertyNamerDLC</code></a> - Dashed-lower-case names.
<li><a href="../PropertyNamerULC.html" title="class in org.apache.juneau"><code>PropertyNamerULC</code></a> - Dashed-upper-case names.
</ul>
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a single property.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>fooBarBaz</jf> = <js>"fooBarBaz"</js>;
}
<jc>// Create a serializer that uses Dashed-Lower-Case property names.</jc>
<jc>// (e.g. "foo-bar-baz" instead of "fooBarBaz")</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.propertyNamer(PropertyNamerDLC.<jk>class</jk>)
.build();
<jc>// Produces: {"foo-bar-baz":"fooBarBaz"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jm'><a href="../BeanContext.Builder.html#propertyNamer(java.lang.Class)"><code>BeanContext.Builder.propertyNamer(Class)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#propertyNamer(java.lang.Class)">propertyNamer</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this setting.
<br>The default is <a href="../BasicPropertyNamer.html" title="class in org.apache.juneau"><code>BasicPropertyNamer</code></a>.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="propertyNamer(java.lang.Class,java.lang.Class)">
<h3>propertyNamer</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-926">propertyNamer</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;? extends <a href="../PropertyNamer.html" title="interface in org.apache.juneau">PropertyNamer</a>&gt;&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#propertyNamer(java.lang.Class,java.lang.Class)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean property namer
<p>
Same as <a href="../BeanContextable.Builder.html#propertyNamer(java.lang.Class)"><code>BeanContextable.Builder.propertyNamer(Class)</code></a> but allows you to specify a namer for a specific class.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with a single property.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>fooBarBaz</jf> = <js>"fooBarBaz"</js>;
}
<jc>// Create a serializer that uses Dashed-Lower-Case property names for the MyBean class only.</jc>
<jc>// (e.g. "foo-bar-baz" instead of "fooBarBaz")</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.propertyNamer(MyBean.<jk>class</jk>, PropertyNamerDLC.<jk>class</jk>)
.build();
<jc>// Produces: {"foo-bar-baz":"fooBarBaz"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/Bean.html#propertyNamer()"><code>Bean(propertyNamer)</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#propertyNamer(java.lang.Class)"><code>BeanContext.Builder.propertyNamer(Class)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#propertyNamer(java.lang.Class,java.lang.Class)">propertyNamer</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>on</code> - The class that the namer applies to.</dd>
<dd><code>value</code> - The new value for this setting.
<br>The default is <a href="../BasicPropertyNamer.html" title="class in org.apache.juneau"><code>BasicPropertyNamer</code></a>.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="sortProperties()">
<h3>sortProperties</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-932">sortProperties</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#sortProperties()">BeanContextable.Builder</a></code></span></div>
<div class="block">Sort bean properties.
<p>
When enabled, all bean properties will be serialized and access in alphabetical order.
Otherwise, the natural order of the bean properties is used which is dependent on the JVM vendor.
On IBM JVMs, the bean properties are ordered based on their ordering in the Java file.
On Oracle JVMs, the bean properties are not ordered (which follows the official JVM specs).
<p>
this setting is disabled by default so that IBM JVM users don't have to use <a href="../annotation/Bean.html" title="annotation in org.apache.juneau.annotation"><code>@Bean</code></a> annotations
to force bean properties to be in a particular order and can just alter the order of the fields/methods
in the Java file.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>c</jf> = <js>"1"</js>;
<jk>public</jk> String <jf>b</jf> = <js>"2"</js>;
<jk>public</jk> String <jf>a</jf> = <js>"3"</js>;
}
<jc>// Create a serializer that sorts bean properties.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.sortProperties()
.build();
<jc>// Produces: {"a":"3","b":"2","c":"1"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Bean.html#sort()"><code>@Bean.sort()</code></a> annotation can also be used to sort properties on just a single class.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='jm'><a href="../BeanContext.Builder.html#sortProperties()"><code>BeanContext.Builder.sortProperties()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#sortProperties()">sortProperties</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="sortProperties(java.lang.Class...)">
<h3>sortProperties</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-938">sortProperties</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;on)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#sortProperties(java.lang.Class...)">BeanContextable.Builder</a></code></span></div>
<div class="block">Sort bean properties.
<p>
Same as <a href="../BeanContextable.Builder.html#sortProperties()"><code>BeanContextable.Builder.sortProperties()</code></a> but allows you to specify individual bean classes instead of globally.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// A bean with 3 properties.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> String <jf>c</jf> = <js>"1"</js>;
<jk>public</jk> String <jf>b</jf> = <js>"2"</js>;
<jk>public</jk> String <jf>a</jf> = <js>"3"</js>;
}
<jc>// Create a serializer that sorts properties on MyBean.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.sortProperties(MyBean.<jk>class</jk>)
.build();
<jc>// Produces: {"a":"3","b":"2","c":"1"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/Bean.html#sort()"><code>Bean(sort)</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#sortProperties()"><code>BeanContext.Builder.sortProperties()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#sortProperties(java.lang.Class...)">sortProperties</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>on</code> - The bean classes to sort properties on.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="stopClass(java.lang.Class,java.lang.Class)">
<h3>stopClass</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-944">stopClass</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#stopClass(java.lang.Class,java.lang.Class)">BeanContextable.Builder</a></code></span></div>
<div class="block">Identifies a stop class for the annotated class.
<p>
Identical in purpose to the stop class specified by <a href="https://docs.oracle.com/javase/8/docs/api/java/beans/Introspector.html#getBeanInfo(java.lang.Class,java.lang.Class)" title="class or interface in java.beans" class="external-link"><code>Introspector.getBeanInfo(Class, Class)</code></a>.
Any properties in the stop class or in its base classes will be ignored during analysis.
<p>
For example, in the following class hierarchy, instances of <c>C3</c> will include property <c>p3</c>,
but not <c>p1</c> or <c>p2</c>.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jk>public class</jk> C1 {
<jk>public int</jk> getP1();
}
<jk>public class</jk> C2 <jk>extends</jk> C1 {
<jk>public int</jk> getP2();
}
<jk>public class</jk> C3 <jk>extends</jk> C2 {
<jk>public int</jk> getP3();
}
<jc>// Create a serializer specifies a stop class for C3.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.stopClass(C3.<jk>class</jk>, C2.<jk>class</jk>)
.build();
<jc>// Produces: {"p3":"..."}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> C3());
</p></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#stopClass(java.lang.Class,java.lang.Class)">stopClass</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>on</code> - The class on which the stop class is being applied.</dd>
<dd><code>value</code> - The new value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="swap(java.lang.Class,java.lang.Class,org.apache.juneau.utils.ThrowingFunction)">
<h3>swap</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;T,<wbr>
S&gt;</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-950">swap</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;T&gt;&nbsp;normalClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;S&gt;&nbsp;swappedClass,
<a href="../utils/ThrowingFunction.html" title="interface in org.apache.juneau.utils">ThrowingFunction</a>&lt;T,<wbr>S&gt;&nbsp;swapFunction)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#swap(java.lang.Class,java.lang.Class,org.apache.juneau.utils.ThrowingFunction)">BeanContextable.Builder</a></code></span></div>
<div class="block">A shortcut for defining a <a href="../swap/FunctionalSwap.html" title="class in org.apache.juneau.swap"><code>FunctionalSwap</code></a>.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a serializer that performs a custom format for Date objects.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.swap(Date.<jk>class</jk>, String.<jk>class</jk>, <jv>x</jv> -&gt; <jsm>format</jsm>(<jv>x</jv>))
.build();
</p></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#swap(java.lang.Class,java.lang.Class,org.apache.juneau.utils.ThrowingFunction)">swap</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Type Parameters:</dt>
<dd><code>T</code> - The object type being swapped out.</dd>
<dd><code>S</code> - The object type being swapped in.</dd>
<dt>Parameters:</dt>
<dd><code>normalClass</code> - The object type being swapped out.</dd>
<dd><code>swappedClass</code> - The object type being swapped in.</dd>
<dd><code>swapFunction</code> - The function to convert the object.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="swap(java.lang.Class,java.lang.Class,org.apache.juneau.utils.ThrowingFunction,org.apache.juneau.utils.ThrowingFunction)">
<h3>swap</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;T,<wbr>
S&gt;</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-956">swap</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;T&gt;&nbsp;normalClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;S&gt;&nbsp;swappedClass,
<a href="../utils/ThrowingFunction.html" title="interface in org.apache.juneau.utils">ThrowingFunction</a>&lt;T,<wbr>S&gt;&nbsp;swapFunction,
<a href="../utils/ThrowingFunction.html" title="interface in org.apache.juneau.utils">ThrowingFunction</a>&lt;S,<wbr>T&gt;&nbsp;unswapFunction)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#swap(java.lang.Class,java.lang.Class,org.apache.juneau.utils.ThrowingFunction,org.apache.juneau.utils.ThrowingFunction)">BeanContextable.Builder</a></code></span></div>
<div class="block">A shortcut for defining a <a href="../swap/FunctionalSwap.html" title="class in org.apache.juneau.swap"><code>FunctionalSwap</code></a>.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a serializer that performs a custom format for Date objects.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.swap(Date.<jk>class</jk>, String.<jk>class</jk>, <jv>x</jv> -&gt; <jsm>format</jsm>(<jv>x</jv>), <jv>x</jv> -&gt; <jsm>parse</jsm>(<jv>x</jv>))
.build();
</p></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#swap(java.lang.Class,java.lang.Class,org.apache.juneau.utils.ThrowingFunction,org.apache.juneau.utils.ThrowingFunction)">swap</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Type Parameters:</dt>
<dd><code>T</code> - The object type being swapped out.</dd>
<dd><code>S</code> - The object type being swapped in.</dd>
<dt>Parameters:</dt>
<dd><code>normalClass</code> - The object type being swapped out.</dd>
<dd><code>swappedClass</code> - The object type being swapped in.</dd>
<dd><code>swapFunction</code> - The function to convert the object during serialization.</dd>
<dd><code>unswapFunction</code> - The function to convert the object during parsing.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="swaps(java.lang.Class...)">
<h3>swaps</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-962">swaps</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;...&nbsp;values)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#swaps(java.lang.Class...)">BeanContextable.Builder</a></code></span></div>
<div class="block">Java object swaps.
<p>
Swaps are used to "swap out" non-serializable classes with serializable equivalents during serialization,
and "swap in" the non-serializable class during parsing.
<p>
An example of a swap would be a <c>Calendar</c> object that gets swapped out for an ISO8601 string.
<p>
Multiple swaps can be associated with a single class.
When multiple swaps are applicable to the same class, the media type pattern defined by
<a href="../swap/ObjectSwap.html#forMediaTypes()"><code>ObjectSwap.forMediaTypes()</code></a> or <a href="../annotation/Swap.html#mediaTypes()"><code>@Swap(mediaTypes)</code></a> are used to come up with the best match.
<p>
Values can consist of any of the following types:
<ul>
<li>Any subclass of <a href="../swap/ObjectSwap.html" title="class in org.apache.juneau.swap"><code>ObjectSwap</code></a>.
<li>Any instance of <a href="../swap/ObjectSwap.html" title="class in org.apache.juneau.swap"><code>ObjectSwap</code></a>.
<li>Any surrogate class. A shortcut for defining a <a href="../swap/SurrogateSwap.html" title="class in org.apache.juneau.swap"><code>SurrogateSwap</code></a>.
<li>Any array or collection of the objects above.
</ul>
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Sample swap for converting Dates to ISO8601 strings.</jc>
<jk>public class</jk> MyDateSwap <jk>extends</jk> StringSwap&lt;Date&gt; {
<jc>// ISO8601 formatter.</jc>
<jk>private</jk> DateFormat <jf>format</jf> = <jk>new</jk> SimpleDateFormat(<js>"yyyy-MM-dd'T'HH:mm:ssZ"</js>);
<ja>@Override</ja>
<jk>public</jk> String swap(BeanSession <jv>session</jv>, Date <jv>date</jv>) {
<jk>return</jk> <jf>format</jf>.format(<jv>date</jv>);
}
<ja>@Override</ja>
<jk>public</jk> Date unswap(BeanSession <jv>session</jv>, String <jv>string</jv>, ClassMeta <jv>hint</jv>) <jk>throws</jk> Exception {
<jk>return</jk> <jf>format</jf>.parse(<jv>string</jv>);
}
}
<jc>// Sample bean with a Date field.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> Date <jf>date</jf> = <jk>new</jk> Date(112, 2, 3, 4, 5, 6);
}
<jc>// Create a serializer that uses our date swap.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.swaps(MyDateSwap.<jk>class</jk>)
.build();
<jc>// Produces: {"date":"2012-03-03T04:05:06-0500"}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
<jc>// Create a serializer that uses our date swap.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.swaps(MyDateSwap.<jk>class</jk>)
.build();
<jc>// Use our parser to parse a bean.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<jv>json</jv>, MyBean.<jk>class</jk>);
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>The <a href="../annotation/Swap.html" title="annotation in org.apache.juneau.annotation"><code>@Swap</code></a> annotation can also be used on classes to identify swaps for the class.
<li class='note'>The <a href="../annotation/Swap.html" title="annotation in org.apache.juneau.annotation"><code>@Swap</code></a> annotation can also be used on bean methods and fields to identify swaps for values of those bean properties.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='jf'><a href="../BeanContext.Builder.html#swaps(java.lang.Class...)"><code>BeanContext.Builder.swaps(Class...)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#swaps(java.lang.Class...)">swaps</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>values</code> - The values to add to this setting.
<br>Values can consist of any of the following types:
<ul>
<li>Any subclass of <a href="../swap/ObjectSwap.html" title="class in org.apache.juneau.swap"><code>ObjectSwap</code></a>.
<li>Any surrogate class. A shortcut for defining a <a href="../swap/SurrogateSwap.html" title="class in org.apache.juneau.swap"><code>SurrogateSwap</code></a>.
<li>Any array or collection of the objects above.
</ul></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="timeZone(java.util.TimeZone)">
<h3>timeZone</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-968">timeZone</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html" title="class or interface in java.util" class="external-link">TimeZone</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#timeZone(java.util.TimeZone)">BeanContextable.Builder</a></code></span></div>
<div class="block"><i><l>Context</l> configuration property:&emsp;</i> TimeZone.
<p>
Specifies the default time zone for serializer and parser sessions when not specified via <a href="../BeanSession.Builder.html#timeZone(java.util.TimeZone)"><code>BeanSession.Builder.timeZone(TimeZone)</code></a>.
Typically used for POJO swaps that need to deal with timezones such as swaps that convert <l>Date</l> and <l>Calendar</l>
objects to strings by accessing it via the session passed into the <a href="../swap/ObjectSwap.html#swap(org.apache.juneau.BeanSession,T)"><code>ObjectSwap.swap(BeanSession, Object)</code></a> and
<a href="../swap/ObjectSwap.html#unswap(org.apache.juneau.BeanSession,S,org.apache.juneau.ClassMeta,java.lang.String)"><code>ObjectSwap.unswap(BeanSession, Object, ClassMeta, String)</code></a> methods.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Define a POJO swap that skips serializing beans if the time zone is GMT.</jc>
<jk>public class</jk> MyBeanSwap <jk>extends</jk> StringSwap&lt;MyBean&gt; {
<ja>@Override</ja>
<jk>public</jk> String swap(BeanSession <jv>session</jv>, MyBean <jv>bean</jv>) <jk>throws</jk> Exception {
<jk>if</jk> (<jv>session</jv>.getTimeZone().equals(TimeZone.<jsf>GMT</jsf>))
<jk>return null</jk>;
<jk>return</jk> <jv>bean</jv>.toString();
}
}
<jc>// Create a serializer that uses GMT if the timezone is not specified in the session args.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.timeZone(TimeZone.<jsf>GMT</jsf>)
.build();
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/BeanConfig.html#timeZone()"><code>BeanConfig.timeZone()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#timeZone(java.util.TimeZone)"><code>BeanContext.Builder.timeZone(TimeZone)</code></a>
<li class='jm'><a href="../BeanSession.Builder.html#timeZone(java.util.TimeZone)"><code>BeanSession.Builder.timeZone(TimeZone)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#timeZone(java.util.TimeZone)">timeZone</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this property.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="typeName(java.lang.Class,java.lang.String)">
<h3>typeName</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-974">typeName</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#typeName(java.lang.Class,java.lang.String)">BeanContextable.Builder</a></code></span></div>
<div class="block">An identifying name for this class.
<p>
The name is used to identify the class type during parsing when it cannot be inferred through reflection.
For example, if a bean property is of type <c>Object</c>, then the serializer will add the name to the
output so that the class can be determined during parsing.
<p>
It is also used to specify element names in XML.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Use _type='mybean' to identify this bean.</jc>
<jk>public class</jk> MyBean {...}
<jc>// Create a serializer and specify the type name..</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.typeName(MyBean.<jk>class</jk>, <js>"mybean"</js>)
.build();
<jc>// Produces: {"_type":"mybean",...}</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>Notes:</h5><ul>
<li class='note'>Equivalent to the <a href="../annotation/Bean.html#typeName()"><code>Bean(typeName)</code></a> annotation.
</ul>
<h5 class='section'>See Also:</h5><ul>
<li class='jc'><a href="../annotation/Bean.html#typeName()"><code>Bean(typeName)</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#beanDictionary(java.lang.Class...)"><code>BeanContext.Builder.beanDictionary(Class...)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#typeName(java.lang.Class,java.lang.String)">typeName</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>on</code> - The class the type name is being defined on.</dd>
<dd><code>value</code> - The new value for this setting.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="typePropertyName(java.lang.String)">
<h3>typePropertyName</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-980">typePropertyName</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#typePropertyName(java.lang.String)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean type property name.
<p>
This specifies the name of the bean property used to store the dictionary name of a bean type so that the
parser knows the data type to reconstruct.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// POJOs with @Bean(name) annotations.</jc>
<ja>@Bean</ja>(typeName=<js>"foo"</js>)
<jk>public class</jk> Foo {...}
<ja>@Bean</ja>(typeName=<js>"bar"</js>)
<jk>public class</jk> Bar {...}
<jc>// Create a serializer that uses 't' instead of '_type' for dictionary names.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.typePropertyName(<js>"t"</js>)
.dictionary(Foo.<jk>class</jk>, Bar.<jk>class</jk>)
.build();
<jc>// Create a serializer that uses 't' instead of '_type' for dictionary names.</jc>
ReaderParser <jv>parser</jv> = JsonParser
.<jsm>create</jsm>()
.typePropertyName(<js>"t"</js>)
.dictionary(Foo.<jk>class</jk>, Bar.<jk>class</jk>)
.build();
<jc>// A bean with a field with an indeterminate type.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> Object <jf>mySimpleField</jf>;
}
<jc>// Produces "{mySimpleField:{t:'foo',...}}".</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
<jc>// Parse bean.</jc>
MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<jv>json</jv>, MyBean.<jk>class</jk>);
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/Bean.html#typePropertyName()"><code>Bean.typePropertyName()</code></a>
<li class='ja'><a href="../annotation/BeanConfig.html#typePropertyName()"><code>BeanConfig.typePropertyName()</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#typePropertyName(java.lang.String)"><code>BeanContext.Builder.typePropertyName(String)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#typePropertyName(java.lang.String)">typePropertyName</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>value</code> - The new value for this setting.
<br>The default is <js>"_type"</js>.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="typePropertyName(java.lang.Class,java.lang.String)">
<h3>typePropertyName</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-986">typePropertyName</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;on,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</span></div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#typePropertyName(java.lang.Class,java.lang.String)">BeanContextable.Builder</a></code></span></div>
<div class="block">Bean type property name.
<p>
Same as <a href="../BeanContextable.Builder.html#typePropertyName(java.lang.String)"><code>BeanContextable.Builder.typePropertyName(String)</code></a> except targets a specific bean class instead of globally.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// POJOs with @Bean(name) annotations.</jc>
<ja>@Bean</ja>(typeName=<js>"foo"</js>)
<jk>public class</jk> Foo {...}
<ja>@Bean</ja>(typeName=<js>"bar"</js>)
<jk>public class</jk> Bar {...}
<jc>// A bean with a field with an indeterminate type.</jc>
<jk>public class</jk> MyBean {
<jk>public</jk> Object <jf>mySimpleField</jf>;
}
<jc>// Create a serializer that uses 't' instead of '_type' for dictionary names.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.typePropertyName(MyBean.<jk>class</jk>, <js>"t"</js>)
.dictionary(Foo.<jk>class</jk>, Bar.<jk>class</jk>)
.build();
<jc>// Produces "{mySimpleField:{t:'foo',...}}".</jc>
String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> MyBean());
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='ja'><a href="../annotation/Bean.html#typePropertyName()"><code>Bean(typePropertyName)</code></a>
<li class='jm'><a href="../BeanContext.Builder.html#typePropertyName(java.lang.String)"><code>BeanContext.Builder.typePropertyName(String)</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#typePropertyName(java.lang.Class,java.lang.String)">typePropertyName</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>on</code> - The class the type property name applies to.</dd>
<dd><code>value</code> - The new value for this setting.
<br>The default is <js>"_type"</js>.</dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="useEnumNames()">
<h3>useEnumNames</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-992">useEnumNames</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#useEnumNames()">BeanContextable.Builder</a></code></span></div>
<div class="block">Use enum names.
<p>
When enabled, enums are always serialized by name, not using <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link"><code>Object.toString()</code></a>.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a serializer with debug enabled.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.useEnumNames()
.build();
<jc>// Enum with overridden toString().</jc>
<jc>// Will be serialized as ONE/TWO/THREE even though there's a toString() method.</jc>
<jk>public enum</jk> Option {
<jsf>ONE</jsf>(1),
<jsf>TWO</jsf>(2),
<jsf>THREE</jsf>(3);
<jk>private int</jk> <jf>value</jf>;
Option(<jk>int</jk> <jv>value</jv>) {
<jk>this</jk>.<jf>value</jf> = <jv>value</jv>;
}
<ja>@Override</ja>
<jk>public</jk> String toString() {
<jk>return</jk> String.<jsm>valueOf</jsm>(<jf>value</jf>);
}
}
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jm'><a href="../BeanContext.Builder.html#useEnumNames()"><code>BeanContext.Builder.useEnumNames()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#useEnumNames()">useEnumNames</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="useJavaBeanIntrospector()">
<h3>useJavaBeanIntrospector</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Parser.Builder.html" title="class in org.apache.juneau.parser">Parser.Builder</a></span>&nbsp;<span class="element-name"><a href="../../../../src-html/org/apache/juneau/parser/Parser.Builder.html#line-998">useJavaBeanIntrospector</a></span>()</div>
<div class="block"><span class="description-from-type-label">Description copied from class:&nbsp;<code><a href="../BeanContextable.Builder.html#useJavaBeanIntrospector()">BeanContextable.Builder</a></code></span></div>
<div class="block">Use Java Introspector.
<p>
Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters.
<br>Most <a href="../annotation/Bean.html" title="annotation in org.apache.juneau.annotation"><code>@Bean</code></a> annotations will be ignored.
<h5 class='section'>Example:</h5>
<p class='bjava'>
<jc>// Create a serializer that only uses the built-in java bean introspector for finding properties.</jc>
WriterSerializer <jv>serializer</jv> = JsonSerializer
.<jsm>create</jsm>()
.useJavaBeanIntrospector()
.build();
</p>
<h5 class='section'>See Also:</h5><ul>
<li class='jmf'><a href="../BeanContext.Builder.html#useJavaBeanIntrospector()"><code>BeanContext.Builder.useJavaBeanIntrospector()</code></a>
</ul></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="../BeanContextable.Builder.html#useJavaBeanIntrospector()">useJavaBeanIntrospector</a></code>&nbsp;in class&nbsp;<code><a href="../BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a></code></dd>
<dt>Returns:</dt>
<dd>This object.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2016&#x2013;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>