Package org.elasticsearch.xcontent
Class DotExpandingXContentParser
java.lang.Object
org.elasticsearch.xcontent.FilterXContentParser
org.elasticsearch.xcontent.DotExpandingXContentParser
- All Implemented Interfaces:
Closeable
,AutoCloseable
,XContentParser
An XContentParser that reinterprets field names containing dots as an object structure.
A field name named
"foo.bar.baz":...
will be parsed instead as 'foo':{'bar':{'baz':...}}
.
The token location is preserved so that error messages refer to the original content being parsed.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.XContentParser
XContentParser.NumberType, XContentParser.Token
-
Field Summary
Fields inherited from class org.elasticsearch.xcontent.FilterXContentParser
in
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static XContentParser
Wraps an XContentParser such that it re-interprets dots in field names as an object structureUsed for error reporting to highlight where syntax errors occur in content being parsed.void
Methods inherited from class org.elasticsearch.xcontent.FilterXContentParser
allowDuplicateKeys, binaryValue, charBuffer, charBufferOrNull, close, contentType, doubleValue, doubleValue, floatValue, floatValue, getDeprecationHandler, getRestApiVersion, getXContentRegistry, hasTextCharacters, intValue, intValue, isBooleanValue, isClosed, list, listOrderedMap, longValue, longValue, map, map, mapOrdered, mapStrings, namedObject, numberType, objectBytes, objectText, shortValue, shortValue, text, textCharacters, textLength, textOffset
-
Method Details
-
expandDots
Wraps an XContentParser such that it re-interprets dots in field names as an object structure- Parameters:
in
- the parser to wrap- Returns:
- the wrapped XContentParser
- Throws:
IOException
-
nextToken
- Specified by:
nextToken
in interfaceXContentParser
- Overrides:
nextToken
in classFilterXContentParser
- Throws:
IOException
-
getTokenLocation
Description copied from interface:XContentParser
Used for error reporting to highlight where syntax errors occur in content being parsed.- Specified by:
getTokenLocation
in interfaceXContentParser
- Overrides:
getTokenLocation
in classFilterXContentParser
- Returns:
- last token's location or null if cannot be determined
-
currentToken
- Specified by:
currentToken
in interfaceXContentParser
- Overrides:
currentToken
in classFilterXContentParser
-
currentName
- Specified by:
currentName
in interfaceXContentParser
- Overrides:
currentName
in classFilterXContentParser
- Throws:
IOException
-
skipChildren
- Specified by:
skipChildren
in interfaceXContentParser
- Overrides:
skipChildren
in classFilterXContentParser
- Throws:
IOException
-
textOrNull
- Specified by:
textOrNull
in interfaceXContentParser
- Overrides:
textOrNull
in classFilterXContentParser
- Throws:
IOException
-
numberValue
- Specified by:
numberValue
in interfaceXContentParser
- Overrides:
numberValue
in classFilterXContentParser
- Throws:
IOException
-
booleanValue
- Specified by:
booleanValue
in interfaceXContentParser
- Overrides:
booleanValue
in classFilterXContentParser
- Throws:
IOException
-