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


Java BeanDescription.getBeanClass方法代碼示例

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


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

示例1: modifySerializer

import com.fasterxml.jackson.databind.BeanDescription; //導入方法依賴的package包/類
@Override
public JsonSerializer<?> modifySerializer( SerializationConfig config, BeanDescription beanDesc, JsonSerializer<?> serializer ) {

    Class<?> klass = beanDesc.getBeanClass();

    if( klass == Boolean.class ) {
        return new BooleanSerializer( serializer );
    } else if( klass == Integer.class ) {
        return new IntegerSerializer( serializer );
    } else if( klass == Long.class ) {
        return new LongSerializer( serializer );
    } else if( klass == Float.class ) {
        return new FloatSerializer( serializer );
    } else if( klass == Double.class ) {
        return new DoubleSerializer( serializer );
    } else if( klass == BigDecimal.class ) {
        return new BigDecimalSerializer( serializer );
    } else if( ClassUtil.isExtendedBy( klass, Date.class ) ) {
        return new DateSerializer( serializer );
    }

    return serializer;

}
 
開發者ID:NyBatis,項目名稱:NyBatisCore,代碼行數:25,代碼來源:SerializerModifier.java

示例2: modifyDeserializer

import com.fasterxml.jackson.databind.BeanDescription; //導入方法依賴的package包/類
@Override
public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc,
    JsonDeserializer<?> deserializer) {
  // We don't use the @JsonDeserialize annotation since we only want the
  // custom deserializer for the abstract type and not for the actual types.
  if (Service.class == beanDesc.getBeanClass()) {
    return new ServiceDeserializer();
  } else if (Resource.class == beanDesc.getBeanClass()) {
    return new ResourceDeserializer();
  } else if (Profile.class == beanDesc.getBeanClass()) {
    return new ProfileDeserializer((JsonDeserializer<Object>) deserializer);
  }
  return super.modifyDeserializer(config, beanDesc, deserializer);
}
 
開發者ID:dbmdz,項目名稱:iiif-apis,代碼行數:15,代碼來源:DeserializerModifier.java

示例3: modifyDeserializer

import com.fasterxml.jackson.databind.BeanDescription; //導入方法依賴的package包/類
@Override
public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc,
                                              JsonDeserializer<?> deserializer) {
    if (BeanAnnotationProcessor.isOwlClassEntity(beanDesc.getBeanClass())) {
        return new JacksonJsonLdDeserializer(deserializer, beanDesc.getBeanClass());
    }
    return deserializer;
}
 
開發者ID:kbss-cvut,項目名稱:jb4jsonld-jackson,代碼行數:9,代碼來源:JsonLdDeserializerModifier.java

示例4: modifyCollectionSerializer

import com.fasterxml.jackson.databind.BeanDescription; //導入方法依賴的package包/類
public JsonSerializer<?> modifyCollectionSerializer( SerializationConfig config, CollectionType valueType, BeanDescription beanDesc, JsonSerializer<?> serializer ) {

        Class<?> klass = beanDesc.getBeanClass();

        if( ClassUtil.isExtendedBy(klass, Set.class) ) {
            return new SetSerializer( serializer );
        } else {
            return new ListSerializer( serializer );
        }

    }
 
開發者ID:NyBatis,項目名稱:NyBatisCore,代碼行數:12,代碼來源:SerializerModifier.java

示例5: modifySerializer

import com.fasterxml.jackson.databind.BeanDescription; //導入方法依賴的package包/類
@Override
public JsonSerializer<?> modifySerializer(SerializationConfig config, BeanDescription beanDesc, JsonSerializer<?> serializer) {
    if (beanDesc.getBeanClass() == Cell.class) {
        return new CellSerializer((JsonSerializer<Object>) serializer);
    }
    return serializer;
}
 
開發者ID:smartsheet-platform,項目名稱:smartsheet-java-sdk,代碼行數:8,代碼來源:CellSerializerModifier.java

示例6: canModify

import com.fasterxml.jackson.databind.BeanDescription; //導入方法依賴的package包/類
@Override
public boolean canModify(BeanDescription desc) {
    Class<?> clazz = desc.getBeanClass();

    return (Element.class.isAssignableFrom(clazz) || Resource.class.isAssignableFrom(clazz));
}
 
開發者ID:esacinc,項目名稱:sdcct,代碼行數:7,代碼來源:FhirBeanDeserializerModifier.java

