|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.minidev.json.JSONStyle
net.minidev.json.JSONStyler
public class JSONStyler
This class is used to format JSon output, fot a better humain readability
Field Summary |
---|
Fields inherited from class net.minidev.json.JSONStyle |
---|
FLAG_AGRESSIVE, FLAG_PROTECT_4WEB, FLAG_PROTECT_KEYS, FLAG_PROTECT_VALUES, MAX_COMPRESS, NO_COMPRESS |
Constructor Summary | |
---|---|
JSONStyler()
|
|
JSONStyler(int FLAG)
|
|
JSONStyler(int FLAG,
int nbLevel)
|
Method Summary | |
---|---|
boolean |
endArray()
Receive notification of the end of a JSON array. |
void |
endJSON()
Receive notification of the end of JSON processing. |
boolean |
endObject()
Receive notification of the end of a JSON object. |
boolean |
endObjectEntry()
Receive notification of the end of the value of previous object entry. |
String |
getNewLine()
|
JSONStyler |
getStyler()
|
boolean |
indent()
|
boolean |
primitive(Object value)
Receive notification of the JSON primitive values: java.lang.String, java.lang.Number, java.lang.Boolean null |
void |
setIdentLevel(int nbLevel)
|
void |
setOutput(Appendable out)
|
boolean |
startArray()
Receive notification of the beginning of a JSON array. |
void |
startJSON()
Receive notification of the beginning of JSON processing. |
boolean |
startObject()
Receive notification of the beginning of a JSON object. |
boolean |
startObjectEntry(String key)
Receive notification of the beginning of a JSON object entry. |
Methods inherited from class net.minidev.json.JSONStyle |
---|
escape, mustProtectKey, mustProtectValue, protect4Web, protectKeys, protectValues |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSONStyler(int FLAG)
public JSONStyler(int FLAG, int nbLevel)
public JSONStyler()
Method Detail |
---|
public void setOutput(Appendable out)
public void setIdentLevel(int nbLevel)
public boolean indent()
indent
in class JSONStyle
public String getNewLine()
public JSONStyler getStyler()
public void startJSON() throws ParseException
ContentHandler
startJSON
in interface ContentHandler
ParseException
- - JSONParser will stop and throw the same exception to the caller when receiving this exception.public void endJSON() throws ParseException
ContentHandler
endJSON
in interface ContentHandler
ParseException
public boolean startObject() throws ParseException
ContentHandler
startObject
in interface ContentHandler
ParseException
- - JSONParser will stop and throw the same exception to the caller when receiving this exception.ContentHandler.endJSON()
public boolean endObject() throws ParseException
ContentHandler
endObject
in interface ContentHandler
ParseException
ContentHandler.startObject()
public boolean startObjectEntry(String key) throws ParseException
ContentHandler
startObjectEntry
in interface ContentHandler
key
- - Key of a JSON object entry.
ParseException
ContentHandler.endObjectEntry()
public boolean endObjectEntry() throws ParseException
ContentHandler
endObjectEntry
in interface ContentHandler
ParseException
ContentHandler.startObjectEntry(java.lang.String)
public boolean startArray() throws ParseException
ContentHandler
startArray
in interface ContentHandler
ParseException
ContentHandler.endArray()
public boolean endArray() throws ParseException
ContentHandler
endArray
in interface ContentHandler
ParseException
ContentHandler.startArray()
public boolean primitive(Object value) throws ParseException
ContentHandler
primitive
in interface ContentHandler
value
- - Instance of the following:
java.lang.String,
java.lang.Number,
java.lang.Boolean
null
ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |