Class DocumentElement
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.document.DocumentElement
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 - Direct Known Subclasses:
- Document,- DocumentArray,- DocumentNull,- DocumentPrimitive
 
 public abstract class DocumentElement extends java.lang.Object implements java.io.SerializableA class representing an element of Document. It could either be aDocument, aDocumentArray, aDocumentPrimitiveor aDocumentNull.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description DocumentElement()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract DocumentElementdeepCopy()Returns a deep copy of this element.static DocumentElementfromJson(com.inductiveautomation.ignition.common.gson.JsonElement element)Utility method to convert a GsonJsonElementto an Ignition DocumentElement.java.math.BigDecimalgetAsBigDecimal()convenience method to get this element as aBigDecimal.java.math.BigIntegergetAsBigInteger()convenience method to get this element as aBigInteger.booleangetAsBoolean()convenience method to get this element as a boolean value.bytegetAsByte()convenience method to get this element as a primitive byte value.chargetAsCharacter()convenience method to get this element as a primitive character value.DocumentgetAsDocument()convenience method to get this element as aDocument.DocumentArraygetAsDocumentArray()convenience method to get this element as aDocumentArray.DocumentNullgetAsDocumentNull()convenience method to get this element as aDocumentNull.DocumentPrimitivegetAsDocumentPrimitive()convenience method to get this element as aDocumentPrimitive.doublegetAsDouble()convenience method to get this element as a primitive double value.floatgetAsFloat()convenience method to get this element as a primitive float value.intgetAsInt()convenience method to get this element as a primitive integer value.longgetAsLong()convenience method to get this element as a primitive long value.java.lang.NumbergetAsNumber()convenience method to get this element as aNumber.shortgetAsShort()convenience method to get this element as a primitive short value.java.lang.StringgetAsString()convenience method to get this element as a string value.booleanisDocument()provides check for verifying if this element is a Document object or not.booleanisDocumentArray()provides check for verifying if this element is an array or not.booleanisDocumentNull()provides check for verifying if this element represents a null value or not.booleanisDocumentPrimitive()provides check for verifying if this element is a primitive or not.abstract com.inductiveautomation.ignition.common.gson.JsonElementtoJsonElement()java.lang.StringtoString()Returns a String representation of this element.
 
- 
- 
- 
Method Detail- 
fromJsonpublic static DocumentElement fromJson(com.inductiveautomation.ignition.common.gson.JsonElement element) Utility method to convert a GsonJsonElementto an Ignition DocumentElement.
 - 
deepCopypublic abstract DocumentElement deepCopy() Returns a deep copy of this element. Immutable elements like primitives and nulls are not copied.- Since:
- 2.8.2
 
 - 
toJsonElementpublic abstract com.inductiveautomation.ignition.common.gson.JsonElement toJsonElement() 
 - 
isDocumentArraypublic boolean isDocumentArray() provides check for verifying if this element is an array or not.- Returns:
- true if this element is of type DocumentArray, false otherwise.
 
 - 
isDocumentpublic boolean isDocument() provides check for verifying if this element is a Document object or not.- Returns:
- true if this element is of type Document, false otherwise.
 
 - 
isDocumentPrimitivepublic boolean isDocumentPrimitive() provides check for verifying if this element is a primitive or not.- Returns:
- true if this element is of type DocumentPrimitive, false otherwise.
 
 - 
isDocumentNullpublic boolean isDocumentNull() provides check for verifying if this element represents a null value or not.- Returns:
- true if this element is of type DocumentNull, false otherwise.
- Since:
- 1.2
 
 - 
getAsDocumentpublic Document getAsDocument() convenience method to get this element as aDocument. If the element is of some other type, aIllegalStateExceptionwill result. Hence it is best to use this method after ensuring that this element is of the desired type by callingisDocument()first.- Returns:
- get this element as a Document.
- Throws:
- java.lang.IllegalStateException- if the element is of another type.
 
 - 
getAsDocumentArraypublic DocumentArray getAsDocumentArray() convenience method to get this element as aDocumentArray. If the element is of some other type, aIllegalStateExceptionwill result. Hence it is best to use this method after ensuring that this element is of the desired type by callingisDocumentArray()first.- Returns:
- get this element as a DocumentArray.
- Throws:
- java.lang.IllegalStateException- if the element is of another type.
 
 - 
getAsDocumentPrimitivepublic DocumentPrimitive getAsDocumentPrimitive() convenience method to get this element as aDocumentPrimitive. If the element is of some other type, aIllegalStateExceptionwill result. Hence it is best to use this method after ensuring that this element is of the desired type by callingisDocumentPrimitive()first.- Returns:
- get this element as a DocumentPrimitive.
- Throws:
- java.lang.IllegalStateException- if the element is of another type.
 
 - 
