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 Summary
FieldsModifier and TypeFieldDescriptionprotected final PropertyChangeSupportprotected DocumentNodeprotected JsonSchemastatic final String - 
Constructor Summary
ConstructorsConstructorDescriptionDocumentModel(DocumentNode root) DocumentModel(DocumentNode root, JsonSchema schema) DocumentModel(DocumentElement rootElement) DocumentModel(com.inductiveautomation.ignition.common.gson.JsonElement rootElement) DocumentModel(String json)  - 
Method Summary
Modifier 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
 - 
DocumentModel
public DocumentModel(com.inductiveautomation.ignition.common.gson.JsonElement rootElement)  - 
DocumentModel
 - 
DocumentModel
 - 
DocumentModel
 
 - 
 - 
Method Details
- 
getRoot
 - 
getAsJsonTree
public com.inductiveautomation.ignition.common.gson.JsonElement getAsJsonTree() - 
toJson
 - 
encodeValueAsJson
protected com.inductiveautomation.ignition.common.gson.JsonElement encodeValueAsJson(DocumentNode node)  - 
getSchema
 - 
onNodeChanged
DocumentNodes feed ALL property change events up to the model - 
isKeyEditable
 - 
isValueEditable
 - 
addNodeChangeListener
 - 
removeNodeChangeListener
 - 
addPropertyChangeListener
 - 
removePropertyChangeListener
 - 
addPropertyChangeListener
 - 
removePropertyChangeListener
 - 
addValidator
 - 
getValidationResults
 - 
dfs
Depth first tree traversal of the document. - 
fromGson
public 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
 - 
initValidators
protected 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. 
 -