示例7: constructBeanSerializer

import com.fasterxml.jackson.databind.BeanDescription; //導入方法依賴的package包/類
protected JsonSerializer<Object> constructBeanSerializer(SerializerProvider paramSerializerProvider, BeanDescription paramBeanDescription)
{
  if (paramBeanDescription.getBeanClass() == Object.class)
    return paramSerializerProvider.getUnknownTypeSerializer(Object.class);
  SerializationConfig localSerializationConfig = paramSerializerProvider.getConfig();
  BeanSerializerBuilder localBeanSerializerBuilder1 = constructBeanSerializerBuilder(paramBeanDescription);
  BeanSerializerBuilder localBeanSerializerBuilder2 = localBeanSerializerBuilder1;
  localBeanSerializerBuilder1.setConfig(localSerializationConfig);
  List localList1 = findBeanProperties(paramSerializerProvider, paramBeanDescription, localBeanSerializerBuilder2);
  Object localObject = localList1;
  if (localList1 == null)
    localObject = new ArrayList();
  if (this._factoryConfig.hasSerializerModifiers())
  {
    Iterator localIterator3 = this._factoryConfig.serializerModifiers().iterator();
    while (localIterator3.hasNext())
      localObject = ((BeanSerializerModifier)localIterator3.next()).changeProperties(localSerializationConfig, paramBeanDescription, (List)localObject);
  }
  List localList2 = filterBeanProperties(localSerializationConfig, paramBeanDescription, (List)localObject);
  if (this._factoryConfig.hasSerializerModifiers())
  {
    Iterator localIterator2 = this._factoryConfig.serializerModifiers().iterator();
    while (localIterator2.hasNext())
      localList2 = ((BeanSerializerModifier)localIterator2.next()).orderProperties(localSerializationConfig, paramBeanDescription, localList2);
  }
  localBeanSerializerBuilder2.setObjectIdWriter(constructObjectIdHandler(paramSerializerProvider, paramBeanDescription, localList2));
  localBeanSerializerBuilder2.setProperties(localList2);
  localBeanSerializerBuilder2.setFilterId(findFilterId(localSerializationConfig, paramBeanDescription));
  AnnotatedMember localAnnotatedMember = paramBeanDescription.findAnyGetter();
  if (localAnnotatedMember != null)
  {
    if (localSerializationConfig.canOverrideAccessModifiers())
      localAnnotatedMember.fixAccess();
    JavaType localJavaType1 = localAnnotatedMember.getType(paramBeanDescription.bindingsForBeanType());
    boolean bool = localSerializationConfig.isEnabled(MapperFeature.USE_STATIC_TYPING);
    JavaType localJavaType2 = localJavaType1.getContentType();
    MapSerializer localMapSerializer = MapSerializer.construct(null, localJavaType1, bool, createTypeSerializer(localSerializationConfig, localJavaType2), null, null);
    localBeanSerializerBuilder2.setAnyGetter(new AnyGetterWriter(new BeanProperty.Std(localAnnotatedMember.getName(), localJavaType2, null, paramBeanDescription.getClassAnnotations(), localAnnotatedMember, false), localAnnotatedMember, localMapSerializer));
  }
  processViews(localSerializationConfig, localBeanSerializerBuilder2);
  if (this._factoryConfig.hasSerializerModifiers())
  {
    Iterator localIterator1 = this._factoryConfig.serializerModifiers().iterator();
    while (localIterator1.hasNext())
      localBeanSerializerBuilder2 = ((BeanSerializerModifier)localIterator1.next()).updateBuilder(localSerializationConfig, paramBeanDescription, localBeanSerializerBuilder2);
  }
  JsonSerializer localJsonSerializer = localBeanSerializerBuilder2.build();
  if ((localJsonSerializer == null) && (paramBeanDescription.hasKnownClassAnnotations()))
    return localBeanSerializerBuilder2.createDummy();
  return localJsonSerializer;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:52,代碼來源:BeanSerializerFactory.java

示例8: findValueInstantiator

import com.fasterxml.jackson.databind.BeanDescription; //導入方法依賴的package包/類
public static ValueInstantiator findValueInstantiator(DeserializationConfig paramDeserializationConfig, BeanDescription paramBeanDescription)
{
  if (paramBeanDescription.getBeanClass() == JsonLocation.class)
    return JsonLocationInstantiator.instance;
  return null;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:7,代碼來源:JacksonDeserializers.java


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