getAsDocumentNullpublic DocumentNull getAsDocumentNull() convenience method to get this element as aDocumentNull. If the element is of some other type, aIllegalStateExceptionwill result. Hence it is best to use this method after ensuring that this element is of the desired type by callingisDocumentNull()first.- Returns:
- get this element as a DocumentNull.
- Throws:
- java.lang.IllegalStateException- if the element is of another type.
- Since:
- 1.2
 
 - 
getAsBooleanpublic boolean getAsBoolean() convenience method to get this element as a boolean value.- Returns:
- get this element as a primitive boolean value.
- Throws:
- java.lang.ClassCastException- if the element is of not a- DocumentPrimitiveand is not a valid boolean value.
- java.lang.IllegalStateException- if the element is of the type- DocumentArraybut contains more than a single element.
 
 - 
getAsNumberpublic java.lang.Number getAsNumber() convenience method to get this element as aNumber.- Returns:
- get this element as a Number.
- Throws:
- java.lang.ClassCastException- if the element is of not a- DocumentPrimitiveand is not a valid number.
- java.lang.IllegalStateException- if the element is of the type- DocumentArraybut contains more than a single element.
 
 - 
getAsStringpublic java.lang.String getAsString() convenience method to get this element as a string value.- Returns:
- get this element as a string value.
- Throws:
- java.lang.ClassCastException- if the element is of not a- DocumentPrimitiveand is not a valid string value.
- java.lang.IllegalStateException- if the element is of the type- DocumentArraybut contains more than a single element.
 
 - 
getAsDoublepublic double getAsDouble() convenience method to get this element as a primitive double value.- Returns:
- get this element as a primitive double value.
- Throws:
- java.lang.ClassCastException- if the element is of not a- DocumentPrimitiveand is not a valid double value.
- java.lang.IllegalStateException- if the element is of the type- DocumentArraybut contains more than a single element.
 
 - 
getAsFloatpublic float getAsFloat() convenience method to get this element as a primitive float value.- Returns:
- get this element as a primitive float value.
- Throws:
- java.lang.ClassCastException- if the element is of not a- DocumentPrimitiveand is not a valid float value.
- java.lang.IllegalStateException- if the element is of the type- DocumentArraybut contains more than a single element.
 
 - 
getAsLongpublic long getAsLong() convenience method to get this element as a primitive long value.- Returns:
- get this element as a primitive long value.
- Throws:
- java.lang.ClassCastException- if the element is of not a- DocumentPrimitiveand is not a valid long value.
- java.lang.IllegalStateException- if the element is of the type- DocumentArraybut contains more than a single element.
 
 - 
getAsIntpublic int getAsInt() convenience method to get this element as a primitive integer value.- Returns:
- get this element as a primitive integer value.
- Throws:
- java.lang.ClassCastException- if the element is of not a- DocumentPrimitiveand is not a valid integer value.
- java.lang.IllegalStateException- if the element is of the type- DocumentArraybut contains more than a single element.
 
 - 
getAsBytepublic byte getAsByte() convenience method to get this element as a primitive byte value.- Returns:
- get this element as a primitive byte value.
- Throws:
- java.lang.ClassCastException- if the element is of not a- DocumentPrimitiveand is not a valid byte value.
- java.lang.IllegalStateException- if the element is of the type- DocumentArraybut contains more than a single element.
- Since:
- 1.3
 
 - 
getAsCharacterpublic char getAsCharacter() convenience method to get this element as a primitive character value.- Returns:
- get this element as a primitive char value.
- Throws:
- java.lang.ClassCastException- if the element is of not a- DocumentPrimitiveand is not a valid char value.
- java.lang.IllegalStateException- if the element is of the type- DocumentArraybut contains more than a single element.
- Since:
- 1.3
 
 - 
getAsBigDecimalpublic java.math.BigDecimal getAsBigDecimal() convenience method to get this element as aBigDecimal.- Returns:
- get this element as a BigDecimal.
- Throws:
- java.lang.ClassCastException- if the element is of not a- DocumentPrimitive.
- java.lang.NumberFormatException- if the element is not a valid- BigDecimal.
- java.lang.IllegalStateException- if the element is of the type- DocumentArraybut contains more than a single element.
- Since:
- 1.2
 
 - 
getAsBigIntegerpublic java.math.BigInteger getAsBigInteger() convenience method to get this element as aBigInteger.- Returns:
- get this element as a BigInteger.
- Throws:
- java.lang.ClassCastException- if the element is of not a- DocumentPrimitive.
- java.lang.NumberFormatException- if the element is not a valid- BigInteger.
- java.lang.IllegalStateException- if the element is of the type- DocumentArraybut contains more than a single element.
- Since:
- 1.2
 
 - 
getAsShortpublic short getAsShort() convenience method to get this element as a primitive short value.- Returns:
- get this element as a primitive short value.
- Throws:
- java.lang.ClassCastException- if the element is of not a- DocumentPrimitiveand is not a valid short value.
- java.lang.IllegalStateException- if the element is of the type- DocumentArraybut contains more than a single element.
 
 - 
toStringpublic java.lang.String toString() Returns a String representation of this element.- Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-