Package net.minidev.json
Class JSONStyle
- java.lang.Object
-
- net.minidev.json.JSONStyle
-
public class JSONStyle extends Object
JSONStyle object configure JSonSerializer reducing output size- Author:
- Uriel Chemouni <[email protected]>
-
-
Field Summary
Fields Modifier and Type Field Description static int
FLAG_AGRESSIVE
AGRESSIVE have no effect without PROTECT_KEYS or PROTECT_VALUE AGRESSIVE mode allows Json-smart to not protect String containing special charsstatic int
FLAG_IGNORE_NULL
static int
FLAG_PROTECT_4WEB
static int
FLAG_PROTECT_KEYS
for advanced usage sample see #see net.minidev.json.test.TestCompressorFlagsstatic int
FLAG_PROTECT_VALUES
static JSONStyle
LT_COMPRESS
static JSONStyle
MAX_COMPRESS
static JSONStyle
NO_COMPRESS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
arrayfirstObject(Appendable out)
Start the first Array elementvoid
arrayNextElm(Appendable out)
Start a new Array elementvoid
arrayObjectEnd(Appendable out)
End of an Array elementvoid
arrayStart(Appendable out)
Array startvoid
arrayStop(Appendable out)
Array Donevoid
escape(String s, Appendable out)
boolean
ignoreNull()
boolean
indent()
boolean
mustProtectKey(String s)
boolean
mustProtectValue(String s)
void
objectElmStop(Appendable out)
End Of Object elementvoid
objectEndOfKey(Appendable out)
end of Key in json Objectvoid
objectFirstStart(Appendable out)
Start the first Object elementvoid
objectNext(Appendable out)
Start a new Object elementvoid
objectStart(Appendable out)
begin Objectvoid
objectStop(Appendable out)
terminate Objectboolean
protect4Web()
boolean
protectKeys()
boolean
protectValues()
void
writeString(Appendable out, String value)
-
-
-
Field Detail
-
FLAG_PROTECT_KEYS
public static final int FLAG_PROTECT_KEYS
for advanced usage sample see #see net.minidev.json.test.TestCompressorFlags- See Also:
- Constant Field Values
-
FLAG_PROTECT_4WEB
public static final int FLAG_PROTECT_4WEB
- See Also:
- Constant Field Values
-
FLAG_PROTECT_VALUES
public static final int FLAG_PROTECT_VALUES
- See Also:
- Constant Field Values
-
FLAG_AGRESSIVE
public static final int FLAG_AGRESSIVE
AGRESSIVE have no effect without PROTECT_KEYS or PROTECT_VALUE AGRESSIVE mode allows Json-smart to not protect String containing special chars- See Also:
- Constant Field Values
-
FLAG_IGNORE_NULL
public static final int FLAG_IGNORE_NULL
- Since:
- 2.1
- See Also:
- Constant Field Values
-
NO_COMPRESS
public static final JSONStyle NO_COMPRESS
-
MAX_COMPRESS
public static final JSONStyle MAX_COMPRESS
-
LT_COMPRESS
public static final JSONStyle LT_COMPRESS
- Since:
- 1.0.9.1
-
-
Method Detail
-
protectKeys
public boolean protectKeys()
-
protectValues
public boolean protectValues()
-
protect4Web
public boolean protect4Web()
-
ignoreNull
public boolean ignoreNull()
-
indent
public boolean indent()
-
mustProtectKey
public boolean mustProtectKey(String s)
-
mustProtectValue
public boolean mustProtectValue(String s)
-
writeString
public void writeString(Appendable out, String value) throws IOException
- Throws:
IOException
-
escape
public void escape(String s, Appendable out)
-
objectStart
public void objectStart(Appendable out) throws IOException
begin Object- Throws:
IOException
-
objectStop
public void objectStop(Appendable out) throws IOException
terminate Object- Throws:
IOException
-
objectFirstStart
public void objectFirstStart(Appendable out) throws IOException
Start the first Object element- Throws:
IOException
-
objectNext
public void objectNext(Appendable out) throws IOException
Start a new Object element- Throws:
IOException
-
objectElmStop
public void objectElmStop(Appendable out) throws IOException
End Of Object element- Throws:
IOException
-
objectEndOfKey
public void objectEndOfKey(Appendable out) throws IOException
end of Key in json Object- Throws:
IOException
-
arrayStart
public void arrayStart(Appendable out) throws IOException
Array start- Throws:
IOException
-
arrayStop
public void arrayStop(Appendable out) throws IOException
Array Done- Throws:
IOException
-
arrayfirstObject
public void arrayfirstObject(Appendable out) throws IOException
Start the first Array element- Throws:
IOException
-
arrayNextElm
public void arrayNextElm(Appendable out) throws IOException
Start a new Array element- Throws:
IOException
-
arrayObjectEnd
public void arrayObjectEnd(Appendable out) throws IOException
End of an Array element- Throws:
IOException
-
-