Modifier and Type | Class and Description |
---|---|
static class |
JSONPathParser.FieldSpec
Specifies a field to be added to the parsed object Map, using JsonPath notation.
|
static class |
JSONPathParser.FieldType
Specifies access behavior for a field.
|
Constructor and Description |
---|
JSONPathParser(List<JSONPathParser.FieldSpec> fieldSpecs,
boolean useFieldDiscovery,
com.fasterxml.jackson.databind.ObjectMapper mapper)
Constructor
|
Modifier and Type | Method and Description |
---|---|
List<String> |
getFieldNames()
Returns the fieldNames that we expect to see in parsed Maps, if known, or null otherwise.
|
Map<String,Object> |
parse(String input)
Parse a String into a Map.
|
void |
setFieldNames(Iterable<String> fieldNames)
Set the fieldNames that you expect to see in parsed Maps.
|
public JSONPathParser(List<JSONPathParser.FieldSpec> fieldSpecs, boolean useFieldDiscovery, com.fasterxml.jackson.databind.ObjectMapper mapper)
fieldSpecs
- List of field specifications.useFieldDiscovery
- If true, automatically add root fields seen in the JSON document to the parsed object Map.
Only fields that contain a singular value or flat list (list containing no subobjects or lists) are automatically added.mapper
- Optionally provide an ObjectMapper, used by the parser for reading the input JSON.public List<String> getFieldNames()
Parser
getFieldNames
in interface Parser<String,Object>
public void setFieldNames(Iterable<String> fieldNames)
Parser
setFieldNames
in interface Parser<String,Object>
Copyright © 2011–2017. All rights reserved.