Class JSONStyle


  • public class JSONStyle
    extends java.lang.Object
    JSONStyle object configure JSonSerializer reducing output size
    • 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_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
      • 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
    • Constructor Detail

      • JSONStyle

        public JSONStyle​(int FLAG)
      • JSONStyle

        public JSONStyle()
    • 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.IOException
        begin Object
        Throws:
        java.io.IOException
      • objectStop

        public void objectStop​(java.lang.Appendable out)
                        throws java.io.IOException
        terminate Object
        Throws:
        java.io.IOException
      • objectFirstStart

        public void objectFirstStart​(java.lang.Appendable out)
                              throws java.io.IOException
        Start the first Obeject element
        Throws:
        java.io.IOException
      • objectNext

        public void objectNext​(java.lang.Appendable out)
                        throws java.io.IOException
        Start a new Object element
        Throws:
        java.io.IOException
      • objectElmStop

        public void objectElmStop​(java.lang.Appendable out)
                           throws java.io.IOException
        End Of Object element
        Throws:
        java.io.IOException
      • objectEndOfKey

        public void objectEndOfKey​(java.lang.Appendable out)
                            throws java.io.IOException
        end of Key in json Object
        Throws:
        java.io.IOException
      • arrayStart

        public void arrayStart​(java.lang.Appendable out)
                        throws java.io.IOException
        Array start
        Throws:
        java.io.IOException
      • arrayStop

        public void arrayStop​(java.lang.Appendable out)
                       throws java.io.IOException
        Array Done
        Throws:
        java.io.IOException
      • arrayfirstObject

        public void arrayfirstObject​(java.lang.Appendable out)
                              throws java.io.IOException
        Start the first Array element
        Throws:
        java.io.IOException
      • arrayNextElm

        public void arrayNextElm​(java.lang.Appendable out)
                          throws java.io.IOException
        Start a new Array element
        Throws:
        java.io.IOException
      • arrayObjectEnd

        public void arrayObjectEnd​(java.lang.Appendable out)
                            throws java.io.IOException
        End of an Array element
        Throws:
        java.io.IOException