<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_10-ea) on Sun Jul 14 20:03:27 PDT 2013 --> <title>ObjectWriter (Jackson JSON Processor)</title> <meta name="date" content="2013-07-14"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ObjectWriter (Jackson JSON Processor)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/ObjectWriter.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/codehaus/jackson/map/ObjectReader.html" title="class in org.codehaus.jackson.map"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/codehaus/jackson/map/PropertyNamingStrategy.html" title="class in org.codehaus.jackson.map"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/codehaus/jackson/map/ObjectWriter.html" target="_top">Frames</a></li> <li><a href="ObjectWriter.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#field_summary">Field</a> | </li> <li><a href="#constructor_summary">Constr</a> | </li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field_detail">Field</a> | </li> <li><a href="#constructor_detail">Constr</a> | </li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.codehaus.jackson.map</div> <h2 title="Class ObjectWriter" class="title">Class ObjectWriter</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li>org.codehaus.jackson.map.ObjectWriter</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../../org/codehaus/jackson/Versioned.html" title="interface in org.codehaus.jackson">Versioned</a></dd> </dl> <hr> <br> <pre>public class <span class="strong">ObjectWriter</span> extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements <a href="../../../../org/codehaus/jackson/Versioned.html" title="interface in org.codehaus.jackson">Versioned</a></pre> <div class="block">Builder object that can be used for per-serialization configuration of serialization parameters, such as JSON View and root type to use. (and thus fully thread-safe with no external synchronization); new instances are constructed for different configurations. Instances are initially constructed by <a href="../../../../org/codehaus/jackson/map/ObjectMapper.html" title="class in org.codehaus.jackson.map"><code>ObjectMapper</code></a> and can be reused in completely thread-safe manner with no explicit synchronization</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.5</dd> <dt><span class="strong">Author:</span></dt> <dd>tatu</dd></dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field_summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../../org/codehaus/jackson/map/SerializationConfig.html" title="class in org.codehaus.jackson.map">SerializationConfig</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#_config">_config</a></strong></code> <div class="block">General serialization configuration settings</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="../../../../org/codehaus/jackson/JsonFactory.html" title="class in org.codehaus.jackson">JsonFactory</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#_jsonFactory">_jsonFactory</a></strong></code> <div class="block">Factory used for constructing <a href="../../../../org/codehaus/jackson/JsonGenerator.html" title="class in org.codehaus.jackson"><code>JsonGenerator</code></a>s</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../../org/codehaus/jackson/PrettyPrinter.html" title="interface in org.codehaus.jackson">PrettyPrinter</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#_prettyPrinter">_prettyPrinter</a></strong></code> <div class="block">To allow for dynamic enabling/disabling of pretty printing, pretty printer can be optionally configured for writer as well</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="../../../../org/codehaus/jackson/map/SerializerProvider.html" title="class in org.codehaus.jackson.map">SerializerProvider</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#_provider">_provider</a></strong></code> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../../org/codehaus/jackson/type/JavaType.html" title="class in org.codehaus.jackson.type">JavaType</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#_rootType">_rootType</a></strong></code> <div class="block">Specified root serialization type to use; can be same as runtime type, but usually one of its super types</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="../../../../org/codehaus/jackson/FormatSchema.html" title="interface in org.codehaus.jackson">FormatSchema</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#_schema">_schema</a></strong></code> <div class="block">When using data format that uses a schema, schema is passed to generator.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../../org/codehaus/jackson/map/SerializerFactory.html" title="class in org.codehaus.jackson.map">SerializerFactory</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#_serializerFactory">_serializerFactory</a></strong></code> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected static <a href="../../../../org/codehaus/jackson/PrettyPrinter.html" title="interface in org.codehaus.jackson">PrettyPrinter</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#NULL_PRETTY_PRINTER">NULL_PRETTY_PRINTER</a></strong></code> <div class="block">We need to keep track of explicit disabling of pretty printing; easiest to do by a token value.</div> </td> </tr> </table> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier</th> <th class="colLast" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>protected </code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#ObjectWriter(org.codehaus.jackson.map.ObjectMapper, org.codehaus.jackson.map.SerializationConfig)">ObjectWriter</a></strong>(<a href="../../../../org/codehaus/jackson/map/ObjectMapper.html" title="class in org.codehaus.jackson.map">ObjectMapper</a> mapper, <a href="../../../../org/codehaus/jackson/map/SerializationConfig.html" title="class in org.codehaus.jackson.map">SerializationConfig</a> config)</code> <div class="block">Alternative constructor for initial instantiation.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected </code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#ObjectWriter(org.codehaus.jackson.map.ObjectMapper, org.codehaus.jackson.map.SerializationConfig, org.codehaus.jackson.FormatSchema)">ObjectWriter</a></strong>(<a href="../../../../org/codehaus/jackson/map/ObjectMapper.html" title="class in org.codehaus.jackson.map">ObjectMapper</a> mapper, <a href="../../../../org/codehaus/jackson/map/SerializationConfig.html" title="class in org.codehaus.jackson.map">SerializationConfig</a> config, <a href="../../../../org/codehaus/jackson/FormatSchema.html" title="interface in org.codehaus.jackson">FormatSchema</a> s)</code> <div class="block">Alternative constructor for initial instantiation.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected </code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#ObjectWriter(org.codehaus.jackson.map.ObjectMapper, org.codehaus.jackson.map.SerializationConfig, org.codehaus.jackson.type.JavaType, org.codehaus.jackson.PrettyPrinter)">ObjectWriter</a></strong>(<a href="../../../../org/codehaus/jackson/map/ObjectMapper.html" title="class in org.codehaus.jackson.map">ObjectMapper</a> mapper, <a href="../../../../org/codehaus/jackson/map/SerializationConfig.html" title="class in org.codehaus.jackson.map">SerializationConfig</a> config, <a href="../../../../org/codehaus/jackson/type/JavaType.html" title="class in org.codehaus.jackson.type">JavaType</a> rootType, <a href="../../../../org/codehaus/jackson/PrettyPrinter.html" title="interface in org.codehaus.jackson">PrettyPrinter</a> pp)</code> <div class="block">Constructor used by <a href="../../../../org/codehaus/jackson/map/ObjectMapper.html" title="class in org.codehaus.jackson.map"><code>ObjectMapper</code></a> for initial instantiation</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected </code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#ObjectWriter(org.codehaus.jackson.map.ObjectWriter, org.codehaus.jackson.map.SerializationConfig)">ObjectWriter</a></strong>(<a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> base, <a href="../../../../org/codehaus/jackson/map/SerializationConfig.html" title="class in org.codehaus.jackson.map">SerializationConfig</a> config)</code> <div class="block">Copy constructor used for building variations.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected </code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#ObjectWriter(org.codehaus.jackson.map.ObjectWriter, org.codehaus.jackson.map.SerializationConfig, org.codehaus.jackson.type.JavaType, org.codehaus.jackson.PrettyPrinter, org.codehaus.jackson.FormatSchema)">ObjectWriter</a></strong>(<a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> base, <a href="../../../../org/codehaus/jackson/map/SerializationConfig.html" title="class in org.codehaus.jackson.map">SerializationConfig</a> config, <a href="../../../../org/codehaus/jackson/type/JavaType.html" title="class in org.codehaus.jackson.type">JavaType</a> rootType, <a href="../../../../org/codehaus/jackson/PrettyPrinter.html" title="interface in org.codehaus.jackson">PrettyPrinter</a> pp, <a href="../../../../org/codehaus/jackson/FormatSchema.html" title="interface in org.codehaus.jackson">FormatSchema</a> s)</code> <div class="block">Copy constructor used for building variations.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#_configAndWriteValue(org.codehaus.jackson.JsonGenerator, java.lang.Object)">_configAndWriteValue</a></strong>(<a href="../../../../org/codehaus/jackson/JsonGenerator.html" title="class in org.codehaus.jackson">JsonGenerator</a> jgen, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value)</code> <div class="block">Method called to configure the generator as necessary and then call write functionality</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#canSerialize(java.lang.Class)">canSerialize</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> type)</code> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/Version.html" title="class in org.codehaus.jackson">Version</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#version()">version</a></strong>()</code> <div class="block">Method that will return version information stored in and read from jar that contains this class.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#withDateFormat(java.text.DateFormat)">withDateFormat</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text">DateFormat</a> df)</code> <div class="block">Fluent factory method that will construct a new writer instance that will use specified date format for serializing dates; or if null passed, one that will serialize dates as numeric timestamps.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#withDefaultPrettyPrinter()">withDefaultPrettyPrinter</a></strong>()</code> <div class="block">Method that will construct a new instance that will use the default pretty printer for serialization.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#withFilters(org.codehaus.jackson.map.ser.FilterProvider)">withFilters</a></strong>(<a href="../../../../org/codehaus/jackson/map/ser/FilterProvider.html" title="class in org.codehaus.jackson.map.ser">FilterProvider</a> filterProvider)</code> <div class="block">Method that will construct a new instance that uses specified provider for resolving filter instances by id.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#withPrettyPrinter(org.codehaus.jackson.PrettyPrinter)">withPrettyPrinter</a></strong>(<a href="../../../../org/codehaus/jackson/PrettyPrinter.html" title="interface in org.codehaus.jackson">PrettyPrinter</a> pp)</code> <div class="block">Method that will construct a new instance that will use specified pretty printer (or, if null, will not do any pretty-printing)</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#withSchema(org.codehaus.jackson.FormatSchema)">withSchema</a></strong>(<a href="../../../../org/codehaus/jackson/FormatSchema.html" title="interface in org.codehaus.jackson">FormatSchema</a> schema)</code> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#withType(java.lang.Class)">withType</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> rootType)</code> <div class="block">Method that will construct a new instance that uses specific type as the root type for serialization, instead of runtime dynamic type of the root object itself.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#withType(org.codehaus.jackson.type.JavaType)">withType</a></strong>(<a href="../../../../org/codehaus/jackson/type/JavaType.html" title="class in org.codehaus.jackson.type">JavaType</a> rootType)</code> <div class="block">Method that will construct a new instance that uses specific type as the root type for serialization, instead of runtime dynamic type of the root object itself.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#withType(org.codehaus.jackson.type.TypeReference)">withType</a></strong>(<a href="../../../../org/codehaus/jackson/type/TypeReference.html" title="class in org.codehaus.jackson.type">TypeReference</a><?> rootType)</code> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#withView(java.lang.Class)">withView</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> view)</code> <div class="block">Method that will construct a new instance that uses specified serialization view for serialization (with null basically disables view processing)</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#writeValue(java.io.File, java.lang.Object)">writeValue</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> resultFile, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value)</code> <div class="block">Method that can be used to serialize any Java value as JSON output, written to File provided.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#writeValue(org.codehaus.jackson.JsonGenerator, java.lang.Object)">writeValue</a></strong>(<a href="../../../../org/codehaus/jackson/JsonGenerator.html" title="class in org.codehaus.jackson">JsonGenerator</a> jgen, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value)</code> <div class="block">Method that can be used to serialize any Java value as JSON output, using provided <a href="../../../../org/codehaus/jackson/JsonGenerator.html" title="class in org.codehaus.jackson"><code>JsonGenerator</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#writeValue(java.io.OutputStream, java.lang.Object)">writeValue</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a> out, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value)</code> <div class="block">Method that can be used to serialize any Java value as JSON output, using output stream provided (using encoding <a href="../../../../org/codehaus/jackson/JsonEncoding.html#UTF8"><code>JsonEncoding.UTF8</code></a>).</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#writeValue(java.io.Writer, java.lang.Object)">writeValue</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</a> w, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value)</code> <div class="block">Method that can be used to serialize any Java value as JSON output, using Writer provided.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>byte[]</code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#writeValueAsBytes(java.lang.Object)">writeValueAsBytes</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value)</code> <div class="block">Method that can be used to serialize any Java value as a byte array.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#writeValueAsString(java.lang.Object)">writeValueAsString</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value)</code> <div class="block">Method that can be used to serialize any Java value as a String.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> <code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field_detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="NULL_PRETTY_PRINTER"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>NULL_PRETTY_PRINTER</h4> <pre>protected static final <a href="../../../../org/codehaus/jackson/PrettyPrinter.html" title="interface in org.codehaus.jackson">PrettyPrinter</a> NULL_PRETTY_PRINTER</pre> <div class="block">We need to keep track of explicit disabling of pretty printing; easiest to do by a token value.</div> </li> </ul> <a name="_config"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_config</h4> <pre>protected final <a href="../../../../org/codehaus/jackson/map/SerializationConfig.html" title="class in org.codehaus.jackson.map">SerializationConfig</a> _config</pre> <div class="block">General serialization configuration settings</div> </li> </ul> <a name="_provider"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_provider</h4> <pre>protected final <a href="../../../../org/codehaus/jackson/map/SerializerProvider.html" title="class in org.codehaus.jackson.map">SerializerProvider</a> _provider</pre> </li> </ul> <a name="_serializerFactory"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_serializerFactory</h4> <pre>protected final <a href="../../../../org/codehaus/jackson/map/SerializerFactory.html" title="class in org.codehaus.jackson.map">SerializerFactory</a> _serializerFactory</pre> </li> </ul> <a name="_jsonFactory"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_jsonFactory</h4> <pre>protected final <a href="../../../../org/codehaus/jackson/JsonFactory.html" title="class in org.codehaus.jackson">JsonFactory</a> _jsonFactory</pre> <div class="block">Factory used for constructing <a href="../../../../org/codehaus/jackson/JsonGenerator.html" title="class in org.codehaus.jackson"><code>JsonGenerator</code></a>s</div> </li> </ul> <a name="_rootType"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_rootType</h4> <pre>protected final <a href="../../../../org/codehaus/jackson/type/JavaType.html" title="class in org.codehaus.jackson.type">JavaType</a> _rootType</pre> <div class="block">Specified root serialization type to use; can be same as runtime type, but usually one of its super types</div> </li> </ul> <a name="_prettyPrinter"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>_prettyPrinter</h4> <pre>protected final <a href="../../../../org/codehaus/jackson/PrettyPrinter.html" title="interface in org.codehaus.jackson">PrettyPrinter</a> _prettyPrinter</pre> <div class="block">To allow for dynamic enabling/disabling of pretty printing, pretty printer can be optionally configured for writer as well</div> </li> </ul> <a name="_schema"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>_schema</h4> <pre>protected final <a href="../../../../org/codehaus/jackson/FormatSchema.html" title="interface in org.codehaus.jackson">FormatSchema</a> _schema</pre> <div class="block">When using data format that uses a schema, schema is passed to generator.</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.8</dd></dl> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="ObjectWriter(org.codehaus.jackson.map.ObjectMapper, org.codehaus.jackson.map.SerializationConfig, org.codehaus.jackson.type.JavaType, org.codehaus.jackson.PrettyPrinter)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ObjectWriter</h4> <pre>protected ObjectWriter(<a href="../../../../org/codehaus/jackson/map/ObjectMapper.html" title="class in org.codehaus.jackson.map">ObjectMapper</a> mapper, <a href="../../../../org/codehaus/jackson/map/SerializationConfig.html" title="class in org.codehaus.jackson.map">SerializationConfig</a> config, <a href="../../../../org/codehaus/jackson/type/JavaType.html" title="class in org.codehaus.jackson.type">JavaType</a> rootType, <a href="../../../../org/codehaus/jackson/PrettyPrinter.html" title="interface in org.codehaus.jackson">PrettyPrinter</a> pp)</pre> <div class="block">Constructor used by <a href="../../../../org/codehaus/jackson/map/ObjectMapper.html" title="class in org.codehaus.jackson.map"><code>ObjectMapper</code></a> for initial instantiation</div> </li> </ul> <a name="ObjectWriter(org.codehaus.jackson.map.ObjectMapper, org.codehaus.jackson.map.SerializationConfig)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ObjectWriter</h4> <pre>protected ObjectWriter(<a href="../../../../org/codehaus/jackson/map/ObjectMapper.html" title="class in org.codehaus.jackson.map">ObjectMapper</a> mapper, <a href="../../../../org/codehaus/jackson/map/SerializationConfig.html" title="class in org.codehaus.jackson.map">SerializationConfig</a> config)</pre> <div class="block">Alternative constructor for initial instantiation.</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.7</dd></dl> </li> </ul> <a name="ObjectWriter(org.codehaus.jackson.map.ObjectMapper, org.codehaus.jackson.map.SerializationConfig, org.codehaus.jackson.FormatSchema)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ObjectWriter</h4> <pre>protected ObjectWriter(<a href="../../../../org/codehaus/jackson/map/ObjectMapper.html" title="class in org.codehaus.jackson.map">ObjectMapper</a> mapper, <a href="../../../../org/codehaus/jackson/map/SerializationConfig.html" title="class in org.codehaus.jackson.map">SerializationConfig</a> config, <a href="../../../../org/codehaus/jackson/FormatSchema.html" title="interface in org.codehaus.jackson">FormatSchema</a> s)</pre> <div class="block">Alternative constructor for initial instantiation.</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.7</dd></dl> </li> </ul> <a name="ObjectWriter(org.codehaus.jackson.map.ObjectWriter, org.codehaus.jackson.map.SerializationConfig, org.codehaus.jackson.type.JavaType, org.codehaus.jackson.PrettyPrinter, org.codehaus.jackson.FormatSchema)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ObjectWriter</h4> <pre>protected ObjectWriter(<a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> base, <a href="../../../../org/codehaus/jackson/map/SerializationConfig.html" title="class in org.codehaus.jackson.map">SerializationConfig</a> config, <a href="../../../../org/codehaus/jackson/type/JavaType.html" title="class in org.codehaus.jackson.type">JavaType</a> rootType, <a href="../../../../org/codehaus/jackson/PrettyPrinter.html" title="interface in org.codehaus.jackson">PrettyPrinter</a> pp, <a href="../../../../org/codehaus/jackson/FormatSchema.html" title="interface in org.codehaus.jackson">FormatSchema</a> s)</pre> <div class="block">Copy constructor used for building variations.</div> </li> </ul> <a name="ObjectWriter(org.codehaus.jackson.map.ObjectWriter, org.codehaus.jackson.map.SerializationConfig)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>ObjectWriter</h4> <pre>protected ObjectWriter(<a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> base, <a href="../../../../org/codehaus/jackson/map/SerializationConfig.html" title="class in org.codehaus.jackson.map">SerializationConfig</a> config)</pre> <div class="block">Copy constructor used for building variations.</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.7</dd></dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="version()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>version</h4> <pre>public <a href="../../../../org/codehaus/jackson/Version.html" title="class in org.codehaus.jackson">Version</a> version()</pre> <div class="block">Method that will return version information stored in and read from jar that contains this class.</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/codehaus/jackson/Versioned.html#version()">version</a></code> in interface <code><a href="../../../../org/codehaus/jackson/Versioned.html" title="interface in org.codehaus.jackson">Versioned</a></code></dd> <dt><span class="strong">Since:</span></dt> <dd>1.6</dd></dl> </li> </ul> <a name="withView(java.lang.Class)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>withView</h4> <pre>public <a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> withView(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> view)</pre> <div class="block">Method that will construct a new instance that uses specified serialization view for serialization (with null basically disables view processing)</div> </li> </ul> <a name="withType(org.codehaus.jackson.type.JavaType)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>withType</h4> <pre>public <a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> withType(<a href="../../../../org/codehaus/jackson/type/JavaType.html" title="class in org.codehaus.jackson.type">JavaType</a> rootType)</pre> <div class="block">Method that will construct a new instance that uses specific type as the root type for serialization, instead of runtime dynamic type of the root object itself.</div> </li> </ul> <a name="withType(java.lang.Class)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>withType</h4> <pre>public <a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> withType(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> rootType)</pre> <div class="block">Method that will construct a new instance that uses specific type as the root type for serialization, instead of runtime dynamic type of the root object itself.</div> </li> </ul> <a name="withType(org.codehaus.jackson.type.TypeReference)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>withType</h4> <pre>public <a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> withType(<a href="../../../../org/codehaus/jackson/type/TypeReference.html" title="class in org.codehaus.jackson.type">TypeReference</a><?> rootType)</pre> <dl><dt><span class="strong">Since:</span></dt> <dd>1.7</dd></dl> </li> </ul> <a name="withPrettyPrinter(org.codehaus.jackson.PrettyPrinter)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>withPrettyPrinter</h4> <pre>public <a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> withPrettyPrinter(<a href="../../../../org/codehaus/jackson/PrettyPrinter.html" title="interface in org.codehaus.jackson">PrettyPrinter</a> pp)</pre> <div class="block">Method that will construct a new instance that will use specified pretty printer (or, if null, will not do any pretty-printing)</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.6</dd></dl> </li> </ul> <a name="withDefaultPrettyPrinter()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>withDefaultPrettyPrinter</h4> <pre>public <a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> withDefaultPrettyPrinter()</pre> <div class="block">Method that will construct a new instance that will use the default pretty printer for serialization.</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.6</dd></dl> </li> </ul> <a name="withFilters(org.codehaus.jackson.map.ser.FilterProvider)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>withFilters</h4> <pre>public <a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> withFilters(<a href="../../../../org/codehaus/jackson/map/ser/FilterProvider.html" title="class in org.codehaus.jackson.map.ser">FilterProvider</a> filterProvider)</pre> <div class="block">Method that will construct a new instance that uses specified provider for resolving filter instances by id.</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.7</dd></dl> </li> </ul> <a name="withSchema(org.codehaus.jackson.FormatSchema)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>withSchema</h4> <pre>public <a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> withSchema(<a href="../../../../org/codehaus/jackson/FormatSchema.html" title="interface in org.codehaus.jackson">FormatSchema</a> schema)</pre> <dl><dt><span class="strong">Since:</span></dt> <dd>1.8</dd></dl> </li> </ul> <a name="withDateFormat(java.text.DateFormat)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>withDateFormat</h4> <pre>public <a href="../../../../org/codehaus/jackson/map/ObjectWriter.html" title="class in org.codehaus.jackson.map">ObjectWriter</a> withDateFormat(<a href="http://docs.oracle.com/javase/6/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text">DateFormat</a> df)</pre> <div class="block">Fluent factory method that will construct a new writer instance that will use specified date format for serializing dates; or if null passed, one that will serialize dates as numeric timestamps.</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.9</dd></dl> </li> </ul> <a name="writeValue(org.codehaus.jackson.JsonGenerator, java.lang.Object)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>writeValue</h4> <pre>public void writeValue(<a href="../../../../org/codehaus/jackson/JsonGenerator.html" title="class in org.codehaus.jackson">JsonGenerator</a> jgen, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value) throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a>, <a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></pre> <div class="block">Method that can be used to serialize any Java value as JSON output, using provided <a href="../../../../org/codehaus/jackson/JsonGenerator.html" title="class in org.codehaus.jackson"><code>JsonGenerator</code></a>.</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></code></dd></dl> </li> </ul> <a name="writeValue(java.io.File, java.lang.Object)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>writeValue</h4> <pre>public void writeValue(<a href="http://docs.oracle.com/javase/6/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> resultFile, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value) throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a>, <a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></pre> <div class="block">Method that can be used to serialize any Java value as JSON output, written to File provided.</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></code></dd></dl> </li> </ul> <a name="writeValue(java.io.OutputStream, java.lang.Object)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>writeValue</h4> <pre>public void writeValue(<a href="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a> out, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value) throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a>, <a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></pre> <div class="block">Method that can be used to serialize any Java value as JSON output, using output stream provided (using encoding <a href="../../../../org/codehaus/jackson/JsonEncoding.html#UTF8"><code>JsonEncoding.UTF8</code></a>). <p> Note: method does not close the underlying stream explicitly here; however, <a href="../../../../org/codehaus/jackson/JsonFactory.html" title="class in org.codehaus.jackson"><code>JsonFactory</code></a> this mapper uses may choose to close the stream depending on its settings (by default, it will try to close it when <a href="../../../../org/codehaus/jackson/JsonGenerator.html" title="class in org.codehaus.jackson"><code>JsonGenerator</code></a> we construct is closed).</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></code></dd></dl> </li> </ul> <a name="writeValue(java.io.Writer, java.lang.Object)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>writeValue</h4> <pre>public void writeValue(<a href="http://docs.oracle.com/javase/6/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</a> w, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value) throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a>, <a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></pre> <div class="block">Method that can be used to serialize any Java value as JSON output, using Writer provided. <p> Note: method does not close the underlying stream explicitly here; however, <a href="../../../../org/codehaus/jackson/JsonFactory.html" title="class in org.codehaus.jackson"><code>JsonFactory</code></a> this mapper uses may choose to close the stream depending on its settings (by default, it will try to close it when <a href="../../../../org/codehaus/jackson/JsonGenerator.html" title="class in org.codehaus.jackson"><code>JsonGenerator</code></a> we construct is closed).</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></code></dd></dl> </li> </ul> <a name="writeValueAsString(java.lang.Object)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>writeValueAsString</h4> <pre>public <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> writeValueAsString(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value) throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a>, <a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></pre> <div class="block">Method that can be used to serialize any Java value as a String. Functionally equivalent to calling <a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#writeValue(java.io.Writer, java.lang.Object)"><code>writeValue(Writer,Object)</code></a> with <a href="http://docs.oracle.com/javase/6/docs/api/java/io/StringWriter.html?is-external=true" title="class or interface in java.io"><code>StringWriter</code></a> and constructing String, but more efficient.</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></code></dd></dl> </li> </ul> <a name="writeValueAsBytes(java.lang.Object)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>writeValueAsBytes</h4> <pre>public byte[] writeValueAsBytes(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value) throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a>, <a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></pre> <div class="block">Method that can be used to serialize any Java value as a byte array. Functionally equivalent to calling <a href="../../../../org/codehaus/jackson/map/ObjectWriter.html#writeValue(java.io.Writer, java.lang.Object)"><code>writeValue(Writer,Object)</code></a> with <a href="http://docs.oracle.com/javase/6/docs/api/java/io/ByteArrayOutputStream.html?is-external=true" title="class or interface in java.io"><code>ByteArrayOutputStream</code></a> and getting bytes, but more efficient. Encoding used will be UTF-8.</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></code></dd></dl> </li> </ul> <a name="canSerialize(java.lang.Class)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>canSerialize</h4> <pre>public boolean canSerialize(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?> type)</pre> </li> </ul> <a name="_configAndWriteValue(org.codehaus.jackson.JsonGenerator, java.lang.Object)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>_configAndWriteValue</h4> <pre>protected final void _configAndWriteValue(<a href="../../../../org/codehaus/jackson/JsonGenerator.html" title="class in org.codehaus.jackson">JsonGenerator</a> jgen, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value) throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a>, <a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></pre> <div class="block">Method called to configure the generator as necessary and then call write functionality</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/JsonGenerationException.html" title="class in org.codehaus.jackson">JsonGenerationException</a></code></dd> <dd><code><a href="../../../../org/codehaus/jackson/map/JsonMappingException.html" title="class in org.codehaus.jackson.map">JsonMappingException</a></code></dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/ObjectWriter.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/codehaus/jackson/map/ObjectReader.html" title="class in org.codehaus.jackson.map"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/codehaus/jackson/map/PropertyNamingStrategy.html" title="class in org.codehaus.jackson.map"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/codehaus/jackson/map/ObjectWriter.html" target="_top">Frames</a></li> <li><a href="ObjectWriter.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#field_summary">Field</a> | </li> <li><a href="#constructor_summary">Constr</a> | </li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field_detail">Field</a> | </li> <li><a href="#constructor_detail">Constr</a> | </li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>