本文整理匯總了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;
}