public class JSONWriter extends Object
Life-cycle is such that initial instance (called blueprint)
is constructed first (including possible configuration
using mutant factory methods). This blueprint object
acts as a factory, and is never used for direct writing;
instead, per-call instance is created by calling
perOperationInstance(int, com.fasterxml.jackson.core.JsonGenerator).
| Modifier and Type | Field and Description |
|---|---|
protected int |
_features |
protected JsonGenerator |
_generator |
protected TimeZone |
_timezone |
protected TreeCodec |
_treeCodec |
protected TypeDetector |
_typeDetector
Object that is used to resolve types of values dynamically.
|
protected boolean |
_writeNullValues |
| Modifier | Constructor and Description |
|---|---|
|
JSONWriter(int features,
TypeDetector td,
TreeCodec tc)
Constructor used for creating differently configured blueprint
instances
|
protected |
JSONWriter(JSONWriter base,
int features,
TypeDetector td,
JsonGenerator g)
Constructor for non-blueprint instances
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
_checkUnknown(Object value) |
protected JSONWriter |
_with(int features,
TypeDetector td,
TreeCodec tc)
Overridable method that all mutant factories call if a new instance
is to be constructed
|
protected void |
_writeValue(Object value,
int type) |
protected String |
dateToString(Date v) |
protected String |
keyToString(Object rawKey) |
JSONWriter |
perOperationInstance(int features,
JsonGenerator g) |
JSONWriter |
with(TreeCodec tc) |
protected void |
writeBeanValue(BeanPropertyWriter[] props,
Object bean) |
protected void |
writeBigDecimalField(String fieldName,
BigDecimal v) |
protected void |
writeBigDecimalValue(BigDecimal v) |
protected void |
writeBigIntegerField(String fieldName,
BigInteger v) |
protected void |
writeBigIntegerValue(BigInteger v) |
protected void |
writeBinaryField(String fieldName,
byte[] data) |
protected void |
writeBinaryValue(byte[] data) |
protected void |
writeBooleanArrayField(String fieldName,
boolean[] v) |
protected void |
writeBooleanArrayValue(boolean[] v) |
protected void |
writeBooleanField(String fieldName,
boolean v) |
protected void |
writeBooleanValue(boolean v) |
protected void |
writeCollectionField(String fieldName,
Collection<?> v) |
protected void |
writeCollectionValue(Collection<?> v) |
protected void |
writeDateField(String fieldName,
Date v) |
protected void |
writeDateValue(Date v) |
protected void |
writeDoubleField(String fieldName,
double v) |
protected void |
writeDoubleValue(double v) |
protected void |
writeEnumField(String fieldName,
Enum<?> v) |
protected void |
writeEnumValue(Enum<?> v) |
void |
writeField(String fieldName,
Object value)
Deprecated.
|
void |
writeField(String fieldName,
Object value,
int type) |
protected void |
writeIntArrayField(String fieldName,
int[] v) |
protected void |
writeIntArrayValue(int[] v) |
protected void |
writeIntField(String fieldName,
int v) |
protected void |
writeIntValue(int v) |
protected void |
writeIterableField(String fieldName,
Iterable<?> v) |
protected void |
writeIterableValue(Iterable<?> v) |
protected void |
writeListField(String fieldName,
List<?> v) |
protected void |
writeListValue(List<?> list) |
protected void |
writeLongArrayField(String fieldName,
long[] v) |
protected void |
writeLongArrayValue(long[] v) |
protected void |
writeLongField(String fieldName,
long v) |
protected void |
writeLongValue(long v) |
protected void |
writeMapField(String fieldName,
Map<?,?> v) |
protected void |
writeMapValue(Map<?,?> v) |
protected void |
writeNullField(SerializedString fieldName) |
protected void |
writeNullField(String fieldName) |
protected void |
writeNullValue() |
protected void |
writeObjectArrayField(String fieldName,
Object[] v) |
protected void |
writeObjectArrayValue(Object[] v) |
protected void |
writeStringField(String fieldName,
String v) |
protected void |
writeStringLikeField(String fieldName,
String v,
int actualType) |
protected void |
writeStringLikeValue(String v,
int actualType) |
protected void |
writeStringValue(String v) |
protected void |
writeTreeNodeField(String fieldName,
TreeNode v) |
protected void |
writeTreeNodeValue(TreeNode v) |
protected void |
writeUnknownField(String fieldName,
Object data) |
protected void |
writeUnknownValue(Object data) |
void |
writeValue(Object value) |
protected final int _features
protected final boolean _writeNullValues
protected final TypeDetector _typeDetector
protected final TreeCodec _treeCodec
protected final JsonGenerator _generator
protected final TimeZone _timezone
public JSONWriter(int features,
TypeDetector td,
TreeCodec tc)
protected JSONWriter(JSONWriter base, int features, TypeDetector td, JsonGenerator g)
public JSONWriter with(TreeCodec tc)
protected JSONWriter _with(int features, TypeDetector td, TreeCodec tc)
public JSONWriter perOperationInstance(int features, JsonGenerator g)
public void writeValue(Object value) throws IOException
IOException@Deprecated public void writeField(String fieldName, Object value) throws IOException
IOExceptionpublic void writeField(String fieldName, Object value, int type) throws IOException
IOExceptionprotected void _writeValue(Object value, int type) throws IOException
IOExceptionprotected void writeCollectionValue(Collection<?> v) throws IOException
IOExceptionprotected void writeCollectionField(String fieldName, Collection<?> v) throws IOException
IOExceptionprotected void writeIterableValue(Iterable<?> v) throws IOException
IOExceptionprotected void writeIterableField(String fieldName, Iterable<?> v) throws IOException
IOExceptionprotected void writeListValue(List<?> list) throws IOException
IOExceptionprotected void writeListField(String fieldName, List<?> v) throws IOException
IOExceptionprotected void writeMapValue(Map<?,?> v) throws IOException
IOExceptionprotected void writeMapField(String fieldName, Map<?,?> v) throws IOException
IOExceptionprotected void writeObjectArrayValue(Object[] v) throws IOException
IOExceptionprotected void writeObjectArrayField(String fieldName, Object[] v) throws IOException
IOExceptionprotected void writeIntArrayValue(int[] v)
throws IOException
IOExceptionprotected void writeIntArrayField(String fieldName, int[] v) throws IOException
IOExceptionprotected void writeLongArrayValue(long[] v)
throws IOException
IOExceptionprotected void writeLongArrayField(String fieldName, long[] v) throws IOException
IOExceptionprotected void writeBooleanArrayValue(boolean[] v)
throws IOException
IOExceptionprotected void writeBooleanArrayField(String fieldName, boolean[] v) throws IOException
IOExceptionprotected void writeTreeNodeValue(TreeNode v) throws IOException
IOExceptionprotected void writeTreeNodeField(String fieldName, TreeNode v) throws IOException
IOExceptionprotected void writeBooleanValue(boolean v)
throws IOException
IOExceptionprotected void writeBooleanField(String fieldName, boolean v) throws IOException
IOExceptionprotected void writeIntValue(int v)
throws IOException
IOExceptionprotected void writeIntField(String fieldName, int v) throws IOException
IOExceptionprotected void writeLongValue(long v)
throws IOException
IOExceptionprotected void writeBigIntegerValue(BigInteger v) throws IOException
IOExceptionprotected void writeBigIntegerField(String fieldName, BigInteger v) throws IOException
IOExceptionprotected void writeLongField(String fieldName, long v) throws IOException
IOExceptionprotected void writeDoubleValue(double v)
throws IOException
IOExceptionprotected void writeDoubleField(String fieldName, double v) throws IOException
IOExceptionprotected void writeBigDecimalValue(BigDecimal v) throws IOException
IOExceptionprotected void writeBigDecimalField(String fieldName, BigDecimal v) throws IOException
IOExceptionprotected void writeStringValue(String v) throws IOException
IOExceptionprotected void writeStringField(String fieldName, String v) throws IOException
IOExceptionprotected void writeStringLikeValue(String v, int actualType) throws IOException
IOExceptionprotected void writeStringLikeField(String fieldName, String v, int actualType) throws IOException
IOExceptionprotected void writeBinaryValue(byte[] data)
throws IOException
IOExceptionprotected void writeBinaryField(String fieldName, byte[] data) throws IOException
IOExceptionprotected void writeNullValue()
throws IOException
IOExceptionprotected void writeNullField(String fieldName) throws IOException
IOExceptionprotected void writeNullField(SerializedString fieldName) throws IOException
IOExceptionprotected void writeDateValue(Date v) throws IOException
IOExceptionprotected void writeDateField(String fieldName, Date v) throws IOException
IOExceptionprotected void writeEnumValue(Enum<?> v) throws IOException
IOExceptionprotected void writeEnumField(String fieldName, Enum<?> v) throws IOException
IOExceptionprotected void writeBeanValue(BeanPropertyWriter[] props, Object bean) throws IOException
IOExceptionprotected void writeUnknownValue(Object data) throws IOException
IOExceptionprotected void writeUnknownField(String fieldName, Object data) throws IOException
IOExceptionprotected void _checkUnknown(Object value) throws IOException
IOExceptionCopyright © 2018 FasterXML. All rights reserved.