public class JsonWritingUtils extends Object
Constructor and Description |
---|
JsonWritingUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
shouldWriteField(String fieldName) |
static void |
writeMapEntries(com.fasterxml.jackson.core.JsonGenerator generator,
Map<?,?> map)
Writes entries of the map as fields.
|
static void |
writeMapStringFields(com.fasterxml.jackson.core.JsonGenerator generator,
String fieldName,
Map<String,String> map)
Writes a map as String fields to the generator if and only if the fieldName and values are not null.
|
static void |
writeNumberField(com.fasterxml.jackson.core.JsonGenerator generator,
String fieldName,
int fieldValue)
Writes the field to the generator if and only if the fieldName is not null.
|
static void |
writeNumberField(com.fasterxml.jackson.core.JsonGenerator generator,
String fieldName,
long fieldValue)
Writes the field to the generator if and only if the fieldName is not null.
|
static void |
writeStringField(com.fasterxml.jackson.core.JsonGenerator generator,
String fieldName,
String fieldValue)
Writes the field to the generator if and only if the fieldName and fieldValue are not null.
|
public static void writeMapEntries(com.fasterxml.jackson.core.JsonGenerator generator, Map<?,?> map) throws IOException, com.fasterxml.jackson.databind.JsonMappingException
IOException
com.fasterxml.jackson.databind.JsonMappingException
public static void writeMapStringFields(com.fasterxml.jackson.core.JsonGenerator generator, String fieldName, Map<String,String> map) throws IOException, com.fasterxml.jackson.databind.JsonMappingException
IOException
com.fasterxml.jackson.databind.JsonMappingException
public static void writeStringField(com.fasterxml.jackson.core.JsonGenerator generator, String fieldName, String fieldValue) throws IOException
IOException
public static void writeNumberField(com.fasterxml.jackson.core.JsonGenerator generator, String fieldName, int fieldValue) throws IOException
IOException
public static void writeNumberField(com.fasterxml.jackson.core.JsonGenerator generator, String fieldName, long fieldValue) throws IOException
IOException
public static boolean shouldWriteField(String fieldName)
Copyright © 2015. All Rights Reserved.