本文整理汇总了Java中org.codehaus.jackson.map.type.CollectionType类的典型用法代码示例。如果您正苦于以下问题:Java CollectionType类的具体用法?Java CollectionType怎么用?Java CollectionType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CollectionType类属于org.codehaus.jackson.map.type包,在下文中一共展示了CollectionType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildCollectionSerializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
protected JsonSerializer<?> buildCollectionSerializer(SerializationConfig paramSerializationConfig, CollectionType paramCollectionType, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean, TypeSerializer paramTypeSerializer, JsonSerializer<Object> paramJsonSerializer)
{
Iterator localIterator = customSerializers().iterator();
while (localIterator.hasNext())
{
JsonSerializer localJsonSerializer = ((Serializers)localIterator.next()).findCollectionSerializer(paramSerializationConfig, paramCollectionType, paramBasicBeanDescription, paramBeanProperty, paramTypeSerializer, paramJsonSerializer);
if (localJsonSerializer != null)
return localJsonSerializer;
}
Class localClass1 = paramCollectionType.getRawClass();
if (EnumSet.class.isAssignableFrom(localClass1))
return buildEnumSetSerializer(paramSerializationConfig, paramCollectionType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, paramTypeSerializer, paramJsonSerializer);
Class localClass2 = paramCollectionType.getContentType().getRawClass();
if (isIndexedList(localClass1))
{
if (localClass2 == String.class)
return new IndexedStringListSerializer(paramBeanProperty);
return ContainerSerializers.indexedListSerializer(paramCollectionType.getContentType(), paramBoolean, paramTypeSerializer, paramBeanProperty, paramJsonSerializer);
}
if (localClass2 == String.class)
return new StringCollectionSerializer(paramBeanProperty);
return ContainerSerializers.collectionSerializer(paramCollectionType.getContentType(), paramBoolean, paramTypeSerializer, paramBeanProperty, paramJsonSerializer);
}
示例2: getRawObjectNames
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
private String[] getRawObjectNames() throws Exception {
SwiftRestClient client;
client = SwiftRestClient.getInstance(fs.getUri(), fs.getConf());
SwiftObjectPath path = SwiftObjectPath.fromPath(fs.getUri(), new Path("/"));
byte[] bytes = client.listDeepObjectsInDirectory(path, true, true);
final CollectionType collectionType = JSONUtil.getJsonMapper().
getTypeFactory().constructCollectionType(List.class,
SwiftObjectFileStatus.class);
final List<SwiftObjectFileStatus> fileStatusList =
JSONUtil.toObject(new String(bytes), collectionType);
final ArrayList<String> objects = new ArrayList();
for (SwiftObjectFileStatus status : fileStatusList) {
if (status.getName() != null) {
objects.add(status.getName());
} else if (status.getSubdir() != null) {
objects.add(status.getSubdir());
}
}
return objects.toArray(new String[objects.size()]);
}
示例3: buildCollectionSerializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
protected JsonSerializer<?> buildCollectionSerializer(SerializationConfig paramSerializationConfig, CollectionType paramCollectionType, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean, TypeSerializer paramTypeSerializer, JsonSerializer<Object> paramJsonSerializer)
{
Iterator localIterator = customSerializers().iterator();
while (localIterator.hasNext())
{
JsonSerializer localJsonSerializer = ((Serializers)localIterator.next()).findCollectionSerializer(paramSerializationConfig, paramCollectionType, paramBasicBeanDescription, paramBeanProperty, paramTypeSerializer, paramJsonSerializer);
if (localJsonSerializer != null)
return localJsonSerializer;
}
Class localClass1 = paramCollectionType.getRawClass();
if (EnumSet.class.isAssignableFrom(localClass1))
return buildEnumSetSerializer(paramSerializationConfig, paramCollectionType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, paramTypeSerializer, paramJsonSerializer);
Class localClass2 = paramCollectionType.getContentType().getRawClass();
if (isIndexedList(localClass1))
{
if (localClass2 == String.class)
return new IndexedStringListSerializer(paramBeanProperty);
return StdContainerSerializers.indexedListSerializer(paramCollectionType.getContentType(), paramBoolean, paramTypeSerializer, paramBeanProperty, paramJsonSerializer);
}
if (localClass2 == String.class)
return new StringCollectionSerializer(paramBeanProperty);
return StdContainerSerializers.collectionSerializer(paramCollectionType.getContentType(), paramBoolean, paramTypeSerializer, paramBeanProperty, paramJsonSerializer);
}
示例4: createCollectionDeserializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的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
示例5: buildContainerSerializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
public JsonSerializer<?> buildContainerSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean)
{
TypeSerializer localTypeSerializer = createTypeSerializer(paramSerializationConfig, paramJavaType.getContentType(), paramBeanProperty);
if (localTypeSerializer != null)
paramBoolean = false;
JsonSerializer localJsonSerializer1;
while (true)
{
localJsonSerializer1 = findContentSerializer(paramSerializationConfig, paramBasicBeanDescription.getClassInfo(), paramBeanProperty);
if (!paramJavaType.isMapLikeType())
break;
MapLikeType localMapLikeType = (MapLikeType)paramJavaType;
JsonSerializer localJsonSerializer2 = findKeySerializer(paramSerializationConfig, paramBasicBeanDescription.getClassInfo(), paramBeanProperty);
if (localMapLikeType.isTrueMapType())
{
return buildMapSerializer(paramSerializationConfig, (MapType)localMapLikeType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localJsonSerializer2, localTypeSerializer, localJsonSerializer1);
if (paramBoolean)
continue;
paramBoolean = usesStaticTyping(paramSerializationConfig, paramBasicBeanDescription, localTypeSerializer, paramBeanProperty);
continue;
}
return buildMapLikeSerializer(paramSerializationConfig, localMapLikeType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localJsonSerializer2, localTypeSerializer, localJsonSerializer1);
}
if (paramJavaType.isCollectionLikeType())
{
CollectionLikeType localCollectionLikeType = (CollectionLikeType)paramJavaType;
if (localCollectionLikeType.isTrueCollectionType())
return buildCollectionSerializer(paramSerializationConfig, (CollectionType)localCollectionLikeType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localTypeSerializer, localJsonSerializer1);
return buildCollectionLikeSerializer(paramSerializationConfig, localCollectionLikeType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localTypeSerializer, localJsonSerializer1);
}
if (paramJavaType.isArrayType())
return buildArraySerializer(paramSerializationConfig, (ArrayType)paramJavaType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localTypeSerializer, localJsonSerializer1);
return null;
}
示例6: findCollectionDeserializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
public JsonDeserializer<?> findCollectionDeserializer(CollectionType paramCollectionType, DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, BeanDescription paramBeanDescription, BeanProperty paramBeanProperty, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer)
throws JsonMappingException
{
if (this._classMappings == null)
return null;
return (JsonDeserializer)this._classMappings.get(new ClassKey(paramCollectionType.getRawClass()));
}
示例7: createCollectionDeserializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
public JsonDeserializer<?> createCollectionDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, CollectionType paramCollectionType, BeanProperty paramBeanProperty)
throws JsonMappingException
{
CollectionType localCollectionType1 = (CollectionType)mapAbstractType(paramDeserializationConfig, paramCollectionType);
Object localObject = localCollectionType1.getRawClass();
BasicBeanDescription localBasicBeanDescription = (BasicBeanDescription)paramDeserializationConfig.introspectClassAnnotations((Class)localObject);
JsonDeserializer localJsonDeserializer1 = findDeserializerFromAnnotation(paramDeserializationConfig, localBasicBeanDescription.getClassInfo(), paramBeanProperty);
if (localJsonDeserializer1 != null)
return localJsonDeserializer1;
CollectionType localCollectionType2 = (CollectionType)modifyTypeByAnnotation(paramDeserializationConfig, localBasicBeanDescription.getClassInfo(), localCollectionType1, null);
JavaType localJavaType = localCollectionType2.getContentType();
JsonDeserializer localJsonDeserializer2 = (JsonDeserializer)localJavaType.getValueHandler();
TypeDeserializer localTypeDeserializer = (TypeDeserializer)localJavaType.getTypeHandler();
if (localTypeDeserializer == null)
localTypeDeserializer = findTypeDeserializer(paramDeserializationConfig, localJavaType, paramBeanProperty);
JsonDeserializer localJsonDeserializer3 = _findCustomCollectionDeserializer(localCollectionType2, paramDeserializationConfig, paramDeserializerProvider, localBasicBeanDescription, paramBeanProperty, localTypeDeserializer, localJsonDeserializer2);
if (localJsonDeserializer3 != null)
return localJsonDeserializer3;
if (localJsonDeserializer2 == null)
{
if (EnumSet.class.isAssignableFrom((Class)localObject))
return new EnumSetDeserializer(constructEnumResolver(localJavaType.getRawClass(), paramDeserializationConfig));
localJsonDeserializer2 = paramDeserializerProvider.findValueDeserializer(paramDeserializationConfig, localJavaType, paramBeanProperty);
}
if ((localCollectionType2.isInterface()) || (localCollectionType2.isAbstract()))
{
Class localClass = (Class)_collectionFallbacks.get(((Class)localObject).getName());
if (localClass == null)
throw new IllegalArgumentException("Can not find a deserializer for non-concrete Collection type " + localCollectionType2);
localObject = localClass;
}
Constructor localConstructor = ClassUtil.findConstructor((Class)localObject, paramDeserializationConfig.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS));
if (localJavaType.getRawClass() == String.class)
return new StringCollectionDeserializer(localCollectionType2, localJsonDeserializer2, localConstructor);
return (JsonDeserializer<?>)new CollectionDeserializer(localCollectionType2, localJsonDeserializer2, localTypeDeserializer, localConstructor);
}
示例8: _createDeserializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
protected JsonDeserializer<Object> _createDeserializer(DeserializationConfig paramDeserializationConfig, JavaType paramJavaType, BeanProperty paramBeanProperty)
throws JsonMappingException
{
if (paramJavaType.isEnumType())
return this._factory.createEnumDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty);
if (paramJavaType.isContainerType())
{
if (paramJavaType.isArrayType())
return this._factory.createArrayDeserializer(paramDeserializationConfig, this, (ArrayType)paramJavaType, paramBeanProperty);
if (paramJavaType.isMapLikeType())
{
MapLikeType localMapLikeType = (MapLikeType)paramJavaType;
if (localMapLikeType.isTrueMapType())
return this._factory.createMapDeserializer(paramDeserializationConfig, this, (MapType)localMapLikeType, paramBeanProperty);
return this._factory.createMapLikeDeserializer(paramDeserializationConfig, this, localMapLikeType, paramBeanProperty);
}
if (paramJavaType.isCollectionLikeType())
{
CollectionLikeType localCollectionLikeType = (CollectionLikeType)paramJavaType;
if (localCollectionLikeType.isTrueCollectionType())
return this._factory.createCollectionDeserializer(paramDeserializationConfig, this, (CollectionType)localCollectionLikeType, paramBeanProperty);
return this._factory.createCollectionLikeDeserializer(paramDeserializationConfig, this, localCollectionLikeType, paramBeanProperty);
}
}
if (JsonNode.class.isAssignableFrom(paramJavaType.getRawClass()))
return this._factory.createTreeDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty);
return this._factory.createBeanDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty);
}
示例9: _findCustomCollectionDeserializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
protected JsonDeserializer<?> _findCustomCollectionDeserializer(CollectionType paramCollectionType, DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer)
throws JsonMappingException
{
Iterator localIterator = this._factoryConfig.deserializers().iterator();
while (localIterator.hasNext())
{
JsonDeserializer localJsonDeserializer = ((Deserializers)localIterator.next()).findCollectionDeserializer(paramCollectionType, paramDeserializationConfig, paramDeserializerProvider, paramBasicBeanDescription, paramBeanProperty, paramTypeDeserializer, paramJsonDeserializer);
if (localJsonDeserializer != null)
return localJsonDeserializer;
}
return null;
}
示例10: getProjects
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
public List<Project> getProjects() throws AuthenticationFailedException, ServiceNotFoundException, Exception {
HttpURLConnection con = getServiceConnection("api/projects");
if (con.getResponseCode() == 401) {
throw new AuthenticationFailedException();
} else if (con.getResponseCode() == 404) {
throw new ServiceNotFoundException();
}
JavaType type = CollectionType.construct(ArrayList.class, SimpleType.construct(Project.class));
InputStream in = con.getInputStream();
try {
return (List<Project>) objectMapper.readValue(in, type);
} finally {
in.close();
}
}
示例11: buildContainerSerializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
public JsonSerializer<?> buildContainerSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean)
{
TypeSerializer localTypeSerializer = createTypeSerializer(paramSerializationConfig, paramJavaType.getContentType(), paramBeanProperty);
boolean bool;
if (localTypeSerializer != null)
bool = false;
while (true)
{
JsonSerializer localJsonSerializer1 = findContentSerializer(paramSerializationConfig, paramBasicBeanDescription.getClassInfo(), paramBeanProperty);
if (paramJavaType.isMapLikeType())
{
MapLikeType localMapLikeType = (MapLikeType)paramJavaType;
JsonSerializer localJsonSerializer2 = findKeySerializer(paramSerializationConfig, paramBasicBeanDescription.getClassInfo(), paramBeanProperty);
if (localMapLikeType.isTrueMapType())
{
return buildMapSerializer(paramSerializationConfig, (MapType)localMapLikeType, paramBasicBeanDescription, paramBeanProperty, bool, localJsonSerializer2, localTypeSerializer, localJsonSerializer1);
if (!paramBoolean)
bool = usesStaticTyping(paramSerializationConfig, paramBasicBeanDescription, localTypeSerializer, paramBeanProperty);
}
else
{
return buildMapLikeSerializer(paramSerializationConfig, localMapLikeType, paramBasicBeanDescription, paramBeanProperty, bool, localJsonSerializer2, localTypeSerializer, localJsonSerializer1);
}
}
else
{
if (paramJavaType.isCollectionLikeType())
{
CollectionLikeType localCollectionLikeType = (CollectionLikeType)paramJavaType;
if (localCollectionLikeType.isTrueCollectionType())
return buildCollectionSerializer(paramSerializationConfig, (CollectionType)localCollectionLikeType, paramBasicBeanDescription, paramBeanProperty, bool, localTypeSerializer, localJsonSerializer1);
return buildCollectionLikeSerializer(paramSerializationConfig, localCollectionLikeType, paramBasicBeanDescription, paramBeanProperty, bool, localTypeSerializer, localJsonSerializer1);
}
if (paramJavaType.isArrayType())
return buildArraySerializer(paramSerializationConfig, (ArrayType)paramJavaType, paramBasicBeanDescription, paramBeanProperty, bool, localTypeSerializer, localJsonSerializer1);
return null;
bool = paramBoolean;
}
}
}
示例12: _createDeserializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
protected JsonDeserializer<Object> _createDeserializer(DeserializationConfig paramDeserializationConfig, JavaType paramJavaType, BeanProperty paramBeanProperty)
{
if (paramJavaType.isEnumType())
return this._factory.createEnumDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty);
if (paramJavaType.isContainerType())
{
if (paramJavaType.isArrayType())
return this._factory.createArrayDeserializer(paramDeserializationConfig, this, (ArrayType)paramJavaType, paramBeanProperty);
if (paramJavaType.isMapLikeType())
{
MapLikeType localMapLikeType = (MapLikeType)paramJavaType;
if (localMapLikeType.isTrueMapType())
return this._factory.createMapDeserializer(paramDeserializationConfig, this, (MapType)localMapLikeType, paramBeanProperty);
return this._factory.createMapLikeDeserializer(paramDeserializationConfig, this, localMapLikeType, paramBeanProperty);
}
if (paramJavaType.isCollectionLikeType())
{
CollectionLikeType localCollectionLikeType = (CollectionLikeType)paramJavaType;
if (localCollectionLikeType.isTrueCollectionType())
return this._factory.createCollectionDeserializer(paramDeserializationConfig, this, (CollectionType)localCollectionLikeType, paramBeanProperty);
return this._factory.createCollectionLikeDeserializer(paramDeserializationConfig, this, localCollectionLikeType, paramBeanProperty);
}
}
if (JsonNode.class.isAssignableFrom(paramJavaType.getRawClass()))
return this._factory.createTreeDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty);
return this._factory.createBeanDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty);
}
示例13: _findCustomCollectionDeserializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
protected JsonDeserializer<?> _findCustomCollectionDeserializer(CollectionType paramCollectionType, DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer)
{
Iterator localIterator = this._factoryConfig.deserializers().iterator();
while (localIterator.hasNext())
{
JsonDeserializer localJsonDeserializer = ((Deserializers)localIterator.next()).findCollectionDeserializer(paramCollectionType, paramDeserializationConfig, paramDeserializerProvider, paramBasicBeanDescription, paramBeanProperty, paramTypeDeserializer, paramJsonDeserializer);
if (localJsonDeserializer != null)
return localJsonDeserializer;
}
return null;
}
示例14: findCollectionDeserializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
public final JsonDeserializer<?> findCollectionDeserializer(CollectionType paramCollectionType, DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, BeanDescription paramBeanDescription, BeanProperty paramBeanProperty, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer)
{
Class localClass = paramCollectionType.getRawClass();
if (ht.class.isAssignableFrom(localClass))
{
eo.class.isAssignableFrom(localClass);
if (cn.class.isAssignableFrom(localClass))
return new c(paramCollectionType, paramTypeDeserializer, a(paramJsonDeserializer, paramDeserializationConfig, paramDeserializerProvider, paramBeanProperty, paramCollectionType));
dq.class.isAssignableFrom(localClass);
bl.class.isAssignableFrom(localClass);
ky.class.isAssignableFrom(localClass);
return new c(paramCollectionType, paramTypeDeserializer, a(paramJsonDeserializer, paramDeserializationConfig, paramDeserializerProvider, paramBeanProperty, paramCollectionType));
}
if (ct.class.isAssignableFrom(localClass))
{
if (dc.class.isAssignableFrom(localClass))
return new d(paramCollectionType, paramTypeDeserializer, a(paramJsonDeserializer, paramDeserializationConfig, paramDeserializerProvider, paramBeanProperty, paramCollectionType));
if (du.class.isAssignableFrom(localClass))
{
if (dz.class.isAssignableFrom(localClass))
{
if (!Comparable.class.isAssignableFrom(paramCollectionType.getContentType().getRawClass()))
throw new IllegalArgumentException("Can not handle ImmutableSortedSet with elements that are not Comparable<?> (" + localClass.getName() + ")");
return new g(paramCollectionType, paramTypeDeserializer, a(paramJsonDeserializer, paramDeserializationConfig, paramDeserializerProvider, paramBeanProperty, paramCollectionType));
}
return new f(paramCollectionType, paramTypeDeserializer, a(paramJsonDeserializer, paramDeserializationConfig, paramDeserializerProvider, paramBeanProperty, paramCollectionType));
}
}
return null;
}
示例15: createCollectionDeserializer
import org.codehaus.jackson.map.type.CollectionType; //导入依赖的package包/类
public abstract JsonDeserializer<?> createCollectionDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, CollectionType paramCollectionType, BeanProperty paramBeanProperty)
throws JsonMappingException;