public class JSONFactoryDefault extends java.lang.Object implements JSONFactory<java.lang.Object,java.util.HashMap<java.lang.String,java.lang.Object>,java.util.ArrayList<java.lang.Object>>
Constructor and Description |
---|
JSONFactoryDefault() |
Modifier and Type | Method and Description |
---|---|
void |
addArrayElement(java.util.ArrayList<java.lang.Object> array,
java.lang.Object elem)
Add an element to an array
|
void |
addObjectMember(java.util.HashMap<java.lang.String,java.lang.Object> object,
java.lang.String key,
java.lang.Object val)
Add a member pair to an object
|
java.util.ArrayList<java.lang.Object> |
createArray()
Preate a JSON array
|
java.lang.Object |
createFalse()
Preate a 'false' boolean element
|
java.lang.Object |
createNull()
Preate a 'null' element
|
java.lang.Object |
createNumber(double v)
Preate a number element
|
java.util.HashMap<java.lang.String,java.lang.Object> |
createObject()
Preate a JSON Object
|
java.lang.Object |
createString(java.lang.String str)
Preate a String element
|
java.lang.Object |
createTrue()
Preate a 'true' boolean element
|
public java.util.HashMap<java.lang.String,java.lang.Object> createObject()
JSONFactory
createObject
in interface JSONFactory<java.lang.Object,java.util.HashMap<java.lang.String,java.lang.Object>,java.util.ArrayList<java.lang.Object>>
public void addObjectMember(java.util.HashMap<java.lang.String,java.lang.Object> object, java.lang.String key, java.lang.Object val)
JSONFactory
addObjectMember
in interface JSONFactory<java.lang.Object,java.util.HashMap<java.lang.String,java.lang.Object>,java.util.ArrayList<java.lang.Object>>
public java.util.ArrayList<java.lang.Object> createArray()
JSONFactory
createArray
in interface JSONFactory<java.lang.Object,java.util.HashMap<java.lang.String,java.lang.Object>,java.util.ArrayList<java.lang.Object>>
public void addArrayElement(java.util.ArrayList<java.lang.Object> array, java.lang.Object elem)
JSONFactory
addArrayElement
in interface JSONFactory<java.lang.Object,java.util.HashMap<java.lang.String,java.lang.Object>,java.util.ArrayList<java.lang.Object>>
public java.lang.Object createString(java.lang.String str)
JSONFactory
createString
in interface JSONFactory<java.lang.Object,java.util.HashMap<java.lang.String,java.lang.Object>,java.util.ArrayList<java.lang.Object>>
public java.lang.Object createNumber(double v)
JSONFactory
createNumber
in interface JSONFactory<java.lang.Object,java.util.HashMap<java.lang.String,java.lang.Object>,java.util.ArrayList<java.lang.Object>>
public java.lang.Object createTrue()
JSONFactory
createTrue
in interface JSONFactory<java.lang.Object,java.util.HashMap<java.lang.String,java.lang.Object>,java.util.ArrayList<java.lang.Object>>
public java.lang.Object createFalse()
JSONFactory
createFalse
in interface JSONFactory<java.lang.Object,java.util.HashMap<java.lang.String,java.lang.Object>,java.util.ArrayList<java.lang.Object>>
public java.lang.Object createNull()
JSONFactory
createNull
in interface JSONFactory<java.lang.Object,java.util.HashMap<java.lang.String,java.lang.Object>,java.util.ArrayList<java.lang.Object>>