Class Document
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.document.DocumentElement
- 
- com.inductiveautomation.ignition.common.document.Document
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 public final class Document extends DocumentElement A class representing an object type in Json. An object consists of name-value pairs where names are strings, and values are any other type ofDocumentElement. This allows for a creating a tree of DocumentElements. The member elements of this object are maintained in order they were added.- See Also:
- Serialized Form
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String property, DocumentElement value)Adds a member, which is a name-value pair, to self.voidadd(java.lang.String property, java.lang.Boolean value)Convenience method to add a boolean member.voidadd(java.lang.String property, java.lang.Character value)Convenience method to add a char member.voidadd(java.lang.String property, java.lang.Number value)Convenience method to add a primitive member.voidadd(java.lang.String property, java.lang.String value)Convenience method to add a primitive member.voidaddProperty(java.lang.String property, java.lang.Object value)DocumentdeepCopy()Creates a deep copy of this element and all its childrenjava.util.Set<java.util.Map.Entry<java.lang.String,DocumentElement>>entrySet()Returns a set of members of this object.booleanequals(java.lang.Object o)DocumentElementget(java.lang.String memberName)Returns the member with the specified name.DocumentgetAsDocument(java.lang.String memberName)Convenience method to get the specified member as a Document.DocumentArraygetAsDocumentArray(java.lang.String memberName)Convenience method to get the specified member as a JsonArray.DocumentPrimitivegetAsDocumentPrimitive(java.lang.String memberName)Convenience method to get the specified member as a JsonPrimitive element.booleanhas(java.lang.String memberName)Convenience method to check if a member with the specified name is present in this object.inthashCode()java.util.Set<java.lang.String>keySet()Returns a set of members key values.DocumentElementremove(java.lang.String property)Removes thepropertyfrom thisDocument.intsize()Returns the number of key/value pairs in the object.com.inductiveautomation.ignition.common.gson.JsonObjecttoJsonElement()- 
Methods inherited from class com.inductiveautomation.ignition.common.document.DocumentElementfromJson, getAsBigDecimal, getAsBigInteger, getAsBoolean, getAsByte, getAsCharacter, getAsDocument, getAsDocumentArray, getAsDocumentNull, getAsDocumentPrimitive, getAsDouble, getAsFloat, getAsInt, getAsLong, getAsNumber, getAsShort, getAsString, isDocument, isDocumentArray, isDocumentNull, isDocumentPrimitive, toString
 
- 
 
- 
- 
- 
Method Detail- 
deepCopypublic Document deepCopy() Creates a deep copy of this element and all its children- Specified by:
- deepCopyin class- DocumentElement
 
 - 
toJsonElementpublic com.inductiveautomation.ignition.common.gson.JsonObject toJsonElement() - Specified by:
- toJsonElementin class- DocumentElement
 
 - 
addpublic void add(java.lang.String property, DocumentElement value)Adds a member, which is a name-value pair, to self. The name must be a String, but the value can be an arbitrary DocumentElement, thereby allowing you to build a full tree of DocumentElements rooted at this node.- Parameters:
- property- name of the member.
- value- the member object.
 
 - 
removepublic DocumentElement remove(java.lang.String property) Removes thepropertyfrom thisDocument.- Parameters:
- property- name of the member that should be removed.
- Returns:
- the DocumentElementobject that is being removed.
 
 - 
addpublic void add(java.lang.String property, java.lang.String value)Convenience method to add a primitive member. The specified value is converted to a JsonPrimitive of String.- Parameters:
- property- name of the member.
- value- the string value associated with the member.
 
 - 
addpublic void add(java.lang.String property, java.lang.Number value)Convenience method to add a primitive member. The specified value is converted to a JsonPrimitive of Number.- Parameters:
- property- name of the member.
- value- the number value associated with the member.
 
 - 
addpublic void add(java.lang.String property, java.lang.Boolean value)Convenience method to add a boolean member. The specified value is converted to a JsonPrimitive of Boolean.- Parameters:
- property- name of the member.
- value- the number value associated with the member.
 
 - 
addpublic void add(java.lang.String property, java.lang.Character value)Convenience method to add a char member. The specified value is converted to a JsonPrimitive of Character.- Parameters:
- property- name of the member.
- value- the number value associated with the member.
 
 - 
addPropertypublic void addProperty(java.lang.String property, java.lang.Object value)
 - 
entrySetpublic java.util.Set<java.util.Map.Entry<java.lang.String,DocumentElement>> entrySet() Returns a set of members of this object. The set is ordered, and the order is in which the elements were added.- Returns:
- a set of members of this object.
 
 - 
keySetpublic java.util.Set<java.lang.String> keySet() Returns a set of members key values.- Returns:
- a set of member keys as Strings
 
 - 
sizepublic int size() Returns the number of key/value pairs in the object.- Returns:
- the number of key/value pairs in the object.
 
 - 
haspublic boolean has(java.lang.String memberName) Convenience method to check if a member with the specified name is present in this object.- Parameters:
- memberName- name of the member that is being checked for presence.
- Returns:
- true if there is a member with the specified name, false otherwise.
 
 - 
getpublic DocumentElement get(java.lang.String memberName) Returns the member with the specified name.- Parameters:
- memberName- name of the member that is being requested.
- Returns:
- the member matching the name. Null if no such member exists.
 
 - 
getAsDocumentPrimitivepublic DocumentPrimitive getAsDocumentPrimitive(java.lang.String memberName) Convenience method to get the specified member as a JsonPrimitive element.- Parameters:
- memberName- name of the member being requested.
- Returns:
- the JsonPrimitive corresponding to the specified member.
 
 - 
getAsDocumentArraypublic DocumentArray getAsDocumentArray(java.lang.String memberName) Convenience method to get the specified member as a JsonArray.- Parameters:
- memberName- name of the member being requested.
- Returns:
- the JsonArray corresponding to the specified member.
 
 - 
getAsDocumentpublic Document getAsDocument(java.lang.String memberName) Convenience method to get the specified member as a Document.- Parameters:
- memberName- name of the member being requested.
- Returns:
- the Document corresponding to the specified member.
 
 - 
equalspublic boolean equals(java.lang.Object o) - Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 
- 
 
-