Module org.elasticsearch.xcontent
Package org.elasticsearch.xcontent
Interface XContentParserConfiguration
public interface XContentParserConfiguration
Configuration for
XContentParser
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final XContentParserConfiguration
Creates parsers that don't supportXContentParser.namedObject(java.lang.Class<T>, java.lang.String, java.lang.Object)
, throw an exception when they see deprecated fields, that return thecurrent version
fromXContentParser.getRestApiVersion()
, and do no filtering. -
Method Summary
Modifier and TypeMethodDescriptionboolean
registry()
withDeprecationHandler
(DeprecationHandler deprecationHandler) Replace the behavior ofXContentParser
when it encounters a deprecated field.withFiltering
(String prefixPath, Set<String> includeStrings, Set<String> excludeStrings, boolean filtersMatchFieldNamesWithDots) Replace the configured filtering.withFiltering
(Set<String> includeStrings, Set<String> excludeStrings, boolean filtersMatchFieldNamesWithDots) withIncludeSourceOnError
(boolean includeSourceOnError) Disable to not include the source in case of parsing errors (defaults to true).withRegistry
(NamedXContentRegistry registry) Replace the registry backingXContentParser.namedObject(java.lang.Class<T>, java.lang.String, java.lang.Object)
.withRestApiVersion
(RestApiVersion restApiVersion) Replace theclaimed
RestApiVersion
.
-
Field Details
-
EMPTY
Creates parsers that don't supportXContentParser.namedObject(java.lang.Class<T>, java.lang.String, java.lang.Object)
, throw an exception when they see deprecated fields, that return thecurrent version
fromXContentParser.getRestApiVersion()
, and do no filtering.
-
-
Method Details
-
withIncludeSourceOnError
Disable to not include the source in case of parsing errors (defaults to true). -
includeSourceOnError
boolean includeSourceOnError() -
withRegistry
Replace the registry backingXContentParser.namedObject(java.lang.Class<T>, java.lang.String, java.lang.Object)
. -
registry
NamedXContentRegistry registry() -
withDeprecationHandler
Replace the behavior ofXContentParser
when it encounters a deprecated field. -
deprecationHandler
DeprecationHandler deprecationHandler() -
withRestApiVersion
Replace theclaimed
RestApiVersion
. -
restApiVersion
RestApiVersion restApiVersion() -
withFiltering
XContentParserConfiguration withFiltering(Set<String> includeStrings, Set<String> excludeStrings, boolean filtersMatchFieldNamesWithDots) -
withFiltering
XContentParserConfiguration withFiltering(String prefixPath, Set<String> includeStrings, Set<String> excludeStrings, boolean filtersMatchFieldNamesWithDots) Replace the configured filtering.- Parameters:
prefixPath
- The path to be prepended to each sub-path before applying the include/exclude rules. Specifynull
if parsing starts from the root.includeStrings
- A set of strings representing paths to include during filtering. If specified, only these paths will be included in parsing.excludeStrings
- A set of strings representing paths to exclude during filtering. If specified, these paths will be excluded from parsing.filtersMatchFieldNamesWithDots
- Indicates whether filters should match field names containing dots ('.') as part of the field name.
-