Class DocumentModel
java.lang.Object
com.inductiveautomation.ignition.client.jsonedit.DocumentModel
- Direct Known Subclasses:
- ComponentPropsDocumentModel,- ReadOnlyDocumentModel
Model that represents a json document, but held in memory as so to be editable by the JSON editor.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final PropertyChangeSupportprotected DocumentNodeprotected JsonSchemastatic final String
- 
Constructor SummaryConstructorsConstructorDescriptionDocumentModel(DocumentNode root) DocumentModel(DocumentNode root, JsonSchema schema) DocumentModel(DocumentElement rootElement) DocumentModel(com.inductiveautomation.ignition.common.gson.JsonElement rootElement) DocumentModel(String json) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddNodeChangeListener(NodeChangeListener listener) voidvoidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) voidaddValidator(DocumentValidator validator) voiddfs(Consumer<DocumentNode> visitor) Depth first tree traversal of the document.protected com.inductiveautomation.ignition.common.gson.JsonElementstatic DocumentNodefromDocument(DocumentElement element) static DocumentNodefromGson(com.inductiveautomation.ignition.common.gson.JsonElement element) Creates a DocumentNode hierarchy from a GSON json tree.com.inductiveautomation.ignition.common.gson.JsonElementgetRoot()protected voidOverride to customize JSON "validator" strategy.booleanisKeyEditable(DocumentNode node) booleanisValueEditable(DocumentNode node) protected voidonNodeChanged(PropertyChangeEvent event) DocumentNodes feed ALL property change events up to the modelbooleanremoveNodeChangeListener(NodeChangeListener listener) voidvoidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) com.inductiveautomation.ignition.common.gson.JsonElementtoJson(DocumentNode node) 
- 
Field Details- 
VALIDATION_RESULTS- See Also:
 
- 
root
- 
schema
- 
change
 
- 
- 
Constructor Details- 
DocumentModel
- 
DocumentModelpublic DocumentModel(com.inductiveautomation.ignition.common.gson.JsonElement rootElement) 
- 
DocumentModel
- 
DocumentModel
- 
DocumentModel
 
- 
- 
Method Details- 
getRoot
- 
getAsJsonTreepublic com.inductiveautomation.ignition.common.gson.JsonElement getAsJsonTree()
- 
toJson
- 
encodeValueAsJsonprotected com.inductiveautomation.ignition.common.gson.JsonElement encodeValueAsJson(DocumentNode node) 
- 
getSchema
- 
onNodeChangedDocumentNodes feed ALL property change events up to the model
- 
isKeyEditable
- 
isValueEditable
- 
addNodeChangeListener
- 
removeNodeChangeListener
- 
addPropertyChangeListener
- 
removePropertyChangeListener
- 
addPropertyChangeListener
- 
removePropertyChangeListener
- 
addValidator
- 
getValidationResults
- 
dfsDepth first tree traversal of the document.
- 
fromGsonpublic static DocumentNode fromGson(com.inductiveautomation.ignition.common.gson.JsonElement element) Creates a DocumentNode hierarchy from a GSON json tree. All value nodes get the AUTO type.
- 
fromDocument
- 
initValidatorsprotected void initValidators()Override to customize JSON "validator" strategy. Default behavior adds a schema validator, if a schema exists, and warns about duplicate or bad quality keys.
 
-