java.lang.Object
org.elasticsearch.xcontent.FilterXContentParser
org.elasticsearch.xcontent.FilterXContentParserWrapper
org.elasticsearch.xcontent.XContentSubParser
org.elasticsearch.xcontent.FlatteningXContentParser
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- XContentParser
A subclass of XContentSubParser that provides the functionality to flatten
 the field names by prefixing them with the provided parent name.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.elasticsearch.xcontent.XContentParserXContentParser.NumberType, XContentParser.Token
- 
Constructor SummaryConstructorsConstructorDescriptionFlatteningXContentParser(XContentParser parser, String parentName) Constructs a FlatteningXContentParser with the given parent name and wraps an existing XContentParser.
- 
Method SummaryModifier and TypeMethodDescriptionRetrieves the name of the current field being parsed.Methods inherited from class org.elasticsearch.xcontent.XContentSubParserclose, isClosed, nextToken, skipChildrenMethods inherited from class org.elasticsearch.xcontent.FilterXContentParserWrapperdelegateMethods inherited from class org.elasticsearch.xcontent.FilterXContentParserallowDuplicateKeys, binaryValue, booleanValue, charBuffer, charBufferOrNull, contentType, currentToken, doubleValue, doubleValue, floatValue, floatValue, getDeprecationHandler, getRestApiVersion, getTokenLocation, getXContentRegistry, hasTextCharacters, intValue, intValue, isBooleanValue, list, listOrderedMap, longValue, longValue, map, map, mapOrdered, mapStrings, namedObject, numberType, numberValue, objectBytes, objectText, optimizedText, optimizedTextOrNull, shortValue, shortValue, text, textCharacters, textLength, textOffset, textOrNullMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.XContentParsernextFieldName
- 
Constructor Details- 
FlatteningXContentParserConstructs a FlatteningXContentParser with the given parent name and wraps an existing XContentParser.- Parameters:
- parser- The XContentParser to be wrapped and extended with flattening functionality.
- parentName- The parent name to be used as a prefix for immediate children.
 
 
- 
- 
Method Details- 
currentNameRetrieves the name of the current field being parsed. If the current parsing level is 1, the returned field name will be constructed by prepending the parent name to the delegate's currentFieldName, otherwise just delegate.- Specified by:
- currentNamein interface- XContentParser
- Overrides:
- currentNamein class- FilterXContentParser
- Returns:
- The current field name, potentially modified by prepending the parent name as a prefix.
- Throws:
- IOException- If an I/O error occurs during parsing.
 
 
-