public class JsonAttributeStore extends Object
AttributeStore object, and
2) Re-expanding a flattened json object from a AttributeStore back into a raw nested
json string.
NOTE: It's important that the flatting/re-expansion only be done through these methods.
Metadata is added to various attributes in the flattened representation which acts as a guide for
re-expansion. If this metadata is missing or tampered with externally, this class will yield
unexpected results.| Modifier and Type | Class and Description |
|---|---|
static class |
JsonAttributeStore.FlattenedLevelsComparator
This comparator is used to sort a list of attributes that represent flattened json so that raw json can
be reconstructed with array sort order already in tact.
|
| Modifier and Type | Method and Description |
|---|---|
static Collection<org.calrissian.mango.domain.Attribute> |
fromJson(com.fasterxml.jackson.databind.node.ObjectNode object)
Flattens a raw nested json string representation into a collection of attributes that
can be used to construct a
AttributeStore implementation. |
static Collection<org.calrissian.mango.domain.Attribute> |
fromJson(String json,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Flattens a raw nested json string representation into a collection of attributes that can be used to construct a
AttributeStore implementation. |
static Collection<org.calrissian.mango.domain.Attribute> |
fromMap(Map<String,Object> map)
Flattens a Map
AttributeStore implementation. |
static String |
toJsonString(Collection<org.calrissian.mango.domain.Attribute> attributeCollection,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Re-expands a flattened json representation from a
AttributeStore back into a raw
nested json string. |
static Map<String,Object> |
toObject(Collection<org.calrissian.mango.domain.Attribute> attributeCollection)
Re-expands a nested attribute representation from a
AttributeStore back into a nested
java object representation (objects become Map |
public static Collection<org.calrissian.mango.domain.Attribute> fromJson(com.fasterxml.jackson.databind.node.ObjectNode object) throws IOException
AttributeStore implementation.IOExceptionpublic static Collection<org.calrissian.mango.domain.Attribute> fromJson(String json, com.fasterxml.jackson.databind.ObjectMapper objectMapper) throws IOException
AttributeStore implementation. This method has the same effect as
fromJson(com.fasterxml.jackson.databind.node.ObjectNode), except it takes a json as a string
and a configured object mapper instance.IOExceptionpublic static Collection<org.calrissian.mango.domain.Attribute> fromMap(Map<String,Object> map)
AttributeStore implementation. This allows objects which have
already been parsed from json strings and processed to be turned into attribute stores as well.public static String toJsonString(Collection<org.calrissian.mango.domain.Attribute> attributeCollection, com.fasterxml.jackson.databind.ObjectMapper objectMapper) throws com.fasterxml.jackson.core.JsonProcessingException
AttributeStore back into a raw
nested json string.com.fasterxml.jackson.core.JsonProcessingExceptionpublic static Map<String,Object> toObject(Collection<org.calrissian.mango.domain.Attribute> attributeCollection)
AttributeStore back into a nested
java object representation (objects become MapCopyright © 2017 Calrissian. All rights reserved.