类 JsonLineMapper

  • 所有已实现的接口:
    LineMapper<java.util.Map<java.lang.String,​java.lang.Object>>

    public class JsonLineMapper
    extends java.lang.Object
    implements LineMapper<java.util.Map<java.lang.String,​java.lang.Object>>
    Interpret a line as a JSON object and parse it up to a Map. The line should be a standard JSON object, starting with "{" and ending with "}" and composed of name:value pairs separated by commas. Whitespace is ignored, e.g.
     { "foo" : "bar", "value" : 123 }
     
    The values can also be JSON objects (which are converted to maps):
     { "foo": "bar", "map": { "one": 1, "two": 2}}
     
    作者:
    Dave Syer
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      java.util.Map<java.lang.String,​java.lang.Object>mapLine​(java.lang.String line, int lineNumber)
      Interpret the line as a Json object and create a Map from it.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • mapLine

        public java.util.Map<java.lang.String,​java.lang.Object> mapLine​(java.lang.String line,
                                                                              int lineNumber)
                                                                       throws java.lang.Exception
        Interpret the line as a Json object and create a Map from it.
        指定者:
        mapLine 在接口中 LineMapper<java.util.Map<java.lang.String,​java.lang.Object>>
        参数:
        line - to be mapped
        lineNumber - of the current line
        返回:
        mapped object of type T
        抛出:
        java.lang.Exception - if error occurred while parsing.
        另请参阅:
        LineMapper.mapLine(String, int)