public interface DeprecationHandler
Callback for notifying the creator of the 
XContentParser that
 parsing hit a deprecated field.- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final DeprecationHandlerIgnores all deprecationsstatic final DeprecationHandlerThrows anUnsupportedOperationExceptionwhen parsing hits a deprecated field.
- 
Method SummaryModifier and TypeMethodDescriptionvoidlogRemovedField(String parserName, Supplier<XContentLocation> location, String removedName) Called when the provided field name matches the current field but the entire field has been marked as deprecated with no replacement Emits a compatible api warning instead of deprecation warning when isCompatibleDeprecation is truedefault voidlogRemovedField(String parserName, Supplier<XContentLocation> location, String removedName, boolean isCompatibleDeprecation) voidlogRenamedField(String parserName, Supplier<XContentLocation> location, String oldName, String currentName) Called when the provided field name matches a deprecated name for the field.default voidlogRenamedField(String parserName, Supplier<XContentLocation> location, String oldName, String currentName, boolean isCompatibleDeprecation) voidlogReplacedField(String parserName, Supplier<XContentLocation> location, String oldName, String replacedName) Called when the provided field name matches the current field but the entire field has been marked as deprecated and another field should be useddefault voidlogReplacedField(String parserName, Supplier<XContentLocation> location, String oldName, String replacedName, boolean isCompatibleDeprecation) 
- 
Field Details- 
THROW_UNSUPPORTED_OPERATIONThrows anUnsupportedOperationExceptionwhen parsing hits a deprecated field. Use this when creating anXContentParserthat won't interact with deprecation logic at all or when you want to fail fast when parsing deprecated fields.
- 
IGNORE_DEPRECATIONSIgnores all deprecations
 
- 
- 
Method Details- 
logRenamedFieldvoid logRenamedField(String parserName, Supplier<XContentLocation> location, String oldName, String currentName) Called when the provided field name matches a deprecated name for the field.- Parameters:
- oldName- the provided field name
- currentName- the modern name for the field
 
- 
logReplacedFieldvoid logReplacedField(String parserName, Supplier<XContentLocation> location, String oldName, String replacedName) Called when the provided field name matches the current field but the entire field has been marked as deprecated and another field should be used- Parameters:
- oldName- the provided field name
- replacedName- the name of the field that replaced this field
 
- 
logRemovedFieldCalled when the provided field name matches the current field but the entire field has been marked as deprecated with no replacement Emits a compatible api warning instead of deprecation warning when isCompatibleDeprecation is true- Parameters:
- removedName- the provided field name
 
- 
logRenamedFielddefault void logRenamedField(String parserName, Supplier<XContentLocation> location, String oldName, String currentName, boolean isCompatibleDeprecation) - See Also:
 
- 
logReplacedFielddefault void logReplacedField(String parserName, Supplier<XContentLocation> location, String oldName, String replacedName, boolean isCompatibleDeprecation) - See Also:
 
- 
logRemovedFielddefault void logRemovedField(String parserName, Supplier<XContentLocation> location, String removedName, boolean isCompatibleDeprecation) - See Also:
 
 
-