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 intFLAG_AGRESSIVEAGRESSIVE have no effect without PROTECT_KEYS or PROTECT_VALUE AGRESSIVE mode allows Json-smart to not protect String containing special charsstatic intFLAG_IGNORE_NULLstatic intFLAG_PROTECT_4WEBstatic intFLAG_PROTECT_KEYSfor advanced usage sample see #see net.minidev.json.test.TestCompressorFlagsstatic intFLAG_PROTECT_VALUESstatic JSONStyleLT_COMPRESSstatic JSONStyleMAX_COMPRESSstatic JSONStyleNO_COMPRESS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidarrayfirstObject(Appendable out)Start the first Array elementvoidarrayNextElm(Appendable out)Start a new Array elementvoidarrayObjectEnd(Appendable out)End of an Array elementvoidarrayStart(Appendable out)Array startvoidarrayStop(Appendable out)Array Donevoidescape(String s, Appendable out)booleanignoreNull()booleanindent()booleanmustProtectKey(String s)booleanmustProtectValue(String s)voidobjectElmStop(Appendable out)End Of Object elementvoidobjectEndOfKey(Appendable out)end of Key in json ObjectvoidobjectFirstStart(Appendable out)Start the first Object elementvoidobjectNext(Appendable out)Start a new Object elementvoidobjectStart(Appendable out)begin ObjectvoidobjectStop(Appendable out)terminate Objectbooleanprotect4Web()booleanprotectKeys()booleanprotectValues()voidwriteString(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
-
-