类 EnumDeserializer

java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<T>
com.fasterxml.jackson.databind.deser.std.StdDeserializer<T>
com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer<Object>
com.fasterxml.jackson.databind.deser.std.EnumDeserializer
所有已实现的接口:
com.fasterxml.jackson.databind.deser.ContextualDeserializer, com.fasterxml.jackson.databind.deser.NullValueProvider, com.fasterxml.jackson.databind.deser.ValueInstantiator.Gettable, Serializable

@Deprecated public class EnumDeserializer extends com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer<Object> implements com.fasterxml.jackson.databind.deser.ContextualDeserializer
已过时。
枚举类反序列化程序类,可以从字符串和整数反序列化指定枚举类的实例。 官方提供的,支持(但不限于)以下接收方式: 1、字符串 如:sex: "M" 2、数字 如:sex: 1 // 数字需要和枚举类的顺序对应,超过会报错。 如Sex 有M、W、N ,则数字只能是 0、1、2 3、数组 还不清楚怎么使用...

我重写了后,增强了以下功能。 1、传递的枚举类型可以是对象. 如: sex: { "code": "M" }

本类跟jackson-databind包中的EnumDeserializer类同包名,利用类加载机制,会加载此类,不会加载到jackson-databind中的类 参考 BasicDeserializerFactory#1495 行代码

