當前位置: 首頁>>代碼示例>>Java>>正文


Java KeyDeserializer類代碼示例

本文整理匯總了Java中com.fasterxml.jackson.databind.KeyDeserializer的典型用法代碼示例。如果您正苦於以下問題:Java KeyDeserializer類的具體用法?Java KeyDeserializer怎麽用?Java KeyDeserializer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


KeyDeserializer類屬於com.fasterxml.jackson.databind包,在下文中一共展示了KeyDeserializer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createMapLikeDeserializer

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
public JsonDeserializer<?> createMapLikeDeserializer(DeserializationContext paramDeserializationContext, MapLikeType paramMapLikeType, BeanDescription paramBeanDescription)
{
  JavaType localJavaType1 = paramMapLikeType.getKeyType();
  JavaType localJavaType2 = paramMapLikeType.getContentType();
  DeserializationConfig localDeserializationConfig = paramDeserializationContext.getConfig();
  JsonDeserializer localJsonDeserializer1 = (JsonDeserializer)localJavaType2.getValueHandler();
  KeyDeserializer localKeyDeserializer = (KeyDeserializer)localJavaType1.getValueHandler();
  TypeDeserializer localTypeDeserializer1 = (TypeDeserializer)localJavaType2.getTypeHandler();
  TypeDeserializer localTypeDeserializer2 = localTypeDeserializer1;
  if (localTypeDeserializer1 == null)
    localTypeDeserializer2 = findTypeDeserializer(localDeserializationConfig, localJavaType2);
  JsonDeserializer localJsonDeserializer2 = _findCustomMapLikeDeserializer(paramMapLikeType, localDeserializationConfig, paramBeanDescription, localKeyDeserializer, localTypeDeserializer2, localJsonDeserializer1);
  JsonDeserializer localJsonDeserializer3 = localJsonDeserializer2;
  if ((localJsonDeserializer2 != null) && (this._factoryConfig.hasDeserializerModifiers()))
  {
    Iterator localIterator = this._factoryConfig.deserializerModifiers().iterator();
    while (localIterator.hasNext())
      localJsonDeserializer3 = ((BeanDeserializerModifier)localIterator.next()).modifyMapLikeDeserializer(localDeserializationConfig, paramMapLikeType, paramBeanDescription, localJsonDeserializer3);
  }
  return localJsonDeserializer3;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:22,代碼來源:BasicDeserializerFactory.java

示例2: findStringBasedKeyDeserializer

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
public static KeyDeserializer findStringBasedKeyDeserializer(DeserializationConfig paramDeserializationConfig, JavaType paramJavaType)
{
  BeanDescription localBeanDescription = paramDeserializationConfig.introspect(paramJavaType);
  Constructor localConstructor = localBeanDescription.findSingleArgConstructor(new Class[] { String.class });
  if (localConstructor != null)
  {
    if (paramDeserializationConfig.canOverrideAccessModifiers())
      ClassUtil.checkAndFixAccess(localConstructor);
    return new StdKeyDeserializer.StringCtorKeyDeserializer(localConstructor);
  }
  Method localMethod = localBeanDescription.findFactoryMethod(new Class[] { String.class });
  if (localMethod != null)
  {
    if (paramDeserializationConfig.canOverrideAccessModifiers())
      ClassUtil.checkAndFixAccess(localMethod);
    return new StdKeyDeserializer.StringFactoryKeyDeserializer(localMethod);
  }
  return null;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:20,代碼來源:StdKeyDeserializers.java

示例3: createContextual

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException {
    KeyDeserializer keyDeser = keyDeserializer;
    JsonDeserializer<?> deser = valueDeserializer;
    TypeDeserializer typeDeser = typeDeserializerForValue;

    if ((keyDeser != null) && (deser != null) && (typeDeser == null)) {
        return this;
    }
    if (keyDeser == null) {
        keyDeser = ctxt.findKeyDeserializer(mapType.getKeyType(), property);
    }
    if (deser == null) {
        deser = ctxt.findContextualValueDeserializer(mapType.getContentType(), property);
    }
    if (typeDeser != null) {
        typeDeser = typeDeser.forProperty(property);
    }
    return withResolved(keyDeser, typeDeser, deser);
}
 
開發者ID:v1ctor,項目名稱:jackson-datatype-bolts,代碼行數:20,代碼來源:MapDeserializer.java

示例4: _deserializeEntries

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
@SuppressWarnings("unchecked")
protected T _deserializeEntries(JsonParser jp, DeserializationContext ctxt) throws IOException {
    final KeyDeserializer keyDes = keyDeserializer;
    final JsonDeserializer<?> valueDes = valueDeserializer;
    final TypeDeserializer typeDeser = typeDeserializerForValue;

    MapF<Object, Object> map = newInstance();

    for (; jp.getCurrentToken() == JsonToken.FIELD_NAME; jp.nextToken()) {
        String fieldName = jp.getCurrentName();
        Object key = (keyDes == null) ? fieldName : keyDes.deserializeKey(fieldName, ctxt);
        JsonToken t = jp.nextToken();
        Object value;
        if (t == JsonToken.VALUE_NULL) {
            value = null;
        } else if (typeDeser == null) {
            value = valueDes.deserialize(jp, ctxt);
        } else {
            value = valueDes.deserializeWithType(jp, ctxt, typeDeser);
        }
        map.put(key, value);
    }
    return (T) map.unmodifiable();
}
 
開發者ID:v1ctor,項目名稱:jackson-datatype-bolts,代碼行數:25,代碼來源:MapDeserializer.java

示例5: findMapDeserializer

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
@Override
public JsonDeserializer<?> findMapDeserializer(MapType type, DeserializationConfig config,
                                               BeanDescription beanDesc, KeyDeserializer keyDeserializer,
                                               TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) {

    return forJavaType(type);
}
 
開發者ID:leangen,項目名稱:graphql-spqr,代碼行數:8,代碼來源:ConvertingDeserializers.java

示例6: findMapDeserializer

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
@Override
public JsonDeserializer<?> findMapDeserializer(MapType type,
                                               DeserializationConfig config, BeanDescription beanDesc,
                                               KeyDeserializer keyDeserializer,
                                               TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer)
        throws JsonMappingException {
    return null;
}
 
開發者ID:blomqvie,項目名稱:android-rxjava-training,代碼行數:9,代碼來源:TotallylazyDeserializers.java

示例7: findMapLikeDeserializer

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
@Override
public JsonDeserializer<?> findMapLikeDeserializer(MapLikeType type,
                                                   DeserializationConfig config, BeanDescription beanDesc,
                                                   KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer,
                                                   JsonDeserializer<?> elementDeserializer)
        throws JsonMappingException {
    return null;
}
 
開發者ID:blomqvie,項目名稱:android-rxjava-training,代碼行數:9,代碼來源:TotallylazyDeserializers.java

示例8: keyDeserializerInstance

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
@Override
public KeyDeserializer keyDeserializerInstance(
		DeserializationConfig deserializationConfig,
		Annotated annotated,
		Class<?> keyDeserializerClass) {
	return null;
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:8,代碼來源:CustomHandlerInstantiator.java

示例9: findKeyDeserializer

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
@Override
public KeyDeserializer findKeyDeserializer(JavaType type, DeserializationConfig config, BeanDescription beanDesc) throws JsonMappingException {
    final Class<?> candidateTT = type.getRawClass();
    if (MetaTinyTypes.isTinyType(candidateTT)) {
        return new TinyTypesKeyDeserializer(candidateTT);
    }

    return null;
}
 
開發者ID:caligin,項目名稱:tinytypes,代碼行數:10,代碼來源:TinyTypesKeyDeserializers.java

示例10: yieldsKeyDeserializerForAnyKindOfTinyType

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
@Theory
public void yieldsKeyDeserializerForAnyKindOfTinyType(Class<?> tinyType) throws JsonMappingException {
    final JavaType tinyTypeType = TypeFactory.defaultInstance().uncheckedSimpleType(tinyType);
    final KeyDeserializer got = new TinyTypesKeyDeserializers().findKeyDeserializer(tinyTypeType, null, null);
    Assert.assertNotNull(got);

}
 
開發者ID:caligin,項目名稱:tinytypes,代碼行數:8,代碼來源:TinyTypesKeyDeserializersTest.java

示例11: addDeserializer

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
public SimpleKeyDeserializers addDeserializer(Class<?> paramClass, KeyDeserializer paramKeyDeserializer)
{
  if (this._classMappings == null)
    this._classMappings = new HashMap();
  this._classMappings.put(new ClassKey(paramClass), paramKeyDeserializer);
  return this;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:8,代碼來源:SimpleKeyDeserializers.java

示例12: addKeyDeserializer

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
public SimpleModule addKeyDeserializer(Class<?> paramClass, KeyDeserializer paramKeyDeserializer)
{
  if (this._keyDeserializers == null)
    this._keyDeserializers = new SimpleKeyDeserializers();
  this._keyDeserializers.addDeserializer(paramClass, paramKeyDeserializer);
  return this;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:8,代碼來源:SimpleModule.java

示例13: findKeyDeserializer

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
public Class<? extends KeyDeserializer> findKeyDeserializer(Annotated paramAnnotated)
{
  JsonDeserialize localJsonDeserialize = (JsonDeserialize)paramAnnotated.getAnnotation(JsonDeserialize.class);
  if (localJsonDeserialize != null)
  {
    Class localClass = localJsonDeserialize.keyUsing();
    if (localClass != KeyDeserializer.None.class)
      return localClass;
  }
  return null;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:12,代碼來源:JacksonAnnotationIntrospector.java

示例14: _createEnumKeyDeserializer

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
private KeyDeserializer _createEnumKeyDeserializer(DeserializationContext paramDeserializationContext, JavaType paramJavaType)
{
  DeserializationConfig localDeserializationConfig = paramDeserializationContext.getConfig();
  BeanDescription localBeanDescription = localDeserializationConfig.introspect(paramJavaType);
  JsonDeserializer localJsonDeserializer = findDeserializerFromAnnotation(paramDeserializationContext, localBeanDescription.getClassInfo());
  if (localJsonDeserializer != null)
    return StdKeyDeserializers.constructDelegatingKeyDeserializer(localDeserializationConfig, paramJavaType, localJsonDeserializer);
  Class localClass = paramJavaType.getRawClass();
  if (_findCustomEnumDeserializer(localClass, localDeserializationConfig, localBeanDescription) != null)
    return StdKeyDeserializers.constructDelegatingKeyDeserializer(localDeserializationConfig, paramJavaType, localJsonDeserializer);
  EnumResolver localEnumResolver = constructEnumResolver(localClass, localDeserializationConfig, localBeanDescription.findJsonValueMethod());
  Iterator localIterator = localBeanDescription.getFactoryMethods().iterator();
  while (localIterator.hasNext())
  {
    AnnotatedMethod localAnnotatedMethod = (AnnotatedMethod)localIterator.next();
    if (localDeserializationConfig.getAnnotationIntrospector().hasCreatorAnnotation(localAnnotatedMethod))
    {
      if ((localAnnotatedMethod.getParameterCount() == 1) && (localAnnotatedMethod.getRawReturnType().isAssignableFrom(localClass)))
      {
        if (localAnnotatedMethod.getGenericParameterType(0) != String.class)
          throw new IllegalArgumentException("Parameter #0 type for factory method (" + localAnnotatedMethod + ") not suitable, must be java.lang.String");
        if (localDeserializationConfig.canOverrideAccessModifiers())
          ClassUtil.checkAndFixAccess(localAnnotatedMethod.getMember());
        return StdKeyDeserializers.constructEnumKeyDeserializer(localEnumResolver, localAnnotatedMethod);
      }
      throw new IllegalArgumentException("Unsuitable method (" + localAnnotatedMethod + ") decorated with @JsonCreator (for Enum type " + localClass.getName() + ")");
    }
  }
  return StdKeyDeserializers.constructEnumKeyDeserializer(localEnumResolver);
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:31,代碼來源:BasicDeserializerFactory.java

示例15: _findCustomMapDeserializer

import com.fasterxml.jackson.databind.KeyDeserializer; //導入依賴的package包/類
protected JsonDeserializer<?> _findCustomMapDeserializer(MapType paramMapType, DeserializationConfig paramDeserializationConfig, BeanDescription paramBeanDescription, KeyDeserializer paramKeyDeserializer, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer)
{
  Iterator localIterator = this._factoryConfig.deserializers().iterator();
  while (localIterator.hasNext())
  {
    JsonDeserializer localJsonDeserializer = ((Deserializers)localIterator.next()).findMapDeserializer(paramMapType, paramDeserializationConfig, paramBeanDescription, paramKeyDeserializer, paramTypeDeserializer, paramJsonDeserializer);
    if (localJsonDeserializer != null)
      return localJsonDeserializer;
  }
  return null;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:12,代碼來源:BasicDeserializerFactory.java


注:本文中的com.fasterxml.jackson.databind.KeyDeserializer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。