java.lang.Object
org.springframework.batch.infrastructure.item.file.mapping.JsonLineMapper
All Implemented Interfaces:
LineMapper<Map<String,Object>>

public class JsonLineMapper extends Object implements LineMapper<Map<String,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}}
 
Author:
Dave Syer, Mahmoud Ben Hassine
  • Constructor Details

    • JsonLineMapper

      public JsonLineMapper()
      Create a new JsonLineMapper with a default JsonMapper.
    • JsonLineMapper

      public JsonLineMapper(tools.jackson.databind.json.JsonMapper jsonMapper)
      Create a new JsonLineMapper with the provided JsonMapper.
      Parameters:
      jsonMapper - the json mapper to use
      Since:
      6.0
  • Method Details