public final class EntityObjectMapper
extends com.fasterxml.jackson.databind.ObjectMapper
Entity
and Key
to and from JSON.entityObjectMapper(Entities)
factory method.Modifier and Type | Field and Description |
---|---|
static com.fasterxml.jackson.core.type.TypeReference<List<Entity>> |
ENTITY_LIST_REFERENCE |
static com.fasterxml.jackson.core.type.TypeReference<List<Key>> |
KEY_LIST_REFERENCE |
_coercionConfigs, _configOverrides, _deserializationConfig, _deserializationContext, _injectableValues, _jsonFactory, _mixIns, _registeredModuleTypes, _rootDeserializers, _serializationConfig, _serializerFactory, _serializerProvider, _subtypeResolver, _typeFactory, DEFAULT_ANNOTATION_INTROSPECTOR, DEFAULT_BASE
Modifier and Type | Method and Description |
---|---|
<T> void |
addDeserializer(Class<T> clazz,
com.fasterxml.jackson.databind.deser.std.StdDeserializer<? extends T> deserializer)
Adds a deserializer to this EntityObjectMapper instance.
|
<T> void |
addSerializer(Class<? extends T> clazz,
com.fasterxml.jackson.databind.ser.std.StdSerializer<T> serializer)
Adds a serializer to this EntityObjectMapper instance.
|
List<Entity> |
deserializeEntities(InputStream inputStream)
Deserializes the given JSON input stream into a list of Entity instances
|
List<Entity> |
deserializeEntities(String jsonString)
Deserializes the given JSON string into a list of Entity instances
|
List<Key> |
deserializeKeys(InputStream inputStream)
Deserializes the given JSON input stream into a list of Key instances
|
List<Key> |
deserializeKeys(String jsonString)
Deserializes the given JSON string into a list of Key instances
|
Entities |
entities() |
static EntityObjectMapper |
entityObjectMapper(Entities entities)
A factory method for
EntityObjectMapper instances. |
String |
serializeEntities(List<Entity> entities)
Serializes the given Entity instances into a JSON string array
|
String |
serializeKeys(List<Key> keys)
Serializes the given Key instances into a JSON string array
|
EntityObjectMapper |
setIncludeForeignKeyValues(boolean includeForeignKeyValues) |
EntityObjectMapper |
setIncludeNullValues(boolean includeNullValues) |
_assertNotNull, _checkInvalidCopy, _configAndWriteValue, _constructDefaultTypeResolverBuilder, _convert, _findRootDeserializer, _initForReading, _newReader, _newReader, _newWriter, _newWriter, _newWriter, _readMapAndClose, _readTreeAndClose, _readValue, _serializerProvider, _verifyNoTrailingTokens, _verifySchemaType, _writeValueAndClose, acceptJsonFormatVisitor, acceptJsonFormatVisitor, activateDefaultTyping, activateDefaultTyping, activateDefaultTyping, activateDefaultTypingAsProperty, addHandler, addMixIn, addMixInAnnotations, canDeserialize, canDeserialize, canSerialize, canSerialize, clearProblemHandlers, coercionConfigDefaults, coercionConfigFor, coercionConfigFor, configOverride, configure, configure, configure, configure, configure, configure, constructType, constructType, convertValue, convertValue, convertValue, copy, copyWith, createArrayNode, createDeserializationContext, createGenerator, createGenerator, createGenerator, createGenerator, createGenerator, createNonBlockingByteArrayParser, createObjectNode, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, deactivateDefaultTyping, defaultClassIntrospector, disable, disable, disable, disable, disable, disable, disable, disableDefaultTyping, enable, enable, enable, enable, enable, enable, enable, enableDefaultTyping, enableDefaultTyping, enableDefaultTyping, enableDefaultTypingAsProperty, findAndRegisterModules, findMixInClassFor, findModules, findModules, generateJsonSchema, getDateFormat, getDeserializationConfig, getDeserializationContext, getFactory, getInjectableValues, getNodeFactory, getPolymorphicTypeValidator, getPropertyNamingStrategy, getRegisteredModuleIds, getSerializationConfig, getSerializerFactory, getSerializerProvider, getSerializerProviderInstance, getSubtypeResolver, getTypeFactory, getVisibilityChecker, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, missingNode, mixInCount, nullNode, reader, reader, reader, reader, reader, reader, reader, reader, reader, reader, reader, readerFor, readerFor, readerFor, readerForArrayOf, readerForListOf, readerForMapOf, readerForUpdating, readerWithView, readTree, readTree, readTree, readTree, readTree, readTree, readTree, readTree, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValues, readValues, readValues, readValues, registerModule, registerModules, registerModules, registerSubtypes, registerSubtypes, registerSubtypes, setAccessorNaming, setAnnotationIntrospector, setAnnotationIntrospectors, setBase64Variant, setConfig, setConfig, setConstructorDetector, setDateFormat, setDefaultAttributes, setDefaultLeniency, setDefaultMergeable, setDefaultPrettyPrinter, setDefaultPropertyInclusion, setDefaultPropertyInclusion, setDefaultSetterInfo, setDefaultTyping, setDefaultVisibility, setFilterProvider, setFilters, setHandlerInstantiator, setInjectableValues, setLocale, setMixInAnnotations, setMixInResolver, setMixIns, setNodeFactory, setPolymorphicTypeValidator, setPropertyInclusion, setPropertyNamingStrategy, setSerializationInclusion, setSerializerFactory, setSerializerProvider, setSubtypeResolver, setTimeZone, setTypeFactory, setVisibility, setVisibility, setVisibilityChecker, tokenStreamFactory, treeAsTokens, treeToValue, treeToValue, updateValue, valueToTree, version, writer, writer, writer, writer, writer, writer, writer, writer, writer, writer, writerFor, writerFor, writerFor, writerWithDefaultPrettyPrinter, writerWithType, writerWithType, writerWithType, writerWithView, writeTree, writeTree, writeValue, writeValue, writeValue, writeValue, writeValue, writeValueAsBytes, writeValueAsString
public static final com.fasterxml.jackson.core.type.TypeReference<List<Key>> KEY_LIST_REFERENCE
public Entities entities()
public EntityObjectMapper setIncludeForeignKeyValues(boolean includeForeignKeyValues)
includeForeignKeyValues
- if true then the foreign key graph is included in serialized entitiesEntityObjectMapper
instancepublic EntityObjectMapper setIncludeNullValues(boolean includeNullValues)
includeNullValues
- true if null values should be included in exported entitiesEntityObjectMapper
instancepublic String serializeEntities(List<Entity> entities) throws com.fasterxml.jackson.core.JsonProcessingException
entities
- the entitiescom.fasterxml.jackson.core.JsonProcessingException
- in case of an exceptionpublic List<Entity> deserializeEntities(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException
jsonString
- the JSON string to parsecom.fasterxml.jackson.core.JsonProcessingException
- in case of an exceptionpublic List<Entity> deserializeEntities(InputStream inputStream) throws IOException
inputStream
- the JSON input stream to parseIOException
- in case of an exceptionpublic String serializeKeys(List<Key> keys) throws com.fasterxml.jackson.core.JsonProcessingException
keys
- the keyscom.fasterxml.jackson.core.JsonProcessingException
- in case of an exceptionpublic List<Key> deserializeKeys(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException
jsonString
- the JSON string to parsecom.fasterxml.jackson.core.JsonProcessingException
- in case of an exceptionpublic List<Key> deserializeKeys(InputStream inputStream) throws IOException
inputStream
- the JSON input stream to parseIOException
- in case of an exceptionpublic <T> void addSerializer(Class<? extends T> clazz, com.fasterxml.jackson.databind.ser.std.StdSerializer<T> serializer)
T
- the typeclazz
- the classserializer
- the serializerpublic <T> void addDeserializer(Class<T> clazz, com.fasterxml.jackson.databind.deser.std.StdDeserializer<? extends T> deserializer)
T
- the typeclazz
- the classdeserializer
- the deserializerpublic static EntityObjectMapper entityObjectMapper(Entities entities)
EntityObjectMapper
instances.entities
- the domain entitiesEntityObjectMapper
instance based on the given entities