本文整理汇总了Java中com.fasterxml.jackson.databind.type.ArrayType类的典型用法代码示例。如果您正苦于以下问题:Java ArrayType类的具体用法?Java ArrayType怎么用?Java ArrayType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArrayType类属于com.fasterxml.jackson.databind.type包,在下文中一共展示了ArrayType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getSchema
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
public JsonNode getSchema(SerializerProvider paramSerializerProvider, Type paramType)
{
ObjectNode localObjectNode = createSchemaNode("array", true);
if (paramType != null)
{
JavaType localJavaType = paramSerializerProvider.constructType(paramType);
if (localJavaType.isArrayType())
{
Class localClass = ((ArrayType)localJavaType).getContentType().getRawClass();
if (localClass == Object.class)
{
localObjectNode.put("items", JsonSchema.getDefaultSchemaNode());
return localObjectNode;
}
JsonSerializer localJsonSerializer = paramSerializerProvider.findValueSerializer(localClass, this._property);
JsonNode localJsonNode;
if ((localJsonSerializer instanceof SchemaAware))
localJsonNode = ((SchemaAware)localJsonSerializer).getSchema(paramSerializerProvider, null);
else
localJsonNode = JsonSchema.getDefaultSchemaNode();
localObjectNode.put("items", localJsonNode);
}
}
return localObjectNode;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:26,代码来源:ObjectArraySerializer.java
示例2: getSchema
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
throws JsonMappingException
{
ObjectNode o = createSchemaNode("array", true);
if (typeHint != null) {
JavaType javaType = provider.constructType(typeHint);
if (javaType.isArrayType()) {
Class<?> componentType = ((ArrayType) javaType).getContentType().getRawClass();
// 15-Oct-2010, tatu: We can't serialize plain Object.class; but what should it produce here? Untyped?
if (componentType == Object.class) {
o.put("items", JsonSchema.getDefaultSchemaNode());
} else {
JsonSerializer<Object> ser = provider.findValueSerializer(componentType, _property);
JsonNode schemaNode = (ser instanceof SchemaAware) ?
((SchemaAware) ser).getSchema(provider, null) :
JsonSchema.getDefaultSchemaNode();
o.put("items", schemaNode);
}
}
}
return o;
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:24,代码来源:ObjectArraySerializer.java
示例3: buildArraySerializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
protected JsonSerializer<?> buildArraySerializer(SerializationConfig paramSerializationConfig, ArrayType paramArrayType, BeanDescription paramBeanDescription, boolean paramBoolean, TypeSerializer paramTypeSerializer, JsonSerializer<Object> paramJsonSerializer)
{
Object localObject = null;
Iterator localIterator1 = customSerializers().iterator();
JsonSerializer localJsonSerializer;
do
{
if (!localIterator1.hasNext())
break;
localJsonSerializer = ((Serializers)localIterator1.next()).findArraySerializer(paramSerializationConfig, paramArrayType, paramBeanDescription, paramTypeSerializer, paramJsonSerializer);
localObject = localJsonSerializer;
}
while (localJsonSerializer == null);
if (localObject == null)
{
Class localClass = paramArrayType.getRawClass();
if ((paramJsonSerializer == null) || (ClassUtil.isJacksonStdImpl(paramJsonSerializer)))
if ([Ljava.lang.String.class == localClass)
localObject = StringArraySerializer.instance;
else
localObject = StdArraySerializers.findStandardImpl(localClass);
if (localObject == null)
localObject = new ObjectArraySerializer(paramArrayType.getContentType(), paramBoolean, paramTypeSerializer, paramJsonSerializer);
}
if (this._factoryConfig.hasSerializerModifiers())
{
Iterator localIterator2 = this._factoryConfig.serializerModifiers().iterator();
while (localIterator2.hasNext())
localObject = ((BeanSerializerModifier)localIterator2.next()).modifyArraySerializer(paramSerializationConfig, paramArrayType, paramBeanDescription, (JsonSerializer)localObject);
}
return localObject;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:33,代码来源:BasicSerializerFactory.java
示例4: _findCustomArrayDeserializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
protected JsonDeserializer<?> _findCustomArrayDeserializer(ArrayType paramArrayType, DeserializationConfig paramDeserializationConfig, BeanDescription paramBeanDescription, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer)
{
Iterator localIterator = this._factoryConfig.deserializers().iterator();
while (localIterator.hasNext())
{
JsonDeserializer localJsonDeserializer = ((Deserializers)localIterator.next()).findArrayDeserializer(paramArrayType, paramDeserializationConfig, paramBeanDescription, paramTypeDeserializer, paramJsonDeserializer);
if (localJsonDeserializer != null)
return localJsonDeserializer;
}
return null;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:12,代码来源:BasicDeserializerFactory.java
示例5: createArrayDeserializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
public JsonDeserializer<?> createArrayDeserializer(DeserializationContext paramDeserializationContext, ArrayType paramArrayType, BeanDescription paramBeanDescription)
{
DeserializationConfig localDeserializationConfig = paramDeserializationContext.getConfig();
JavaType localJavaType = paramArrayType.getContentType();
JsonDeserializer localJsonDeserializer1 = (JsonDeserializer)localJavaType.getValueHandler();
TypeDeserializer localTypeDeserializer1 = (TypeDeserializer)localJavaType.getTypeHandler();
TypeDeserializer localTypeDeserializer2 = localTypeDeserializer1;
if (localTypeDeserializer1 == null)
localTypeDeserializer2 = findTypeDeserializer(localDeserializationConfig, localJavaType);
JsonDeserializer localJsonDeserializer2 = _findCustomArrayDeserializer(paramArrayType, localDeserializationConfig, paramBeanDescription, localTypeDeserializer2, localJsonDeserializer1);
Object localObject = localJsonDeserializer2;
if (localJsonDeserializer2 == null)
{
if (localJsonDeserializer1 == null)
{
Class localClass = localJavaType.getRawClass();
if (localJavaType.isPrimitive())
return PrimitiveArrayDeserializers.forType(localClass);
if (localClass == String.class)
return StringArrayDeserializer.instance;
}
if (localObject == null)
localObject = new ObjectArrayDeserializer(paramArrayType, localJsonDeserializer1, localTypeDeserializer2);
}
if (this._factoryConfig.hasDeserializerModifiers())
{
Iterator localIterator = this._factoryConfig.deserializerModifiers().iterator();
while (localIterator.hasNext())
localObject = ((BeanDeserializerModifier)localIterator.next()).modifyArrayDeserializer(localDeserializationConfig, paramArrayType, paramBeanDescription, (JsonDeserializer)localObject);
}
return localObject;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:33,代码来源:BasicDeserializerFactory.java
示例6: ObjectArrayDeserializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
public ObjectArrayDeserializer(ArrayType paramArrayType, JsonDeserializer<Object> paramJsonDeserializer, TypeDeserializer paramTypeDeserializer)
{
super([Ljava.lang.Object.class);
this._arrayType = paramArrayType;
this._elementClass = paramArrayType.getContentType().getRawClass();
boolean bool;
if (this._elementClass == Object.class)
bool = true;
else
bool = false;
this._untyped = bool;
this._elementDeserializer = paramJsonDeserializer;
this._elementTypeDeserializer = paramTypeDeserializer;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:15,代码来源:ObjectArrayDeserializer.java
示例7: _createDeserializer2
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
protected final JsonDeserializer<?> _createDeserializer2(DeserializationContext paramDeserializationContext, DeserializerFactory paramDeserializerFactory, JavaType paramJavaType, BeanDescription paramBeanDescription)
{
DeserializationConfig localDeserializationConfig = paramDeserializationContext.getConfig();
if (paramJavaType.isEnumType())
return paramDeserializerFactory.createEnumDeserializer(paramDeserializationContext, paramJavaType, paramBeanDescription);
if (paramJavaType.isContainerType())
{
if (paramJavaType.isArrayType())
return paramDeserializerFactory.createArrayDeserializer(paramDeserializationContext, (ArrayType)paramJavaType, paramBeanDescription);
if (paramJavaType.isMapLikeType())
{
MapLikeType localMapLikeType = (MapLikeType)paramJavaType;
if (localMapLikeType.isTrueMapType())
return paramDeserializerFactory.createMapDeserializer(paramDeserializationContext, (MapType)localMapLikeType, paramBeanDescription);
return paramDeserializerFactory.createMapLikeDeserializer(paramDeserializationContext, localMapLikeType, paramBeanDescription);
}
if (paramJavaType.isCollectionLikeType())
{
JsonFormat.Value localValue = paramBeanDescription.findExpectedFormat(null);
if ((localValue == null) || (localValue.getShape() != JsonFormat.Shape.OBJECT))
{
CollectionLikeType localCollectionLikeType = (CollectionLikeType)paramJavaType;
if (localCollectionLikeType.isTrueCollectionType())
return paramDeserializerFactory.createCollectionDeserializer(paramDeserializationContext, (CollectionType)localCollectionLikeType, paramBeanDescription);
return paramDeserializerFactory.createCollectionLikeDeserializer(paramDeserializationContext, localCollectionLikeType, paramBeanDescription);
}
}
}
if (JsonNode.class.isAssignableFrom(paramJavaType.getRawClass()))
return paramDeserializerFactory.createTreeDeserializer(localDeserializationConfig, paramJavaType, paramBeanDescription);
return paramDeserializerFactory.createBeanDeserializer(paramDeserializationContext, paramJavaType, paramBeanDescription);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:33,代码来源:DeserializerCache.java
示例8: byteToJson
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
@Test
public void byteToJson() throws Exception {
Byte[] original = new Byte[]{1, 2, 3};
String encoded = JsonUtils.encode(original);
ArrayType type = JsonUtils.getTypeFactory().constructArrayType(Byte.class);
Byte[] decoded = (Byte[]) JsonUtils.decode(encoded, type);
Assert.assertArrayEquals(original, decoded);
}
开发者ID:odiszapc,项目名称:stem,代码行数:11,代码来源:TopologyCoderTest.java
示例9: ObjectArrayDeserializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
public ObjectArrayDeserializer(ArrayType arrayType,
JsonDeserializer<Object> elemDeser, TypeDeserializer elemTypeDeser)
{
super(Object[].class);
_arrayType = arrayType;
_elementClass = arrayType.getContentType().getRawClass();
_untyped = (_elementClass == Object.class);
_elementDeserializer = elemDeser;
_elementTypeDeserializer = elemTypeDeser;
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:11,代码来源:ObjectArrayDeserializer.java
示例10: findArrayDeserializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
@Override
public JsonDeserializer<?> findArrayDeserializer(ArrayType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) {
return forJavaType(type);
}
开发者ID:leangen,项目名称:graphql-spqr,代码行数:5,代码来源:ConvertingDeserializers.java
示例11: modifyArraySerializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
@Override
public JsonSerializer<?> modifyArraySerializer(SerializationConfig config, ArrayType valueType,
BeanDescription beanDesc, JsonSerializer<?> serializer) {
return new DeepEmptyCheckingSerializer<>(serializer);
}
开发者ID:cloudendpoints,项目名称:endpoints-java,代码行数:6,代码来源:ObjectMapperUtil.java
示例12: modifyArraySerializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
public JsonSerializer<?> modifyArraySerializer( SerializationConfig config, ArrayType valueType, BeanDescription beanDesc, JsonSerializer<?> serializer ) {
return new ArraySerializer( serializer );
}
开发者ID:NyBatis,项目名称:NyBatisCore,代码行数:4,代码来源:SerializerModifier.java
示例13: modifyArraySerializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
public JsonSerializer<?> modifyArraySerializer(SerializationConfig paramSerializationConfig, ArrayType paramArrayType, BeanDescription paramBeanDescription, JsonSerializer<?> paramJsonSerializer)
{
return paramJsonSerializer;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:BeanSerializerModifier.java
示例14: buildContainerSerializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
protected JsonSerializer<?> buildContainerSerializer(SerializerProvider paramSerializerProvider, JavaType paramJavaType, BeanDescription paramBeanDescription, boolean paramBoolean)
{
SerializationConfig localSerializationConfig = paramSerializerProvider.getConfig();
if ((!paramBoolean) && (paramJavaType.useStaticType()) && ((!paramJavaType.isContainerType()) || (paramJavaType.getContentType().getRawClass() != Object.class)))
paramBoolean = true;
TypeSerializer localTypeSerializer = createTypeSerializer(localSerializationConfig, paramJavaType.getContentType());
if (localTypeSerializer != null)
paramBoolean = false;
JsonSerializer localJsonSerializer1 = _findContentSerializer(paramSerializerProvider, paramBeanDescription.getClassInfo());
if (paramJavaType.isMapLikeType())
{
MapLikeType localMapLikeType1 = (MapLikeType)paramJavaType;
JsonSerializer localJsonSerializer4 = _findKeySerializer(paramSerializerProvider, paramBeanDescription.getClassInfo());
if (localMapLikeType1.isTrueMapType())
return buildMapSerializer(localSerializationConfig, (MapType)localMapLikeType1, paramBeanDescription, paramBoolean, localJsonSerializer4, localTypeSerializer, localJsonSerializer1);
Iterator localIterator3 = customSerializers().iterator();
while (localIterator3.hasNext())
{
Serializers localSerializers = (Serializers)localIterator3.next();
MapLikeType localMapLikeType2 = (MapLikeType)paramJavaType;
JsonSerializer localJsonSerializer5 = localSerializers.findMapLikeSerializer(localSerializationConfig, localMapLikeType2, paramBeanDescription, localJsonSerializer4, localTypeSerializer, localJsonSerializer1);
JsonSerializer localJsonSerializer6 = localJsonSerializer5;
if (localJsonSerializer5 != null)
{
if (this._factoryConfig.hasSerializerModifiers())
{
Iterator localIterator4 = this._factoryConfig.serializerModifiers().iterator();
while (localIterator4.hasNext())
localJsonSerializer6 = ((BeanSerializerModifier)localIterator4.next()).modifyMapLikeSerializer(localSerializationConfig, localMapLikeType2, paramBeanDescription, localJsonSerializer6);
}
return localJsonSerializer6;
}
}
return null;
}
if (paramJavaType.isCollectionLikeType())
{
CollectionLikeType localCollectionLikeType1 = (CollectionLikeType)paramJavaType;
if (localCollectionLikeType1.isTrueCollectionType())
return buildCollectionSerializer(localSerializationConfig, (CollectionType)localCollectionLikeType1, paramBeanDescription, paramBoolean, localTypeSerializer, localJsonSerializer1);
CollectionLikeType localCollectionLikeType2 = (CollectionLikeType)paramJavaType;
Iterator localIterator1 = customSerializers().iterator();
while (localIterator1.hasNext())
{
JsonSerializer localJsonSerializer2 = ((Serializers)localIterator1.next()).findCollectionLikeSerializer(localSerializationConfig, localCollectionLikeType2, paramBeanDescription, localTypeSerializer, localJsonSerializer1);
JsonSerializer localJsonSerializer3 = localJsonSerializer2;
if (localJsonSerializer2 != null)
{
if (this._factoryConfig.hasSerializerModifiers())
{
Iterator localIterator2 = this._factoryConfig.serializerModifiers().iterator();
while (localIterator2.hasNext())
localJsonSerializer3 = ((BeanSerializerModifier)localIterator2.next()).modifyCollectionLikeSerializer(localSerializationConfig, localCollectionLikeType2, paramBeanDescription, localJsonSerializer3);
}
return localJsonSerializer3;
}
}
return null;
}
if (paramJavaType.isArrayType())
return buildArraySerializer(localSerializationConfig, (ArrayType)paramJavaType, paramBeanDescription, paramBoolean, localTypeSerializer, localJsonSerializer1);
return null;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:64,代码来源:BasicSerializerFactory.java
示例15: findArraySerializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
public JsonSerializer<?> findArraySerializer(SerializationConfig paramSerializationConfig, ArrayType paramArrayType, BeanDescription paramBeanDescription, TypeSerializer paramTypeSerializer, JsonSerializer<Object> paramJsonSerializer)
{
return null;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:Serializers.java
示例16: findArraySerializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
public JsonSerializer<?> findArraySerializer(SerializationConfig paramSerializationConfig, ArrayType paramArrayType, BeanDescription paramBeanDescription, TypeSerializer paramTypeSerializer, JsonSerializer<Object> paramJsonSerializer)
{
return findSerializer(paramSerializationConfig, paramArrayType, paramBeanDescription);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:SimpleSerializers.java
示例17: findArrayDeserializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
public JsonDeserializer<?> findArrayDeserializer(ArrayType paramArrayType, DeserializationConfig paramDeserializationConfig, BeanDescription paramBeanDescription, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer)
{
if (this._classMappings == null)
return null;
return (JsonDeserializer)this._classMappings.get(new ClassKey(paramArrayType.getRawClass()));
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:7,代码来源:SimpleDeserializers.java
示例18: findArrayDeserializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
public JsonDeserializer<?> findArrayDeserializer(ArrayType paramArrayType, DeserializationConfig paramDeserializationConfig, BeanDescription paramBeanDescription, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer)
{
return null;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:Deserializers.java
示例19: modifyArrayDeserializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
public JsonDeserializer<?> modifyArrayDeserializer(DeserializationConfig paramDeserializationConfig, ArrayType paramArrayType, BeanDescription paramBeanDescription, JsonDeserializer<?> paramJsonDeserializer)
{
return paramJsonDeserializer;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:BeanDeserializerModifier.java
示例20: findArraySerializer
import com.fasterxml.jackson.databind.type.ArrayType; //导入依赖的package包/类
@Override
public JsonSerializer<?> findArraySerializer(SerializationConfig config,
ArrayType type, BeanDescription beanDesc,
TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer) {
return findSerializer(config, type, beanDesc);
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:7,代码来源:SimpleSerializers.java
注:本文中的com.fasterxml.jackson.databind.type.ArrayType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论