版本:
3.2.1
作者:
zuihou
另请参阅:
  • 嵌套类概要

    从类继承的嵌套类/接口 com.fasterxml.jackson.databind.JsonDeserializer

    com.fasterxml.jackson.databind.JsonDeserializer.None
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    protected final Boolean
    已过时。
     
    protected Object[]
    已过时。
     
    protected final boolean
    已过时。
     
    protected final com.fasterxml.jackson.databind.util.CompactStringObjectMap
    已过时。
     
    protected final com.fasterxml.jackson.databind.util.CompactStringObjectMap
    已过时。
     
    protected com.fasterxml.jackson.databind.util.CompactStringObjectMap
    已过时。
     

    从类继承的字段 com.fasterxml.jackson.databind.deser.std.StdDeserializer

    _valueClass, _valueType, F_MASK_ACCEPT_ARRAYS, F_MASK_INT_COERCIONS
  • 构造器概要

    构造器
    限定符
    构造器
    说明
    protected
    EnumDeserializer(EnumDeserializer base, Boolean caseInsensitive)
    已过时。 
    protected
    EnumDeserializer(EnumDeserializer base, Boolean caseInsensitive, Boolean useDefaultValueForUnknownEnum, Boolean useNullForUnknownEnum)
    已过时。
     
     
    EnumDeserializer(com.fasterxml.jackson.databind.util.EnumResolver byNameResolver)
    已过时。 
     
    EnumDeserializer(com.fasterxml.jackson.databind.util.EnumResolver byNameResolver, boolean caseInsensitive, com.fasterxml.jackson.databind.util.EnumResolver byEnumNamingResolver)
    已过时。 
     
    EnumDeserializer(com.fasterxml.jackson.databind.util.EnumResolver byNameResolver, boolean caseInsensitive, com.fasterxml.jackson.databind.util.EnumResolver byEnumNamingResolver, com.fasterxml.jackson.databind.util.EnumResolver toStringResolver)
    已过时。
     
     
    EnumDeserializer(com.fasterxml.jackson.databind.util.EnumResolver byNameResolver, Boolean caseInsensitive)
    已过时。 
  • 方法概要

    修饰符和类型
    方法
    说明
    protected Object
    _deserializeOther(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt)
    已过时。
     
    protected Class<?>
    已过时。
     
    protected Object
    _fromInteger(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt, int index)
    已过时。
     
    protected Object
    _fromString(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt, String text)
    已过时。
     
    protected com.fasterxml.jackson.databind.util.CompactStringObjectMap
    _getToStringLookup(com.fasterxml.jackson.databind.DeserializationContext ctxt)
    已过时。 
    com.fasterxml.jackson.databind.JsonDeserializer<?>
    createContextual(com.fasterxml.jackson.databind.DeserializationContext ctxt, com.fasterxml.jackson.databind.BeanProperty property)
    已过时。
     
    deserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt)
    已过时。
     
    static com.fasterxml.jackson.databind.JsonDeserializer<?>
    deserializerForCreator(com.fasterxml.jackson.databind.DeserializationConfig config, Class<?> enumClass, com.fasterxml.jackson.databind.introspect.AnnotatedMethod factory)
    已过时。 
    static com.fasterxml.jackson.databind.JsonDeserializer<?>
    deserializerForCreator(com.fasterxml.jackson.databind.DeserializationConfig config, Class<?> enumClass, com.fasterxml.jackson.databind.introspect.AnnotatedMethod factory, com.fasterxml.jackson.databind.deser.ValueInstantiator valueInstantiator, com.fasterxml.jackson.databind.deser.SettableBeanProperty[] creatorProps)
    已过时。
     
    static com.fasterxml.jackson.databind.JsonDeserializer<?>
    deserializerForNoArgsCreator(com.fasterxml.jackson.databind.DeserializationConfig config, Class<?> enumClass, com.fasterxml.jackson.databind.introspect.AnnotatedMethod factory)
    已过时。
     
    getEmptyValue(com.fasterxml.jackson.databind.DeserializationContext ctxt)
    已过时。
     
    boolean
    已过时。
     
    com.fasterxml.jackson.databind.type.LogicalType
    已过时。
     
    protected boolean
    useDefaultValueForUnknownEnum(com.fasterxml.jackson.databind.DeserializationContext ctxt)
    已过时。
     
    protected boolean
    useNullForUnknownEnum(com.fasterxml.jackson.databind.DeserializationContext ctxt)
    已过时。
     
    withResolved(Boolean caseInsensitive)
    已过时。 
    withResolved(Boolean caseInsensitive, Boolean useDefaultValueForUnknownEnum, Boolean useNullForUnknownEnum)
    已过时。
     

    从类继承的方法 com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer

    deserialize, deserializeWithType, getEmptyAccessPattern, getNullAccessPattern, supportsUpdate

    从类继承的方法 com.fasterxml.jackson.databind.deser.std.StdDeserializer

    _byteOverflow, _checkBooleanToStringCoercion, _checkCoercionFail, _checkDoubleSpecialValue, _checkFloatSpecialValue, _checkFloatToIntCoercion, _checkFloatToStringCoercion, _checkFromStringCoercion, _checkFromStringCoercion, _checkIntToFloatCoercion, _checkIntToStringCoercion, _checkTextualNull, _checkToStringCoercion, _coerceBooleanFromInt, _coercedTypeDesc, _coercedTypeDesc, _coerceEmptyString, _coerceIntegral, _coerceNullToken, _coerceTextualNull, _deserializeFromArray, _deserializeFromEmpty, _deserializeFromEmptyString, _deserializeFromString, _deserializeWrappedValue, _failDoubleToIntCoercion, _findCoercionFromBlankString, _findCoercionFromEmptyArray, _findCoercionFromEmptyString, _findNullProvider, _hasTextualNull, _intOverflow, _isBlank, _isEmptyOrTextualNull, _isFalse, _isIntNumber, _isNaN, _isNegInf, _isPosInf, _isTrue, _neitherNull, _nonNullNumber, _parseBoolean, _parseBooleanFromInt, _parseBooleanPrimitive, _parseBooleanPrimitive, _parseBytePrimitive, _parseDate, _parseDate, _parseDateFromArray, _parseDouble, _parseDouble, _parseDoublePrimitive, _parseDoublePrimitive, _parseDoublePrimitive, _parseFloatPrimitive, _parseFloatPrimitive, _parseFloatPrimitive, _parseInteger, _parseInteger, _parseIntPrimitive, _parseIntPrimitive, _parseLong, _parseLong, _parseLongPrimitive, _parseLongPrimitive, _parseShortPrimitive, _parseString, _parseString, _reportFailedNullCoerce, _shortOverflow, _verifyEndArrayForSingle, _verifyNullForPrimitive, _verifyNullForPrimitiveCoercion, _verifyNullForScalarCoercion, _verifyNumberForScalarCoercion, _verifyStringForScalarCoercion, findContentNullProvider, findContentNullStyle, findConvertingContentDeserializer, findDeserializer, findFormatFeature, findFormatOverrides, findValueNullProvider, getValueClass, getValueInstantiator, getValueType, getValueType, handledType, handleMissingEndArrayForSingle, handleNestedArrayForSingle, handleUnknownProperty, isDefaultDeserializer, isDefaultKeyDeserializer

    从类继承的方法 com.fasterxml.jackson.databind.JsonDeserializer

    deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyValue, getKnownPropertyNames, getNullValue, getNullValue, getObjectIdReader, replaceDelegatee, unwrappingDeserializer

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • _enumsByIndex

      protected Object[] _enumsByIndex
      已过时。
    • _lookupByName

      protected final com.fasterxml.jackson.databind.util.CompactStringObjectMap _lookupByName
      已过时。
    • _lookupByToString

      protected volatile com.fasterxml.jackson.databind.util.CompactStringObjectMap _lookupByToString
      已过时。
    • _caseInsensitive

      protected final Boolean _caseInsensitive
      已过时。
    • _isFromIntValue

      protected final boolean _isFromIntValue
      已过时。
    • _lookupByEnumNaming

      protected final com.fasterxml.jackson.databind.util.CompactStringObjectMap _lookupByEnumNaming
      已过时。
  • 构造器详细资料

    • EnumDeserializer

      @Deprecated public EnumDeserializer(com.fasterxml.jackson.databind.util.EnumResolver byNameResolver, Boolean caseInsensitive)
      已过时。
    • EnumDeserializer

      @Deprecated public EnumDeserializer(com.fasterxml.jackson.databind.util.EnumResolver byNameResolver, boolean caseInsensitive, com.fasterxml.jackson.databind.util.EnumResolver byEnumNamingResolver)
      已过时。
    • EnumDeserializer

      public EnumDeserializer(com.fasterxml.jackson.databind.util.EnumResolver byNameResolver, boolean caseInsensitive, com.fasterxml.jackson.databind.util.EnumResolver byEnumNamingResolver, com.fasterxml.jackson.databind.util.EnumResolver toStringResolver)
      已过时。
    • EnumDeserializer

      protected EnumDeserializer(EnumDeserializer base, Boolean caseInsensitive, Boolean useDefaultValueForUnknownEnum, Boolean useNullForUnknownEnum)
      已过时。
    • EnumDeserializer

      @Deprecated protected EnumDeserializer(EnumDeserializer base, Boolean caseInsensitive)
      已过时。
    • EnumDeserializer

      @Deprecated public EnumDeserializer(com.fasterxml.jackson.databind.util.EnumResolver byNameResolver)
      已过时。
  • 方法详细资料

    • deserializerForCreator

      @Deprecated public static com.fasterxml.jackson.databind.JsonDeserializer<?> deserializerForCreator(com.fasterxml.jackson.databind.DeserializationConfig config, Class<?> enumClass, com.fasterxml.jackson.databind.introspect.AnnotatedMethod factory)
      已过时。
    • deserializerForCreator

      public static com.fasterxml.jackson.databind.JsonDeserializer<?> deserializerForCreator(com.fasterxml.jackson.databind.DeserializationConfig config, Class<?> enumClass, com.fasterxml.jackson.databind.introspect.AnnotatedMethod factory, com.fasterxml.jackson.databind.deser.ValueInstantiator valueInstantiator, com.fasterxml.jackson.databind.deser.SettableBeanProperty[] creatorProps)
      已过时。
    • deserializerForNoArgsCreator

      public static com.fasterxml.jackson.databind.JsonDeserializer<?> deserializerForNoArgsCreator(com.fasterxml.jackson.databind.DeserializationConfig config, Class<?> enumClass, com.fasterxml.jackson.databind.introspect.AnnotatedMethod factory)
      已过时。
    • withResolved

      public EnumDeserializer withResolved(Boolean caseInsensitive, Boolean useDefaultValueForUnknownEnum, Boolean useNullForUnknownEnum)
      已过时。
    • withResolved

      @Deprecated public EnumDeserializer withResolved(Boolean caseInsensitive)
      已过时。
    • createContextual

      public com.fasterxml.jackson.databind.JsonDeserializer<?> createContextual(com.fasterxml.jackson.databind.DeserializationContext ctxt, com.fasterxml.jackson.databind.BeanProperty property) throws com.fasterxml.jackson.databind.JsonMappingException
      已过时。
      指定者:
      createContextual 在接口中 com.fasterxml.jackson.databind.deser.ContextualDeserializer
      抛出:
      com.fasterxml.jackson.databind.JsonMappingException
    • isCachable

      public boolean isCachable()
      已过时。
      覆盖:
      isCachable 在类中 com.fasterxml.jackson.databind.JsonDeserializer<Object>
    • logicalType

      public com.fasterxml.jackson.databind.type.LogicalType logicalType()
      已过时。
      覆盖:
      logicalType 在类中 com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer<Object>
    • getEmptyValue

      public Object getEmptyValue(com.fasterxml.jackson.databind.DeserializationContext ctxt) throws com.fasterxml.jackson.databind.JsonMappingException
      已过时。
      覆盖:
      getEmptyValue 在类中 com.fasterxml.jackson.databind.JsonDeserializer<Object>
      抛出:
      com.fasterxml.jackson.databind.JsonMappingException
    • deserialize

      public Object deserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws IOException
      已过时。
      指定者:
      deserialize 在类中 com.fasterxml.jackson.databind.JsonDeserializer<Object>
      抛出:
      IOException
    • _fromString

      protected Object _fromString(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt, String text) throws IOException
      已过时。
      抛出:
      IOException
    • _fromInteger

      protected Object _fromInteger(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt, int index) throws IOException
      已过时。
      抛出:
      IOException
    • _deserializeOther

      protected Object _deserializeOther(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws IOException
      已过时。
      抛出:
      IOException
    • _enumClass

      protected Class<?> _enumClass()
      已过时。
    • _getToStringLookup

      @Deprecated protected com.fasterxml.jackson.databind.util.CompactStringObjectMap _getToStringLookup(com.fasterxml.jackson.databind.DeserializationContext ctxt)
      已过时。
    • useNullForUnknownEnum

      protected boolean useNullForUnknownEnum(com.fasterxml.jackson.databind.DeserializationContext ctxt)
      已过时。
    • useDefaultValueForUnknownEnum

      protected boolean useDefaultValueForUnknownEnum(com.fasterxml.jackson.databind.DeserializationContext ctxt)
      已过时。