Class CompessorMapper

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addComma()  
      void addValue​(java.lang.Object current, java.lang.Object value)
      add a value in an array json object.
      private void close​(java.lang.Object obj)  
      CompessorMapper convert​(java.lang.Object current)
      Allow a mapper to convert a temporary structure to the final data format.
      java.lang.Object createArray()
      use to instantiate a new object that will be used as an array
      java.lang.Object createObject()
      use to instantiate a new object that will be used as an object
      private boolean isArray()  
      private boolean isCompressor​(java.lang.Object obj)  
      private boolean isObject()  
      private void open​(java.lang.Object obj)  
      void setValue​(java.lang.Object current, java.lang.String key, java.lang.Object value)
      called when json-smart done parsing a value
      JsonReaderI<?> startArray​(java.lang.String key)
      called when json-smart parser start an array.
      private void startKey​(java.lang.String key)  
      JsonReaderI<?> startObject​(java.lang.String key)
      called when json-smart parser meet an object key
      private void writeValue​(java.lang.Object value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • out

        private java.lang.Appendable out
      • _isObj

        private java.lang.Boolean _isObj
      • needSep

        private boolean needSep
      • isOpen

        private boolean isOpen
      • isClosed

        private boolean isClosed
    • Constructor Detail

      • CompessorMapper

        public CompessorMapper​(JsonReader base,
                               java.lang.Appendable out,
                               JSONStyle compression)
      • CompessorMapper

        public CompessorMapper​(JsonReader base,
                               java.lang.Appendable out,
                               JSONStyle compression,
                               java.lang.Boolean isObj)
    • Method Detail

      • isArray

        private boolean isArray()
      • isObject

        private boolean isObject()
      • isCompressor

        private boolean isCompressor​(java.lang.Object obj)
      • startObject

        public JsonReaderI<?> startObject​(java.lang.String key)
                                   throws java.io.IOException
        Description copied from class: JsonReaderI
        called when json-smart parser meet an object key
        Overrides:
        startObject in class JsonReaderI<CompessorMapper>
        Parameters:
        key - key name
        Returns:
        a JsonReaderI to handle the object parsing
        Throws:
        java.io.IOException - if I/O error occurs
      • startArray

        public JsonReaderI<?> startArray​(java.lang.String key)
                                  throws java.io.IOException
        Description copied from class: JsonReaderI
        called when json-smart parser start an array.
        Overrides:
        startArray in class JsonReaderI<CompessorMapper>
        Parameters:
        key - the destination key name, or null.
        Returns:
        a JsonReaderI to handle the array parsing
        Throws:
        java.io.IOException - if I/O error occurs
      • startKey

        private void startKey​(java.lang.String key)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • setValue

        public void setValue​(java.lang.Object current,
                             java.lang.String key,
                             java.lang.Object value)
                      throws java.io.IOException
        Description copied from class: JsonReaderI
        called when json-smart done parsing a value
        Overrides:
        setValue in class JsonReaderI<CompessorMapper>
        Parameters:
        current - the current object being built
        key - the key for the value
        value - the parsed value
        Throws:
        java.io.IOException - if I/O error occurs
      • addValue

        public void addValue​(java.lang.Object current,
                             java.lang.Object value)
                      throws java.io.IOException
        Description copied from class: JsonReaderI
        add a value in an array json object.
        Overrides:
        addValue in class JsonReaderI<CompessorMapper>
        Parameters:
        current - the current array object
        value - the value to add
        Throws:
        java.io.IOException - if I/O error occurs
      • addComma

        private void addComma()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • writeValue

        private void writeValue​(java.lang.Object value)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • createObject

        public java.lang.Object createObject()
        Description copied from class: JsonReaderI
        use to instantiate a new object that will be used as an object
        Overrides:
        createObject in class JsonReaderI<CompessorMapper>
        Returns:
        a new object instance
      • createArray

        public java.lang.Object createArray()
        Description copied from class: JsonReaderI
        use to instantiate a new object that will be used as an array
        Overrides:
        createArray in class JsonReaderI<CompessorMapper>
        Returns:
        a new array instance
      • convert

        public CompessorMapper convert​(java.lang.Object current)
        Description copied from class: JsonReaderI
        Allow a mapper to convert a temporary structure to the final data format.

        example: convert an List<Integer> to an int[]

        Overrides:
        convert in class JsonReaderI<CompessorMapper>
        Parameters:
        current - the current object to convert
        Returns:
        the converted object
      • close

        private void close​(java.lang.Object obj)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • open

        private void open​(java.lang.Object obj)
                   throws java.io.IOException
        Throws:
        java.io.IOException