本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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 );
}
}
示例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;
}
示例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));
}
示例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;
}
示例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;
}