public final class Document extends DocumentElement
DocumentElement
. This allows for a creating a tree of DocumentElements. The
member elements of this object are maintained in order they were added.Constructor and Description |
---|
Document() |
Document(com.google.gson.JsonObject json) |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String property,
java.lang.Boolean value)
Convenience method to add a boolean member.
|
void |
add(java.lang.String property,
java.lang.Character value)
Convenience method to add a char member.
|
void |
add(java.lang.String property,
DocumentElement value)
Adds a member, which is a name-value pair, to self.
|
void |
add(java.lang.String property,
java.lang.Number value)
Convenience method to add a primitive member.
|
void |
add(java.lang.String property,
java.lang.String value)
Convenience method to add a primitive member.
|
void |
addProperty(java.lang.String property,
java.lang.Object value) |
Document |
deepCopy()
Creates a deep copy of this element and all its children
|
java.util.Set<java.util.Map.Entry<java.lang.String,DocumentElement>> |
entrySet()
Returns a set of members of this object.
|
boolean |
equals(java.lang.Object o) |
DocumentElement |
get(java.lang.String memberName)
Returns the member with the specified name.
|
Document |
getAsDocument(java.lang.String memberName)
Convenience method to get the specified member as a Document.
|
DocumentArray |
getAsDocumentArray(java.lang.String memberName)
Convenience method to get the specified member as a JsonArray.
|
DocumentPrimitive |
getAsDocumentPrimitive(java.lang.String memberName)
Convenience method to get the specified member as a JsonPrimitive element.
|
boolean |
has(java.lang.String memberName)
Convenience method to check if a member with the specified name is present in this object.
|
int |
hashCode() |
java.util.Set<java.lang.String> |
keySet()
Returns a set of members key values.
|
DocumentElement |
remove(java.lang.String property)
Removes the
property from this Document . |
int |
size()
Returns the number of key/value pairs in the object.
|
com.google.gson.JsonObject |
toJsonElement() |
fromJson, getAsBigDecimal, getAsBigInteger, getAsBoolean, getAsByte, getAsCharacter, getAsDocument, getAsDocumentArray, getAsDocumentNull, getAsDocumentPrimitive, getAsDouble, getAsFloat, getAsInt, getAsLong, getAsNumber, getAsShort, getAsString, isDocument, isDocumentArray, isDocumentNull, isDocumentPrimitive, toString
public Document()
public Document(com.google.gson.JsonObject json)
public Document deepCopy()
deepCopy
in class DocumentElement
public com.google.gson.JsonObject toJsonElement()
toJsonElement
in class DocumentElement
public void add(java.lang.String property, DocumentElement value)
property
- name of the member.value
- the member object.public DocumentElement remove(java.lang.String property)
property
from this Document
.property
- name of the member that should be removed.DocumentElement
object that is being removed.public void add(java.lang.String property, java.lang.String value)
property
- name of the member.value
- the string value associated with the member.public void add(java.lang.String property, java.lang.Number value)
property
- name of the member.value
- the number value associated with the member.public void add(java.lang.String property, java.lang.Boolean value)
property
- name of the member.value
- the number value associated with the member.public void add(java.lang.String property, java.lang.Character value)
property
- name of the member.value
- the number value associated with the member.public void addProperty(java.lang.String property, java.lang.Object value)
public java.util.Set<java.util.Map.Entry<java.lang.String,DocumentElement>> entrySet()
public java.util.Set<java.lang.String> keySet()
public int size()
public boolean has(java.lang.String memberName)
memberName
- name of the member that is being checked for presence.public DocumentElement get(java.lang.String memberName)
memberName
- name of the member that is being requested.public DocumentPrimitive getAsDocumentPrimitive(java.lang.String memberName)
memberName
- name of the member being requested.public DocumentArray getAsDocumentArray(java.lang.String memberName)
memberName
- name of the member being requested.public Document getAsDocument(java.lang.String memberName)
memberName
- name of the member being requested.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object