本文整理汇总了Java中com.fasterxml.jackson.databind.type.CollectionLikeType类的典型用法代码示例。如果您正苦于以下问题:Java CollectionLikeType类的具体用法?Java CollectionLikeType怎么用?Java CollectionLikeType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CollectionLikeType类属于com.fasterxml.jackson.databind.type包,在下文中一共展示了CollectionLikeType类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testExtraction
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
@Test
public void testExtraction() throws Exception {
Message<?> received = messageCollector.forChannel(source.output()).poll(10, TimeUnit.SECONDS);
assertNotNull(received);
assertThat(received.getPayload(), Matchers.instanceOf(String.class));
CollectionLikeType valueType = TypeFactory.defaultInstance()
.constructCollectionLikeType(List.class, Map.class);
List<Map<?, ?>> payload = this.objectMapper.readValue((String) received.getPayload(), valueType);
assertEquals(3, payload.size());
assertEquals(1, payload.get(0).get("ID"));
assertEquals("John", payload.get(2).get("NAME"));
}
开发者ID:spring-cloud-stream-app-starters,项目名称:jdbc,代码行数:17,代码来源:JdbcSourceIntegrationTests.java
示例2: findCollectionLikeSerializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
@Override
public JsonSerializer<?> findCollectionLikeSerializer(SerializationConfig config,
CollectionLikeType type, BeanDescription beanDesc,
TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer) {
Class<?> raw = type.getRawClass();
if (raw == CharSeq.class) {
return new CharSeqSerializer(type);
}
if (Seq.class.isAssignableFrom(raw)) {
return new ArraySerializer<>(type);
}
if (Set.class.isAssignableFrom(raw)) {
return new ArraySerializer<>(type);
}
if (PriorityQueue.class.isAssignableFrom(raw)) {
return new ArraySerializer<>(type);
}
return super.findCollectionLikeSerializer(config, type, beanDesc, elementTypeSerializer, elementValueSerializer);
}
开发者ID:vavr-io,项目名称:vavr-jackson,代码行数:20,代码来源:VavrSerializers.java
示例3: findCollectionLikeDeserializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
@Override
public JsonDeserializer<?> findCollectionLikeDeserializer(CollectionLikeType type,
DeserializationConfig config, BeanDescription beanDesc,
TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer)
throws JsonMappingException
{
Class<?> raw = type.getRawClass();
if (raw == CharSeq.class) {
return new CharSeqDeserializer(type);
}
if (Seq.class.isAssignableFrom(raw)) {
return new SeqDeserializer(type, settings.deserializeNullAsEmptyCollection());
}
if (Set.class.isAssignableFrom(raw)) {
return new SetDeserializer(type, settings.deserializeNullAsEmptyCollection());
}
if (PriorityQueue.class.isAssignableFrom(raw)) {
return new PriorityQueueDeserializer(type, settings.deserializeNullAsEmptyCollection());
}
return super.findCollectionLikeDeserializer(type, config, beanDesc, elementTypeDeserializer, elementDeserializer);
}
开发者ID:vavr-io,项目名称:vavr-jackson,代码行数:22,代码来源:VavrDeserializers.java
示例4: createCollectionLikeDeserializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
public JsonDeserializer<?> createCollectionLikeDeserializer(DeserializationContext paramDeserializationContext, CollectionLikeType paramCollectionLikeType, BeanDescription paramBeanDescription)
{
JavaType localJavaType = paramCollectionLikeType.getContentType();
JsonDeserializer localJsonDeserializer1 = (JsonDeserializer)localJavaType.getValueHandler();
DeserializationConfig localDeserializationConfig = paramDeserializationContext.getConfig();
TypeDeserializer localTypeDeserializer1 = (TypeDeserializer)localJavaType.getTypeHandler();
TypeDeserializer localTypeDeserializer2 = localTypeDeserializer1;
if (localTypeDeserializer1 == null)
localTypeDeserializer2 = findTypeDeserializer(localDeserializationConfig, localJavaType);
JsonDeserializer localJsonDeserializer2 = _findCustomCollectionLikeDeserializer(paramCollectionLikeType, localDeserializationConfig, paramBeanDescription, localTypeDeserializer2, localJsonDeserializer1);
JsonDeserializer localJsonDeserializer3 = localJsonDeserializer2;
if ((localJsonDeserializer2 != null) && (this._factoryConfig.hasDeserializerModifiers()))
{
Iterator localIterator = this._factoryConfig.deserializerModifiers().iterator();
while (localIterator.hasNext())
localJsonDeserializer3 = ((BeanDeserializerModifier)localIterator.next()).modifyCollectionLikeDeserializer(localDeserializationConfig, paramCollectionLikeType, paramBeanDescription, localJsonDeserializer3);
}
return localJsonDeserializer3;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:20,代码来源:BasicDeserializerFactory.java
示例5: fromSerializedString
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
protected Serialized fromSerializedString(String json) throws Exception {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JacksonReladomoModule());
mapper.enable(SerializationFeature.INDENT_OUTPUT);
CollectionLikeType customClassCollection = mapper.getTypeFactory().constructCollectionLikeType(Serialized.class, Order.class);
return (Serialized)mapper.readValue(json, customClassCollection);
}
开发者ID:goldmansachs,项目名称:reladomo,代码行数:8,代码来源:JaxRsRoundTripSerializationTest.java
示例6: _findCustomCollectionLikeDeserializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
protected JsonDeserializer<?> _findCustomCollectionLikeDeserializer(CollectionLikeType paramCollectionLikeType, DeserializationConfig paramDeserializationConfig, BeanDescription paramBeanDescription, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer)
{
Iterator localIterator = this._factoryConfig.deserializers().iterator();
while (localIterator.hasNext())
{
JsonDeserializer localJsonDeserializer = ((Deserializers)localIterator.next()).findCollectionLikeDeserializer(paramCollectionLikeType, paramDeserializationConfig, paramBeanDescription, paramTypeDeserializer, paramJsonDeserializer);
if (localJsonDeserializer != null)
return localJsonDeserializer;
}
return null;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:12,代码来源:BasicDeserializerFactory.java
示例7: _createDeserializer2
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的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: testGetSlots
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
@Test
public void testGetSlots() throws JsonParseException, JsonMappingException, MeekanApiException, IOException {
long meetingTime = 1406729316L;
List<String> options = Arrays.asList(String.valueOf(meetingTime));
int durationInMinutes = 60;
MeetingParam meeting = new MeetingParam().setAccountId(accountId).setDurationInMinutes(durationInMinutes).setMeetingName("test meeting")
.setOptions(options);
ApiRequestResponse createMeeting = meekanApi.createMeeting(accountId, meeting);
TestUtils.checkResponse(createMeeting);
Collection<String> idsOfAccounts = Arrays.asList(email);
Collection<String> invitees = TestUtils.getIdentifierToAccount(meekanApi, idsOfAccounts).values();
List<SerializablePair<Long, Long>> frames = Arrays.asList(new SerializablePair<Long, Long>(meetingTime, meetingTime
+ (durationInMinutes * 100)));
ApiRequestResponse slotsResponse = meekanApi.getSlots(invitees, 1, accountId, frames, "Asia/Jerusalem", "", "", null, false);
TestUtils.checkResponse(slotsResponse);
CollectionLikeType constructCollectionLikeType = Utils.getJSONObjectMapper().getTypeFactory()
.constructCollectionType(ArrayList.class, Slot.class);
List<Slot> slots = Utils.getJSONObjectMapper().readValue(slotsResponse.getResponse().get("data").toString(), constructCollectionLikeType);
Assert.assertEquals(74680, (long) (slots.get(0).getRank()));
Assert.assertEquals(accountId, String.valueOf(slots.get(slots.size() - 1).getNot_available().get(0)));
int numberOfNotAvailableSlots = 0;
for (Slot slot : slots) {
if (slot.getNot_available().size() > 0) {
numberOfNotAvailableSlots++;
}
}
Assert.assertEquals(durationInMinutes / 5, numberOfNotAvailableSlots);
}
开发者ID:meekan,项目名称:meekan-java-sdk,代码行数:29,代码来源:SlotsTest.java
示例9: findCollectionLikeDeserializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
@Override
public JsonDeserializer<?> findCollectionLikeDeserializer(CollectionLikeType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) {
return forJavaType(type);
}
开发者ID:leangen,项目名称:graphql-spqr,代码行数:5,代码来源:ConvertingDeserializers.java
示例10: emulatedJavaType
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
@Override
JavaType emulatedJavaType(JavaType type, TypeFactory typeFactory) {
CollectionLikeType collectionLikeType = (CollectionLikeType) type;
return typeFactory.constructCollectionType(ArrayList.class, collectionLikeType.getContentType());
}
开发者ID:vavr-io,项目名称:vavr-jackson,代码行数:6,代码来源:ArraySerializer.java
示例11: modifyCollectionLikeSerializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
public JsonSerializer<?> modifyCollectionLikeSerializer(SerializationConfig paramSerializationConfig, CollectionLikeType paramCollectionLikeType, BeanDescription paramBeanDescription, JsonSerializer<?> paramJsonSerializer)
{
return paramJsonSerializer;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:BeanSerializerModifier.java
示例12: buildContainerSerializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的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
示例13: findCollectionLikeSerializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
public JsonSerializer<?> findCollectionLikeSerializer(SerializationConfig paramSerializationConfig, CollectionLikeType paramCollectionLikeType, BeanDescription paramBeanDescription, TypeSerializer paramTypeSerializer, JsonSerializer<Object> paramJsonSerializer)
{
return null;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:Serializers.java
示例14: findCollectionLikeSerializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
public JsonSerializer<?> findCollectionLikeSerializer(SerializationConfig paramSerializationConfig, CollectionLikeType paramCollectionLikeType, BeanDescription paramBeanDescription, TypeSerializer paramTypeSerializer, JsonSerializer<Object> paramJsonSerializer)
{
return findSerializer(paramSerializationConfig, paramCollectionLikeType, paramBeanDescription);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:SimpleSerializers.java
示例15: findCollectionLikeDeserializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
public JsonDeserializer<?> findCollectionLikeDeserializer(CollectionLikeType paramCollectionLikeType, DeserializationConfig paramDeserializationConfig, BeanDescription paramBeanDescription, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer)
{
if (this._classMappings == null)
return null;
return (JsonDeserializer)this._classMappings.get(new ClassKey(paramCollectionLikeType.getRawClass()));
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:7,代码来源:SimpleDeserializers.java
示例16: findCollectionLikeDeserializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
public JsonDeserializer<?> findCollectionLikeDeserializer(CollectionLikeType paramCollectionLikeType, DeserializationConfig paramDeserializationConfig, BeanDescription paramBeanDescription, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer)
{
return null;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:Deserializers.java
示例17: modifyCollectionLikeDeserializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
public JsonDeserializer<?> modifyCollectionLikeDeserializer(DeserializationConfig paramDeserializationConfig, CollectionLikeType paramCollectionLikeType, BeanDescription paramBeanDescription, JsonDeserializer<?> paramJsonDeserializer)
{
return paramJsonDeserializer;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:BeanDeserializerModifier.java
示例18: findCollectionLikeSerializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
@Override
public JsonSerializer<?> findCollectionLikeSerializer(SerializationConfig config,
CollectionLikeType type, BeanDescription beanDesc,
TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer) {
return findSerializer(config, type, beanDesc);
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:7,代码来源:SimpleSerializers.java
示例19: createCollectionLikeDeserializer
import com.fasterxml.jackson.databind.type.CollectionLikeType; //导入依赖的package包/类
public abstract JsonDeserializer<?> createCollectionLikeDeserializer(DeserializationContext paramDeserializationContext, CollectionLikeType paramCollectionLikeType, BeanDescription paramBeanDescription);
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:2,代码来源:DeserializerFactory.java
注:本文中的com.fasterxml.jackson.databind.type.CollectionLikeType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论