public interface DeprecationHandler
XContentParser
that
parsing hit a deprecated field.Modifier and Type | Field | Description |
---|---|---|
static DeprecationHandler |
THROW_UNSUPPORTED_OPERATION |
Throws an
UnsupportedOperationException when parsing hits a
deprecated field. |
Modifier and Type | Method | Description |
---|---|---|
void |
usedDeprecatedField(java.lang.String usedName,
java.lang.String replacedWith) |
Called when the provided field name matches the current field but the entire
field has been marked as deprecated.
|
void |
usedDeprecatedName(java.lang.String usedName,
java.lang.String modernName) |
Called when the provided field name matches a deprecated name for the field.
|
static final DeprecationHandler THROW_UNSUPPORTED_OPERATION
UnsupportedOperationException
when parsing hits a
deprecated field. Use this when creating an XContentParser
that won't interact with deprecation logic at all or when you want
to fail fast when parsing deprecated fields.void usedDeprecatedName(java.lang.String usedName, java.lang.String modernName)
usedName
- the provided field namemodernName
- the modern name for the fieldvoid usedDeprecatedField(java.lang.String usedName, java.lang.String replacedWith)
usedName
- the provided field namereplacedWith
- the name of the field that replaced this field