|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.json.JSONCollection
public abstract class JSONCollection
Base class for JSONArray and JSONObject that exists to organize the code
for printing such objects (either compact or pretty).
| Constructor Summary | |
|---|---|
JSONCollection()
|
|
| Method Summary | |
|---|---|
void |
prettyPrint(PrintWriter writer)
Prints the JSONObject to the writer using indentation (two spaces per indentation level). |
void |
print(PrintWriter writer)
Prints the JSONObject to the writer compactly (with no extra whitespace). |
void |
print(PrintWriter writer,
boolean compact)
Prints the JSONObject to the write (compactly or not). |
String |
toCompactString()
Prints the JSONObject as a compact string (not extra punctuation). |
String |
toString()
Converts this JSON collection into a parsable string representation. |
String |
toString(boolean compact)
Converts the JSONObject to a compact or pretty-print string representation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JSONCollection()
| Method Detail |
|---|
public String toString()
Starting in release 5.2, the result will be pretty printed for readability.
toString in class Object{ (left brace) and ending with } (right
brace).public String toString(boolean compact)
compact - if true, return minimal format string.public String toCompactString()
toString().
public void print(PrintWriter writer,
boolean compact)
writer - to write content tocompact - if true, then write compactly, if false, write with pretty printingpublic void print(PrintWriter writer)
public void prettyPrint(PrintWriter writer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||