Package net.minidev.json
Class JSONStyle
- java.lang.Object
-
- net.minidev.json.JSONStyle
-
public class JSONStyle extends java.lang.ObjectJSONStyle object configure JSonSerializer reducing output size
-
-
Field Summary
Fields Modifier and Type Field Description private boolean_ignore_nullprivate boolean_protect4Webprivate boolean_protectKeysprivate boolean_protectValuesprivate JStylerObj.StringProtectorescstatic 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 seestatic intFLAG_PROTECT_VALUESstatic JSONStyleLT_COMPRESSstatic JSONStyleMAX_COMPRESSprivate JStylerObj.MustProtectmpKeyprivate JStylerObj.MustProtectmpValuestatic JSONStyleNO_COMPRESS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidarrayfirstObject(java.lang.Appendable out)Start the first Array elementvoidarrayNextElm(java.lang.Appendable out)Start a new Array elementvoidarrayObjectEnd(java.lang.Appendable out)End of an Array elementvoidarrayStart(java.lang.Appendable out)Array startvoidarrayStop(java.lang.Appendable out)Array Donevoidescape(java.lang.String s, java.lang.Appendable out)booleanignoreNull()booleanindent()booleanmustProtectKey(java.lang.String s)booleanmustProtectValue(java.lang.String s)voidobjectElmStop(java.lang.Appendable out)End Of Object elementvoidobjectEndOfKey(java.lang.Appendable out)end of Key in json ObjectvoidobjectFirstStart(java.lang.Appendable out)Start the first Obeject elementvoidobjectNext(java.lang.Appendable out)Start a new Object elementvoidobjectStart(java.lang.Appendable out)begin ObjectvoidobjectStop(java.lang.Appendable out)terminate Objectbooleanprotect4Web()booleanprotectKeys()booleanprotectValues()voidwriteString(java.lang.Appendable out, java.lang.String value)
-
-
-
Field Detail
-
FLAG_PROTECT_KEYS
public static final int FLAG_PROTECT_KEYS
for advanced usage sample see- See Also:
net.minidev.json.test.TestCompressorFlags, 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
-
_protectKeys
private boolean _protectKeys
-
_protect4Web
private boolean _protect4Web
-
_protectValues
private boolean _protectValues
-
_ignore_null
private boolean _ignore_null
-
mpKey
private JStylerObj.MustProtect mpKey
-
mpValue
private JStylerObj.MustProtect mpValue
-
esc
private JStylerObj.StringProtector esc
-
-
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(java.lang.String s)
-
mustProtectValue
public boolean mustProtectValue(java.lang.String s)
-
writeString
public void writeString(java.lang.Appendable out, java.lang.String value) throws java.io.IOException- Throws:
java.io.IOException
-
escape
public void escape(java.lang.String s, java.lang.Appendable out)
-
objectStart
public void objectStart(java.lang.Appendable out) throws java.io.IOExceptionbegin Object- Throws:
java.io.IOException
-
objectStop
public void objectStop(java.lang.Appendable out) throws java.io.IOExceptionterminate Object- Throws:
java.io.IOException
-
objectFirstStart
public void objectFirstStart(java.lang.Appendable out) throws java.io.IOExceptionStart the first Obeject element- Throws:
java.io.IOException
-
objectNext
public void objectNext(java.lang.Appendable out) throws java.io.IOExceptionStart a new Object element- Throws:
java.io.IOException
-
objectElmStop
public void objectElmStop(java.lang.Appendable out) throws java.io.IOExceptionEnd Of Object element- Throws:
java.io.IOException
-
objectEndOfKey
public void objectEndOfKey(java.lang.Appendable out) throws java.io.IOExceptionend of Key in json Object- Throws:
java.io.IOException
-
arrayStart
public void arrayStart(java.lang.Appendable out) throws java.io.IOExceptionArray start- Throws:
java.io.IOException
-
arrayStop
public void arrayStop(java.lang.Appendable out) throws java.io.IOExceptionArray Done- Throws:
java.io.IOException
-
arrayfirstObject
public void arrayfirstObject(java.lang.Appendable out) throws java.io.IOExceptionStart the first Array element- Throws:
java.io.IOException
-
arrayNextElm
public void arrayNextElm(java.lang.Appendable out) throws java.io.IOExceptionStart a new Array element- Throws:
java.io.IOException
-
arrayObjectEnd
public void arrayObjectEnd(java.lang.Appendable out) throws java.io.IOExceptionEnd of an Array element- Throws:
java.io.IOException
-
-