public class JsonLineMapper extends java.lang.Object implements LineMapper<java.util.Map<java.lang.String,java.lang.Object>>
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}}
Constructor and Description |
---|
JsonLineMapper() |
Modifier and Type | Method and Description |
---|---|
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.
|
public java.util.Map<java.lang.String,java.lang.Object> mapLine(java.lang.String line, int lineNumber) throws java.lang.Exception
mapLine
in interface LineMapper<java.util.Map<java.lang.String,java.lang.Object>>
line
- to be mappedlineNumber
- of the current linejava.lang.Exception
- if error occurred while parsing.LineMapper.mapLine(String, int)