本文整理汇总了Java中org.codehaus.jackson.map.DeserializerProvider类的典型用法代码示例。如果您正苦于以下问题:Java DeserializerProvider类的具体用法?Java DeserializerProvider怎么用?Java DeserializerProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeserializerProvider类属于org.codehaus.jackson.map包,在下文中一共展示了DeserializerProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCollectionLikeDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
public JsonDeserializer<?> createCollectionLikeDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, CollectionLikeType paramCollectionLikeType, BeanProperty paramBeanProperty)
throws JsonMappingException
{
CollectionLikeType localCollectionLikeType1 = (CollectionLikeType)mapAbstractType(paramDeserializationConfig, paramCollectionLikeType);
BasicBeanDescription localBasicBeanDescription = (BasicBeanDescription)paramDeserializationConfig.introspectClassAnnotations(localCollectionLikeType1.getRawClass());
JsonDeserializer localJsonDeserializer1 = findDeserializerFromAnnotation(paramDeserializationConfig, localBasicBeanDescription.getClassInfo(), paramBeanProperty);
if (localJsonDeserializer1 != null)
return localJsonDeserializer1;
CollectionLikeType localCollectionLikeType2 = (CollectionLikeType)modifyTypeByAnnotation(paramDeserializationConfig, localBasicBeanDescription.getClassInfo(), localCollectionLikeType1, null);
JavaType localJavaType = localCollectionLikeType2.getContentType();
JsonDeserializer localJsonDeserializer2 = (JsonDeserializer)localJavaType.getValueHandler();
TypeDeserializer localTypeDeserializer = (TypeDeserializer)localJavaType.getTypeHandler();
if (localTypeDeserializer == null)
localTypeDeserializer = findTypeDeserializer(paramDeserializationConfig, localJavaType, paramBeanProperty);
return _findCustomCollectionLikeDeserializer(localCollectionLikeType2, paramDeserializationConfig, paramDeserializerProvider, localBasicBeanDescription, paramBeanProperty, localTypeDeserializer, localJsonDeserializer2);
}
示例2: createEnumDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
public JsonDeserializer<?> createEnumDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, JavaType paramJavaType, BeanProperty paramBeanProperty)
throws JsonMappingException
{
BasicBeanDescription localBasicBeanDescription = (BasicBeanDescription)paramDeserializationConfig.introspectForCreation(paramJavaType);
JsonDeserializer localJsonDeserializer1 = findDeserializerFromAnnotation(paramDeserializationConfig, localBasicBeanDescription.getClassInfo(), paramBeanProperty);
if (localJsonDeserializer1 != null)
return localJsonDeserializer1;
Class localClass = paramJavaType.getRawClass();
JsonDeserializer localJsonDeserializer2 = _findCustomEnumDeserializer(localClass, paramDeserializationConfig, localBasicBeanDescription, paramBeanProperty);
if (localJsonDeserializer2 != null)
return localJsonDeserializer2;
Iterator localIterator = localBasicBeanDescription.getFactoryMethods().iterator();
while (localIterator.hasNext())
{
AnnotatedMethod localAnnotatedMethod = (AnnotatedMethod)localIterator.next();
if (!paramDeserializationConfig.getAnnotationIntrospector().hasCreatorAnnotation(localAnnotatedMethod))
continue;
if ((localAnnotatedMethod.getParameterCount() == 1) && (localAnnotatedMethod.getRawType().isAssignableFrom(localClass)))
return EnumDeserializer.deserializerForCreator(paramDeserializationConfig, localClass, localAnnotatedMethod);
throw new IllegalArgumentException("Unsuitable method (" + localAnnotatedMethod + ") decorated with @JsonCreator (for Enum type " + localClass.getName() + ")");
}
return new EnumDeserializer(constructEnumResolver(localClass, paramDeserializationConfig));
}
示例3: createMapLikeDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
public JsonDeserializer<?> createMapLikeDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, MapLikeType paramMapLikeType, BeanProperty paramBeanProperty)
throws JsonMappingException
{
MapLikeType localMapLikeType1 = (MapLikeType)mapAbstractType(paramDeserializationConfig, paramMapLikeType);
BasicBeanDescription localBasicBeanDescription = (BasicBeanDescription)paramDeserializationConfig.introspectForCreation(localMapLikeType1);
JsonDeserializer localJsonDeserializer1 = findDeserializerFromAnnotation(paramDeserializationConfig, localBasicBeanDescription.getClassInfo(), paramBeanProperty);
if (localJsonDeserializer1 != null)
return localJsonDeserializer1;
MapLikeType localMapLikeType2 = (MapLikeType)modifyTypeByAnnotation(paramDeserializationConfig, localBasicBeanDescription.getClassInfo(), localMapLikeType1, null);
JavaType localJavaType1 = localMapLikeType2.getKeyType();
JavaType localJavaType2 = localMapLikeType2.getContentType();
JsonDeserializer localJsonDeserializer2 = (JsonDeserializer)localJavaType2.getValueHandler();
KeyDeserializer localKeyDeserializer = (KeyDeserializer)localJavaType1.getValueHandler();
if (localKeyDeserializer == null)
localKeyDeserializer = paramDeserializerProvider.findKeyDeserializer(paramDeserializationConfig, localJavaType1, paramBeanProperty);
TypeDeserializer localTypeDeserializer = (TypeDeserializer)localJavaType2.getTypeHandler();
if (localTypeDeserializer == null)
localTypeDeserializer = findTypeDeserializer(paramDeserializationConfig, localJavaType2, paramBeanProperty);
return _findCustomMapLikeDeserializer(localMapLikeType2, paramDeserializationConfig, paramDeserializerProvider, localBasicBeanDescription, paramBeanProperty, localKeyDeserializer, localTypeDeserializer, localJsonDeserializer2);
}
示例4: findStdBeanDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
protected JsonDeserializer<Object> findStdBeanDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, JavaType paramJavaType, BeanProperty paramBeanProperty)
throws JsonMappingException
{
JsonDeserializer localJsonDeserializer1 = (JsonDeserializer)_simpleDeserializers.get(paramJavaType);
if (localJsonDeserializer1 != null)
return localJsonDeserializer1;
if (AtomicReference.class.isAssignableFrom(paramJavaType.getRawClass()))
{
JavaType[] arrayOfJavaType = paramDeserializationConfig.getTypeFactory().findTypeParameters(paramJavaType, AtomicReference.class);
if ((arrayOfJavaType == null) || (arrayOfJavaType.length < 1));
for (JavaType localJavaType = TypeFactory.unknownType(); ; localJavaType = arrayOfJavaType[0])
return new StdDeserializer.AtomicReferenceDeserializer(localJavaType, paramBeanProperty);
}
JsonDeserializer localJsonDeserializer2 = this.optionalHandlers.findDeserializer(paramJavaType, paramDeserializationConfig, paramDeserializerProvider);
if (localJsonDeserializer2 != null)
return localJsonDeserializer2;
return null;
}
示例5: findBeanDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
@Override
public JsonDeserializer<?> findBeanDeserializer(JavaType type, DeserializationConfig config,
DeserializerProvider provider, BeanDescription beanDesc, BeanProperty property) throws JsonMappingException {
// Check if we have to find a deserializer for the root level.
if (type.getRawClass() == JsonRootWrapper.class) {
Class contentType = type.containedType(0).getRawClass();
// Check if a deserializer already exists
if (deserializers.containsKey(contentType)) {
return deserializers.get(contentType);
} else {
// Create the new deserializer and cache it.
JsonRootWrapperDeserializer deserializer = new JsonRootWrapperDeserializer(contentType);
deserializers.put(contentType, deserializer);
return deserializer;
}
}
return null;
}
示例6: createEnumDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
public JsonDeserializer<?> createEnumDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, JavaType paramJavaType, BeanProperty paramBeanProperty)
{
BasicBeanDescription localBasicBeanDescription = (BasicBeanDescription)paramDeserializationConfig.introspectForCreation(paramJavaType);
JsonDeserializer localJsonDeserializer1 = findDeserializerFromAnnotation(paramDeserializationConfig, localBasicBeanDescription.getClassInfo(), paramBeanProperty);
if (localJsonDeserializer1 != null)
return localJsonDeserializer1;
Class localClass = paramJavaType.getRawClass();
JsonDeserializer localJsonDeserializer2 = _findCustomEnumDeserializer(localClass, paramDeserializationConfig, localBasicBeanDescription, paramBeanProperty);
if (localJsonDeserializer2 != null)
return localJsonDeserializer2;
Iterator localIterator = localBasicBeanDescription.getFactoryMethods().iterator();
while (localIterator.hasNext())
{
AnnotatedMethod localAnnotatedMethod = (AnnotatedMethod)localIterator.next();
if (paramDeserializationConfig.getAnnotationIntrospector().hasCreatorAnnotation(localAnnotatedMethod))
{
if ((localAnnotatedMethod.getParameterCount() == 1) && (localAnnotatedMethod.getRawType().isAssignableFrom(localClass)))
return EnumDeserializer.deserializerForCreator(paramDeserializationConfig, localClass, localAnnotatedMethod);
throw new IllegalArgumentException("Unsuitable method (" + localAnnotatedMethod + ") decorated with @JsonCreator (for Enum type " + localClass.getName() + ")");
}
}
return new EnumDeserializer(constructEnumResolver(localClass, paramDeserializationConfig));
}
示例7: createMapLikeDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
public JsonDeserializer<?> createMapLikeDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, MapLikeType paramMapLikeType, BeanProperty paramBeanProperty)
{
MapLikeType localMapLikeType1 = (MapLikeType)mapAbstractType(paramDeserializationConfig, paramMapLikeType);
BasicBeanDescription localBasicBeanDescription = (BasicBeanDescription)paramDeserializationConfig.introspectForCreation(localMapLikeType1);
JsonDeserializer localJsonDeserializer1 = findDeserializerFromAnnotation(paramDeserializationConfig, localBasicBeanDescription.getClassInfo(), paramBeanProperty);
if (localJsonDeserializer1 != null)
return localJsonDeserializer1;
MapLikeType localMapLikeType2 = (MapLikeType)modifyTypeByAnnotation(paramDeserializationConfig, localBasicBeanDescription.getClassInfo(), localMapLikeType1, null);
JavaType localJavaType1 = localMapLikeType2.getKeyType();
JavaType localJavaType2 = localMapLikeType2.getContentType();
JsonDeserializer localJsonDeserializer2 = (JsonDeserializer)localJavaType2.getValueHandler();
KeyDeserializer localKeyDeserializer1 = (KeyDeserializer)localJavaType1.getValueHandler();
if (localKeyDeserializer1 == null);
for (KeyDeserializer localKeyDeserializer2 = paramDeserializerProvider.findKeyDeserializer(paramDeserializationConfig, localJavaType1, paramBeanProperty); ; localKeyDeserializer2 = localKeyDeserializer1)
{
TypeDeserializer localTypeDeserializer1 = (TypeDeserializer)localJavaType2.getTypeHandler();
if (localTypeDeserializer1 == null);
for (TypeDeserializer localTypeDeserializer2 = findTypeDeserializer(paramDeserializationConfig, localJavaType2, paramBeanProperty); ; localTypeDeserializer2 = localTypeDeserializer1)
return _findCustomMapLikeDeserializer(localMapLikeType2, paramDeserializationConfig, paramDeserializerProvider, localBasicBeanDescription, paramBeanProperty, localKeyDeserializer2, localTypeDeserializer2, localJsonDeserializer2);
}
}
示例8: findStdBeanDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
protected JsonDeserializer<Object> findStdBeanDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, JavaType paramJavaType, BeanProperty paramBeanProperty)
{
Class localClass = paramJavaType.getRawClass();
JsonDeserializer localJsonDeserializer = (JsonDeserializer)_simpleDeserializers.get(new ClassKey(localClass));
if (localJsonDeserializer != null);
do
{
return localJsonDeserializer;
if (AtomicReference.class.isAssignableFrom(localClass))
{
JavaType[] arrayOfJavaType = paramDeserializationConfig.getTypeFactory().findTypeParameters(paramJavaType, AtomicReference.class);
if ((arrayOfJavaType == null) || (arrayOfJavaType.length <= 0));
for (JavaType localJavaType = TypeFactory.unknownType(); ; localJavaType = arrayOfJavaType[0])
return new AtomicReferenceDeserializer(localJavaType, paramBeanProperty);
}
localJsonDeserializer = this.optionalHandlers.findDeserializer(paramJavaType, paramDeserializationConfig, paramDeserializerProvider);
}
while (localJsonDeserializer != null);
return null;
}
示例9: resolve
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
public void resolve(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider)
{
if (this._valueInstantiator.canCreateUsingDelegate())
{
JavaType localJavaType = this._valueInstantiator.getDelegateType();
if (localJavaType == null)
throw new IllegalArgumentException("Invalid delegate-creator definition for " + this._mapType + ": value instantiator (" + this._valueInstantiator.getClass().getName() + ") returned true for 'canCreateUsingDelegate()', but null for 'getDelegateType()'");
this._delegateDeserializer = findDeserializer(paramDeserializationConfig, paramDeserializerProvider, localJavaType, new BeanProperty.Std(null, localJavaType, null, this._valueInstantiator.getDelegateCreator()));
}
if (this._propertyBasedCreator != null)
{
Iterator localIterator = this._propertyBasedCreator.getCreatorProperties().iterator();
while (localIterator.hasNext())
{
SettableBeanProperty localSettableBeanProperty = (SettableBeanProperty)localIterator.next();
if (!localSettableBeanProperty.hasValueDeserializer())
this._propertyBasedCreator.assignDeserializer(localSettableBeanProperty, findDeserializer(paramDeserializationConfig, paramDeserializerProvider, localSettableBeanProperty.getType(), localSettableBeanProperty));
}
}
}
示例10: findMapDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
public final JsonDeserializer<?> findMapDeserializer(MapType paramMapType, DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, BeanDescription paramBeanDescription, BeanProperty paramBeanProperty, KeyDeserializer paramKeyDeserializer, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer)
{
Class localClass = paramMapType.getRawClass();
if (dh.class.isAssignableFrom(localClass))
{
dx.class.isAssignableFrom(localClass);
cq.class.isAssignableFrom(localClass);
return new e(paramMapType, paramKeyDeserializer, paramTypeDeserializer, a(paramJsonDeserializer, paramDeserializationConfig, paramDeserializerProvider, paramBeanProperty, paramMapType));
}
if (hs.class.isAssignableFrom(localClass))
{
ep.class.isAssignableFrom(localClass);
jb.class.isAssignableFrom(localClass);
kf.class.isAssignableFrom(localClass);
}
return null;
}
示例11: init
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
/**
* Inits the.
*/
@Validate
public void init() {
ObjectMapper mapper = new ObjectMapper();
mapper.enableDefaultTyping(
ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE,
JsonTypeInfo.As.PROPERTY);
DeserializerProvider p = mapper.getDeserializerProvider();
// mapper.setPropertyNamingStrategy(new
// DotNetTollerantNamingStrategy());
mapper.setDeserializerProvider(p);
setMapper(mapper);
}
示例12: createCollectionDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
@Override
public JsonDeserializer<?> createCollectionDeserializer(final DeserializationConfig config,
final DeserializerProvider p,
final CollectionType type,
final BeanProperty property) throws JsonMappingException {
if (CollectionPage.class.equals(type.getRawClass())) {
final JsonDeserializer<Object> contentDeserializer = type.getContentType().getValueHandler();
return new CollectionPageDeserializer(type, contentDeserializer);
}
return nonCollectionPageStrategy.createCollectionDeserializer(config, p, type, property);
}
开发者ID:JohnDeere,项目名称:MyJohnDeereAPI-OAuth-Java-Client,代码行数:14,代码来源:CollectionPageDeserializerFactory.java
示例13: createBeanDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
@Override
public JsonDeserializer<Object> createBeanDeserializer(final DeserializationConfig config,
final DeserializerProvider p,
final JavaType type,
final BeanProperty property) throws JsonMappingException {
return nonCollectionPageStrategy.createBeanDeserializer(config, p, type, property);
}
开发者ID:JohnDeere,项目名称:MyJohnDeereAPI-OAuth-Java-Client,代码行数:8,代码来源:CollectionPageDeserializerFactory.java
示例14: createArrayDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
@Override
public JsonDeserializer<?> createArrayDeserializer(final DeserializationConfig config,
final DeserializerProvider p,
final ArrayType type,
final BeanProperty property) throws JsonMappingException {
return nonCollectionPageStrategy.createArrayDeserializer(config, p, type, property);
}
开发者ID:JohnDeere,项目名称:MyJohnDeereAPI-OAuth-Java-Client,代码行数:8,代码来源:CollectionPageDeserializerFactory.java
示例15: createCollectionLikeDeserializer
import org.codehaus.jackson.map.DeserializerProvider; //导入依赖的package包/类
@Override
public JsonDeserializer<?> createCollectionLikeDeserializer(final DeserializationConfig config,
final DeserializerProvider p,
final CollectionLikeType type,
final BeanProperty property)
throws JsonMappingException {
return nonCollectionPageStrategy.createCollectionLikeDeserializer(config, p, type, property);
}
开发者ID:JohnDeere,项目名称:MyJohnDeereAPI-OAuth-Java-Client,代码行数:9,代码来源:CollectionPageDeserializerFactory.java