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 TypeMethodDescriptionbooleanstatic XContentParserWraps 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.voidMethods 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:
nextTokenin interfaceXContentParser- Overrides:
nextTokenin classFilterXContentParser- Throws:
IOException
-
getTokenLocation
Description copied from interface:XContentParserUsed for error reporting to highlight where syntax errors occur in content being parsed.- Specified by:
getTokenLocationin interfaceXContentParser- Overrides:
getTokenLocationin classFilterXContentParser- Returns:
- last token's location or null if cannot be determined
-
currentToken
- Specified by:
currentTokenin interfaceXContentParser- Overrides:
currentTokenin classFilterXContentParser
-
currentName
- Specified by:
currentNamein interfaceXContentParser- Overrides:
currentNamein classFilterXContentParser- Throws:
IOException
-
skipChildren
- Specified by:
skipChildrenin interfaceXContentParser- Overrides:
skipChildrenin classFilterXContentParser- Throws:
IOException
-
textOrNull
- Specified by:
textOrNullin interfaceXContentParser- Overrides:
textOrNullin classFilterXContentParser- Throws:
IOException
-
numberValue
- Specified by:
numberValuein interfaceXContentParser- Overrides:
numberValuein classFilterXContentParser- Throws:
IOException
-
booleanValue
- Specified by:
booleanValuein interfaceXContentParser- Overrides:
booleanValuein classFilterXContentParser- Throws:
IOException
-