Class DataJsonNode
- java.lang.Object
-
- io.github.factoryfx.factory.storage.migration.datamigration.DataJsonNode
-
public class DataJsonNode extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description DataJsonNode(com.fasterxml.jackson.databind.node.ObjectNode jsonNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyRemovedAttribute(DataStorageMetadataDictionary dataStorageMetadataDictionary)<D> DasData(java.lang.Class<D> valueClass, SimpleObjectMapper simpleObjectMapper)java.util.List<DataJsonNode>collectChildrenFromRoot()get children including himselfjava.util.Map<java.lang.String,DataJsonNode>collectChildrenMapFromRoot()voidfixIdsDeepFromRoot(DataStorageMetadataDictionary dataStorageMetadataDictionary)fix objects in removed attributes.<V> VgetArrayAttributeValue(java.lang.String attributeName, java.lang.Class<V> valueClass, SimpleObjectMapper simpleObjectMapper, int index)java.lang.StringgetAttributeIdValue(java.lang.String attributeName)java.util.List<java.lang.String>getAttributes()com.fasterxml.jackson.databind.JsonNodegetAttributeValue(java.lang.String attribute)<V> VgetAttributeValue(java.lang.String attributeName, java.lang.Class<V> valueClass, SimpleObjectMapper simpleObjectMapper)DataJsonNodegetChild(java.lang.String attributeName)DataJsonNodegetChild(java.lang.String attributeName, int index)java.lang.StringgetDataClassName()java.lang.StringgetId()com.fasterxml.jackson.databind.JsonNodegetJsonNode()booleanisData()booleanmatch(java.lang.String dataClassNameFullQualified)voidremoveAttribute(java.lang.String name)voidrenameAttribute(java.lang.String previousAttributeName, java.lang.String newAttributeName)voidrenameClass(java.lang.Class<? extends FactoryBase<?,?>> newDataClass)voidsetAttributeValue(java.lang.String attribute, com.fasterxml.jackson.databind.JsonNode jsonNode)
-
-
-
Method Detail
-
removeAttribute
public void removeAttribute(java.lang.String name)
-
getDataClassName
public java.lang.String getDataClassName()
-
match
public boolean match(java.lang.String dataClassNameFullQualified)
-
renameAttribute
public void renameAttribute(java.lang.String previousAttributeName, java.lang.String newAttributeName)
-
renameClass
public void renameClass(java.lang.Class<? extends FactoryBase<?,?>> newDataClass)
-
getChild
public DataJsonNode getChild(java.lang.String attributeName)
-
getChild
public DataJsonNode getChild(java.lang.String attributeName, int index)
-
getAttributeValue
public com.fasterxml.jackson.databind.JsonNode getAttributeValue(java.lang.String attribute)
-
setAttributeValue
public void setAttributeValue(java.lang.String attribute, com.fasterxml.jackson.databind.JsonNode jsonNode)
-
getAttributeValue
public <V> V getAttributeValue(java.lang.String attributeName, java.lang.Class<V> valueClass, SimpleObjectMapper simpleObjectMapper)
-
getArrayAttributeValue
public <V> V getArrayAttributeValue(java.lang.String attributeName, java.lang.Class<V> valueClass, SimpleObjectMapper simpleObjectMapper, int index)
-
getAttributeIdValue
public java.lang.String getAttributeIdValue(java.lang.String attributeName)
-
isData
public boolean isData()
-
collectChildrenFromRoot
public java.util.List<DataJsonNode> collectChildrenFromRoot()
get children including himself- Returns:
- children
-
getId
public java.lang.String getId()
-
asData
public <D> D asData(java.lang.Class<D> valueClass, SimpleObjectMapper simpleObjectMapper)
-
getAttributes
public java.util.List<java.lang.String> getAttributes()
-
collectChildrenMapFromRoot
public java.util.Map<java.lang.String,DataJsonNode> collectChildrenMapFromRoot()
-
applyRemovedAttribute
public void applyRemovedAttribute(DataStorageMetadataDictionary dataStorageMetadataDictionary)
-
fixIdsDeepFromRoot
public void fixIdsDeepFromRoot(DataStorageMetadataDictionary dataStorageMetadataDictionary)
fix objects in removed attributes. References are serialized using JsonIdentityInfo That means first occurrence is the object and following are just the ids If the first occurrence is a removed attribute Jackson can't read the reference.- Parameters:
dataStorageMetadataDictionary- dataStorageMetadataDictionary
-
getJsonNode
public com.fasterxml.jackson.databind.JsonNode getJsonNode()
-
-