当前位置: 首页>>代码示例>>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;未经允许,请勿转载。