Package jminusminus
Class JSONElement
java.lang.Object
jminusminus.JSONElement
Representation of an element with a JSON document.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(String name, String value) Adds an attribute to this JSON element with the given name and value.void
addAttribute
(String name, ArrayList<String> value) Adds an attribute to this JSON element with the given name and value as a list of strings.void
addChild
(String name, JSONElement child) Adds a child to this JSON element with the given name.toString()
Returns a string representation of this JSON element.
-
Constructor Details
-
JSONElement
public JSONElement()Constructs an empty JSON element.
-
-
Method Details
-
addAttribute
Adds an attribute to this JSON element with the given name and value.- Parameters:
name
- name of the attribute.value
- value of the attribute.
-
addAttribute
Adds an attribute to this JSON element with the given name and value as a list of strings.- Parameters:
name
- name of the attribute.value
- value of the attribute as a list of strings.
-
addChild
Adds a child to this JSON element with the given name.- Parameters:
name
- name of the child.child
- the child.
-
toString
Returns a string representation of this JSON element.
-