本文整理汇总了Java中com.fasterxml.jackson.databind.SerializationConfig.introspect方法的典型用法代码示例。如果您正苦于以下问题:Java SerializationConfig.introspect方法的具体用法?Java SerializationConfig.introspect怎么用?Java SerializationConfig.introspect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.fasterxml.jackson.databind.SerializationConfig
的用法示例。
在下文中一共展示了SerializationConfig.introspect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBeanSerializer
import com.fasterxml.jackson.databind.SerializationConfig; //导入方法依赖的package包/类
public static JsonSerializer<Object> getBeanSerializer(SerializerProvider sp, Class<?> cls) throws JsonMappingException {
final SerializationConfig config = sp.getConfig();
final JavaType type = config.constructType(cls);
final BeanDescription beanDesc = config.introspect(type);
return BeanSerializerFactory.instance.findBeanSerializer(sp, type, beanDesc);
}
示例2: introspect
import com.fasterxml.jackson.databind.SerializationConfig; //导入方法依赖的package包/类
private static BeanDescription introspect(Class<?> type) {
final JavaType javaType;
SerializationConfig sc = Rosetta.getMapper().getSerializationConfig().withView(RosettaProperty.class);
javaType = Rosetta.getMapper().getTypeFactory().constructType(type);
return sc.introspect(javaType);
}
示例3: createSerializer
import com.fasterxml.jackson.databind.SerializationConfig; //导入方法依赖的package包/类
public JsonSerializer<Object> createSerializer(SerializerProvider paramSerializerProvider, JavaType paramJavaType)
{
SerializationConfig localSerializationConfig = paramSerializerProvider.getConfig();
BeanDescription localBeanDescription = localSerializationConfig.introspect(paramJavaType);
JsonSerializer localJsonSerializer = findSerializerFromAnnotation(paramSerializerProvider, localBeanDescription.getClassInfo());
if (localJsonSerializer != null)
return localJsonSerializer;
JavaType localJavaType1 = modifyTypeByAnnotation(localSerializationConfig, localBeanDescription.getClassInfo(), paramJavaType);
boolean bool;
if (localJavaType1 == paramJavaType)
{
bool = false;
}
else
{
bool = true;
if (!localJavaType1.hasRawClass(paramJavaType.getRawClass()))
localBeanDescription = localSerializationConfig.introspect(localJavaType1);
}
Converter localConverter = localBeanDescription.findSerializationConverter();
if (localConverter == null)
return _createSerializer2(paramSerializerProvider, localJavaType1, localBeanDescription, bool);
JavaType localJavaType2 = localConverter.getOutputType(paramSerializerProvider.getTypeFactory());
if (!localJavaType2.hasRawClass(localJavaType1.getRawClass()))
localBeanDescription = localSerializationConfig.introspect(localJavaType2);
return new StdDelegatingSerializer(localConverter, localJavaType2, _createSerializer2(paramSerializerProvider, localJavaType2, localBeanDescription, true));
}