|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.elkoserver.json.JSONLiteralArray
public class JSONLiteralArray
A literal JSON string, representing an array, undergoing incremental
construction.
Users of this class should call the constructor to begin creation of the
literal, incrementally add to it using the various
addElement() methods, then finally complete it by
calling the finish() method. After the literal is completed, it may
be used as another literal's parameter value.
| Constructor Summary | |
|---|---|
JSONLiteralArray()
Begin a new array literal that will be filled in incrementally. |
|
JSONLiteralArray(EncodeControl control)
Begin a new array literal that will be filled in incrementally. |
|
| Method Summary | |
|---|---|
void |
addElement(boolean value)
Add a boolean element to an incomplete array. |
void |
addElement(double value)
Add a floating point element to an incomplete array. |
void |
addElement(Encodable value)
Add an object element to an incomplete array. |
void |
addElement(int value)
Add an integer element to an incomplete array. |
void |
addElement(JSONObject value)
Add a JSON object element to an incomplete array. |
void |
addElement(long value)
Add a long element to an incomplete array. |
void |
addElement(Object value)
Add an element to the incomplete array literal. |
void |
addElement(Referenceable value)
Add a reference element to an incomplete array. |
void |
addElement(String value)
Add a string element to an incomplete array. |
void |
finish()
Finish construction of the literal. |
String |
sendableString()
Obtain a string representation of this literal suitable for output to a connection. |
int |
size()
Obtain the array's element count. |
String |
toString()
Obtain a printable String representation of this literal, in whatever its current state is. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JSONLiteralArray(EncodeControl control)
control - Encode control determining what flavor of encoding
is being done.public JSONLiteralArray()
| Method Detail |
|---|
public void addElement(Object value)
value - The element value.
Error - if you try to add an element to literal that is already
complete.public void addElement(Encodable value)
value - The (Encodable) element value.public void addElement(double value)
value - The (double) element value.public void addElement(boolean value)
value - The (boolean) element value.public void addElement(int value)
value - The (int) element value.public void addElement(long value)
value - The (long) element value.public void addElement(JSONObject value)
value - The (JSONObject) element value.public void addElement(Referenceable value)
value - The (Referenceable) element value.public void addElement(String value)
value - The (String) element value.public void finish()
Error - if you try to finish a literal that is already complete.public String sendableString()
Error - if the literal is not finished.public int size()
public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||