public class JsonObject extends JsonElement
| Constructor and Description | 
|---|
JsonObject()
Constructs a JsonObject to be used in constructing a JSON representation. 
 | 
JsonObject(AttributeValueTable avt)
Constructs a JsonObject from an existing JsonElement,
 using its parser and event list. 
 | 
JsonObject(JsonElement baseElement)
Constructs a JsonObject from an existing JsonElement,
 using its parser and event list. 
 | 
JsonObject(javax.json.stream.JsonParser jsonParser,
          List<String> eventList)
Constructs a JsonObject. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
add(AttributeValueTable avt)
Sets fields from the specified AttributeValueTable. 
 | 
void | 
add(String key,
   boolean value)
Sets a boolean value for the specified key. 
 | 
void | 
add(String key,
   double value)
Sets a double value for the specified key. 
 | 
void | 
add(String key,
   JsonElement value)
Sets a JsonElement value for the specified key. 
 | 
void | 
add(String key,
   long value)
Sets a long value for the specified key. 
 | 
void | 
add(String key,
   String value)
Sets a String value for the specified key. 
 | 
void | 
addNull(String key)
Sets a null value for the specified key. 
 | 
JsonArray | 
getArray(String key)
Gets an array for the specified key. 
 | 
Object | 
getElement(String key)
Gets an element for the specified key. 
 | 
JsonObject | 
getObject(String key)
Gets an object for the specified key. 
 | 
AttributeValue | 
getValue(String key)
Gets a String, number, or boolean value (as an AttributeValue) 
 for the specified key. 
 | 
void | 
parseObject()
Parses the object. 
 | 
void | 
setArray(String key,
        JsonArray value)
Sets a JsonArray value for the specified key. 
 | 
void | 
setElement(String key,
          JsonElement value)
Sets a JsonElement value for the specified key. 
 | 
void | 
setObject(String key,
         JsonObject value)
Sets a JsonObject value for the specified key. 
 | 
void | 
setValue(String key,
        AttributeValue av)
Sets a String, number, or boolean value (as an AttributeValue) 
 for the specified key. 
 | 
AttributeValueTable | 
toAttributeValueTable()
Convert this object to an AttributeValueTable. 
 | 
String | 
toString()
Convert this object to JSON format. 
 | 
contructBooleanValue, contructDoubleValue, contructLongValue, contructLongValue, contructStringValue, getJsonEventStringList, getJsonParser, getNextEvent, getValueAsJsonValuepublic JsonObject()
public JsonObject(javax.json.stream.JsonParser jsonParser,
                  List<String> eventList)
jsonParser - the JSON parser being used to create this objecteventList - the event string listpublic JsonObject(AttributeValueTable avt) throws IfsException
avt - the JsonElement which holds the
                      parser and event listIfsExceptionpublic JsonObject(JsonElement baseElement)
baseElement - the JsonElement which holds the
                      parser and event listpublic AttributeValue getValue(String key)
key - the keypublic JsonObject getObject(String key)
key - the keypublic JsonArray getArray(String key)
key - the keypublic Object getElement(String key)
key - the keypublic void add(String key, String value)
key - the keyvalue - the String valuepublic void add(String key, long value)
key - the keyvalue - the long valuepublic void add(String key, double value)
key - the keyvalue - the double valuepublic void add(String key, boolean value)
key - the keyvalue - the boolean valuepublic void add(String key, JsonElement value)
key - the keyvalue - the JsonElement valuepublic void addNull(String key)
key - the keypublic void add(AttributeValueTable avt)
avt - the AttributeValueTablepublic void setValue(String key, AttributeValue av)
key - the keyav - the AttributeValuepublic void setObject(String key, JsonObject value)
key - the keyvalue - the JsonObject valuepublic void setArray(String key, JsonArray value)
key - the keyvalue - the JsonArray valuepublic void setElement(String key, JsonElement value)
key - the keyvalue - the JsonElement valuepublic String toString()
public AttributeValueTable toAttributeValueTable() throws IfsException
IfsException - if this operation failspublic void parseObject()
Copyright © 2025. All rights reserved.