Module org.elasticsearch.xcontent
Package org.elasticsearch.xcontent
Interface XContentParserConfiguration
public interface XContentParserConfiguration
Configuration for
XContentParser.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final XContentParserConfigurationCreates 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 versionfromXContentParser.getRestApiVersion(), and do no filtering. -
Method Summary
Modifier and TypeMethodDescriptionbooleanregistry()withDeprecationHandler(DeprecationHandler deprecationHandler) Replace the behavior ofXContentParserwhen 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 theclaimedRestApiVersion.
-
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 versionfromXContentParser.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 ofXContentParserwhen it encounters a deprecated field. -
deprecationHandler
DeprecationHandler deprecationHandler() -
withRestApiVersion
Replace theclaimedRestApiVersion. -
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. Specifynullif 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.
-