Class DefaultMapper<T>

java.lang.Object
net.minidev.json.writer.JsonReaderI<T>
net.minidev.json.writer.DefaultMapper<T>
Type Parameters:
T - the type of object to map

public class DefaultMapper<T> extends JsonReaderI<T>
Simple Reader Class for generic Map
Author:
uriel
  • Constructor Details

    • DefaultMapper

      protected DefaultMapper(JsonReader base)
  • Method Details

    • startObject

      public JsonReaderI<JSONAwareEx> startObject(String key)
      Description copied from class: JsonReaderI
      called when json-smart parser meet an object key
      Overrides:
      startObject in class JsonReaderI<T>
      Parameters:
      key - key name
      Returns:
      a JsonReaderI to handle the object parsing
    • startArray

      public JsonReaderI<JSONAwareEx> startArray(String key)
      Description copied from class: JsonReaderI
      called when json-smart parser start an array.
      Overrides:
      startArray in class JsonReaderI<T>
      Parameters:
      key - the destination key name, or null.
      Returns:
      a JsonReaderI to handle the array parsing
    • createObject

      public 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<T>
      Returns:
      a new object instance
    • createArray

      public 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<T>
      Returns:
      a new array instance
    • setValue

      public void setValue(Object current, String key, Object value)
      Description copied from class: JsonReaderI
      called when json-smart done parsing a value
      Overrides:
      setValue in class JsonReaderI<T>
      Parameters:
      current - the current object being built
      key - the key for the value
      value - the parsed value
    • addValue

      public void addValue(Object current, Object value)
      Description copied from class: JsonReaderI
      add a value in an array json object.
      Overrides:
      addValue in class JsonReaderI<T>
      Parameters:
      current - the current array object
      value - the value to add