public class JsonSerializationContext extends JsonMappingContext
| Modifier and Type | Class and Description |
|---|---|
static class |
JsonSerializationContext.Builder
Builder for
JsonSerializationContext. |
static class |
JsonSerializationContext.DefaultBuilder |
| Modifier and Type | Method and Description |
|---|---|
void |
addGenerator(com.fasterxml.jackson.annotation.ObjectIdGenerator<?> generator)
Used by generated
AbstractBeanJsonSerializer |
void |
addObjectId(Object object,
ObjectIdSerializer<?> id)
addObjectId
|
static JsonSerializationContext.Builder |
builder()
builder
|
<T> com.fasterxml.jackson.annotation.ObjectIdGenerator<T> |
findObjectIdGenerator(com.fasterxml.jackson.annotation.ObjectIdGenerator<T> gen)
Used by generated
AbstractBeanJsonSerializer |
Logger |
getLogger()
getLogger
|
ObjectIdSerializer<?> |
getObjectId(Object object)
getObjectId
|
boolean |
isOrderMapEntriesByKeys()
isOrderMapEntriesByKeys
|
boolean |
isSerializeNulls()
isSerializeNulls
|
boolean |
isWrapRootValue()
isWrapRootValue
|
boolean |
isWriteCharArraysAsJsonArrays()
isWriteCharArraysAsJsonArrays
|
boolean |
isWriteDateKeysAsTimestamps()
isWriteDateKeysAsTimestamps
|
boolean |
isWriteDatesAsTimestamps()
isWriteDatesAsTimestamps
|
boolean |
isWriteEmptyJsonArrays()
isWriteEmptyJsonArrays
|
boolean |
isWriteNullMapValues()
isWriteNullMapValues
|
boolean |
isWriteSingleElemArraysUnwrapped()
isWriteSingleElemArraysUnwrapped
|
JsonWriter |
newJsonWriter()
newJsonWriter
|
RuntimeException |
traceError(Object value,
RuntimeException cause)
Trace an error and returns a corresponding exception.
|
RuntimeException |
traceError(Object value,
RuntimeException cause,
JsonWriter writer)
Trace an error with current writer state and returns a corresponding exception.
|
JsonSerializationException |
traceError(Object value,
String message)
Trace an error and returns a corresponding exception.
|
JsonSerializationException |
traceError(Object value,
String message,
JsonWriter writer)
Trace an error with current writer state and returns a corresponding exception.
|
public static JsonSerializationContext.Builder builder()
builder
JsonSerializationContext.Builder object.public Logger getLogger()
getLogger
getLogger in class JsonMappingContextLogger object.public boolean isSerializeNulls()
isSerializeNulls
JsonSerializationContext.Builder.serializeNulls(boolean)public boolean isWriteDatesAsTimestamps()
isWriteDatesAsTimestamps
JsonSerializationContext.Builder.writeDatesAsTimestamps(boolean)public boolean isWriteDateKeysAsTimestamps()
isWriteDateKeysAsTimestamps
JsonSerializationContext.Builder.writeDateKeysAsTimestamps(boolean)public boolean isWrapRootValue()
isWrapRootValue
JsonSerializationContext.Builder.wrapRootValue(boolean)public boolean isWriteCharArraysAsJsonArrays()
isWriteCharArraysAsJsonArrays
JsonSerializationContext.Builder.writeCharArraysAsJsonArrays(boolean)public boolean isWriteNullMapValues()
isWriteNullMapValues
JsonSerializationContext.Builder.writeNullMapValues(boolean)public boolean isWriteEmptyJsonArrays()
isWriteEmptyJsonArrays
JsonSerializationContext.Builder.writeEmptyJsonArrays(boolean)public boolean isOrderMapEntriesByKeys()
isOrderMapEntriesByKeys
JsonSerializationContext.Builder.orderMapEntriesByKeys(boolean)public boolean isWriteSingleElemArraysUnwrapped()
isWriteSingleElemArraysUnwrapped
JsonSerializationContext.Builder.writeSingleElemArraysUnwrapped(boolean)public JsonWriter newJsonWriter()
newJsonWriter
JsonWriter object.public JsonSerializationException traceError(Object value, String message)
value - current valuemessage - error messageJsonSerializationException with the given messagepublic JsonSerializationException traceError(Object value, String message, JsonWriter writer)
value - current valuemessage - error messagewriter - current writerJsonSerializationException with the given messagepublic RuntimeException traceError(Object value, RuntimeException cause)
value - current valuecause - cause of the errorJsonSerializationException if we wrap the exceptions, the cause otherwisepublic RuntimeException traceError(Object value, RuntimeException cause, JsonWriter writer)
value - current valuecause - cause of the errorwriter - current writerJsonSerializationException if we wrap the exceptions, the cause otherwisepublic void addObjectId(Object object, ObjectIdSerializer<?> id)
addObjectId
object - a Object object.id - a ObjectIdSerializer object.public ObjectIdSerializer<?> getObjectId(Object object)
getObjectId
object - a Object object.ObjectIdSerializer object.public void addGenerator(com.fasterxml.jackson.annotation.ObjectIdGenerator<?> generator)
AbstractBeanJsonSerializergenerator - instance of generator to addpublic <T> com.fasterxml.jackson.annotation.ObjectIdGenerator<T> findObjectIdGenerator(com.fasterxml.jackson.annotation.ObjectIdGenerator<T> gen)
AbstractBeanJsonSerializerT - a T object.gen - generator used to find equivalent generatorObjectIdGenerator object.Copyright © 2017. All Rights Reserved.