当前位置: 首页>>代码示例>>Java>>正文


Java SimpleDeserializers类代码示例

本文整理汇总了Java中com.fasterxml.jackson.databind.module.SimpleDeserializers的典型用法代码示例。如果您正苦于以下问题:Java SimpleDeserializers类的具体用法?Java SimpleDeserializers怎么用?Java SimpleDeserializers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SimpleDeserializers类属于com.fasterxml.jackson.databind.module包,在下文中一共展示了SimpleDeserializers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupModule

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
@Override
public final void setupModule(final SetupContext setupContext) {
	SimpleKeyDeserializers keyDeserializers = new SimpleKeyDeserializers();
	keyDeserializers.addDeserializer(Location.class,
			new GeographicalRegionKeyDeserializer());
	setupContext.addKeyDeserializers(keyDeserializers);
	SimpleSerializers simpleSerializers = new SimpleSerializers();
	simpleSerializers.addSerializer(new JobInstanceSerializer());
	simpleSerializers.addSerializer(new JobExecutionSerializer());
	setupContext.addSerializers(simpleSerializers);

	SimpleDeserializers simpleDeserializers = new SimpleDeserializers();
	simpleDeserializers.addDeserializer(JobInstance.class,
			new JobInstanceDeserializer());
	simpleDeserializers.addDeserializer(JobExecution.class,
			new JobExecutionDeserializer(jobInstanceService));
	simpleDeserializers.addDeserializer(JobExecutionException.class,
			new JobExecutionExceptionDeserializer());
	setupContext.addDeserializers(simpleDeserializers);
}
 
开发者ID:RBGKew,项目名称:eMonocot,代码行数:21,代码来源:CustomModule.java

示例2: setupModule

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
@Override
public void setupModule(final SetupContext context) {
    final SimpleSerializers serializers = new SimpleSerializers();
    serializers.addSerializer(CurrencyUnit.class, new CurrencyUnitSerializer());
    serializers.addSerializer(MonetaryAmount.class, new MonetaryAmountSerializer(names, writer, formatFactory));
    context.addSerializers(serializers);

    final SimpleDeserializers deserializers = new SimpleDeserializers();
    deserializers.addDeserializer(CurrencyUnit.class, new CurrencyUnitDeserializer());
    deserializers.addDeserializer(MonetaryAmount.class, new MonetaryAmountDeserializer<>(amountFactory, names));
    // for reading into concrete implementation types
    deserializers.addDeserializer(Money.class, new MonetaryAmountDeserializer<>(moneyFactory, names));
    deserializers.addDeserializer(FastMoney.class, new MonetaryAmountDeserializer<>(fastMoneyFactory, names));
    deserializers.addDeserializer(RoundedMoney.class, new MonetaryAmountDeserializer<>(roundedMoneyFactory, names));
    context.addDeserializers(deserializers);
}
 
开发者ID:zalando,项目名称:jackson-datatype-money,代码行数:17,代码来源:MoneyModule.java

示例3: setupModule

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
@Override
public void setupModule( SetupContext context ) {
    context.addSerializers( new PathModule.PathSerializers() );
    context.addDeserializers( new PathModule.PathDeserializers() );

    context.addSerializers( new MutableObjectModule.MutableObjectSerializers() );
    context.addDeserializers( new MutableObjectModule.MutableObjectDeserializers() );

    context.addSerializers( new LongAdderModule.LongAdderSerializers() );
    context.addDeserializers( new LongAdderModule.LongAdderDeserializers() );

    SimpleDeserializers deserializers = new SimpleDeserializers();
    deserializers.addDeserializer( Long.TYPE, new LongDeserializer( Long.TYPE, 0L ) );
    deserializers.addDeserializer( Long.class, new LongDeserializer( Long.class, null ) );
    context.addDeserializers( deserializers );
}
 
开发者ID:oaplatform,项目名称:oap,代码行数:17,代码来源:OapJsonModule.java

示例4: setupModule

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
@Override
public void setupModule(SetupContext context) {
  super.setupModule(context);

  SimpleSerializers serializers = new SimpleSerializers();
  SimpleDeserializers deserializers = new SimpleDeserializers();

  // java.sql.Time
  serializers.addSerializer(Time.class, new TimeSerializer());
  deserializers.addDeserializer(Time.class, new TimeDeserializer());

  // java.sql.Date
  serializers.addSerializer(Date.class, new SqlDateSerializer());
  deserializers.addDeserializer(Date.class, new SqlDateDeserializer());

  context.addSerializers(serializers);
  context.addDeserializers(deserializers);
}
 
开发者ID:tunguski,项目名称:matsuo-core,代码行数:19,代码来源:CustomJacksonModule.java

示例5: addDeserializerForIdentifiableModel

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
private void addDeserializerForIdentifiableModel(SimpleDeserializers deserializers) {
	log.debug("Registering deserializer for: {}", IdentifiableModel.class);
	deserializers.addDeserializer(IdentifiableModel.class, new JsonDeserializer<IdentifiableModel>() {
		@Override
		public IdentifiableModel deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
			ObjectMapper mapper = (ObjectMapper) jp.getCodec();
			ObjectNode root = mapper.readTree(jp);

			JsonNode type = root.get("name");
			String name = type.textValue();
			
			JsonParser traverse = root.traverse();
			traverse.setCodec(mapper);

			if (name.startsWith("@")) {
				return mapper.readValue(traverse, GroupModel.class);
			}
			else {
				return mapper.readValue(traverse, UserModel.class);
			}
		}
	});
}
 
开发者ID:devhub-tud,项目名称:git-server,代码行数:24,代码来源:MappingModule.java

示例6: setupModule

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
@Override
public void setupModule(Module.SetupContext context) {
    super.setupModule(context);
    context.setMixInAnnotations(Id.class, IdConfiguration.class);
    context.setMixInAnnotations(BrandRef.class, ResourceRefConfiguration.class);
    context.setMixInAnnotations(TopicRef.class, ResourceRefConfiguration.class);
    context.setMixInAnnotations(ItemRef.class, ItemRefConfiguration.class);
    context.setMixInAnnotations(EpisodeRef.class, ItemRefConfiguration.class);
    context.setMixInAnnotations(SongRef.class, ItemRefConfiguration.class);
    context.setMixInAnnotations(FilmRef.class, ItemRefConfiguration.class);
    context.setMixInAnnotations(ClipRef.class, ItemRefConfiguration.class);
    context.setMixInAnnotations(SeriesRef.class, SeriesRefConfiguration.class);
    context.setMixInAnnotations(BroadcastRef.class, BroadcastRefConfiguration.class);
    context.setMixInAnnotations(ScheduleRef.class, ScheduleRefConfiguration.class);
    context.setMixInAnnotations(
            ScheduleRef.Entry.class,
            ScheduleRefConfiguration.Entry.class
    );
    context.setMixInAnnotations(Timestamp.class, TimestampConfiguration.class);
    SimpleDeserializers desers = new SimpleDeserializers();
    context.addDeserializers(desers);
}
 
开发者ID:atlasapi,项目名称:atlas-deer,代码行数:23,代码来源:JacksonMessageSerializer.java

示例7: setupModule

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
@Override
public void setupModule(SetupContext setupContext) {
    SimpleSerializers serializers = new SimpleSerializers();
    addSerializers(serializers);
    setupContext.addSerializers(serializers);

    SimpleDeserializers deserializers = new SimpleDeserializers();
    addDeserializers(deserializers);
    setupContext.addDeserializers(deserializers);
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:11,代码来源:JobJacksonModule.java

示例8: setupModule

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
/**
 * Method called by {@link ObjectMapper} when module is registered.
 * It is called to let module register functionality it provides,
 * using callback methods passed-in context object exposes.
 */
@Override
public void setupModule(SetupContext setupContext) {
    SimpleSerializers serializers = new SimpleSerializers();
    addSerializers(serializers);
    setupContext.addSerializers(serializers);

    SimpleDeserializers deserializers = new SimpleDeserializers();
    addDeserializers(deserializers);
    setupContext.addDeserializers(deserializers);
    setupContext.addBeanDeserializerModifier(new KeeperBeanDeserializerModifier());
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:17,代码来源:DmJacksonModule.java

示例9: setupModule

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
@Override
public void setupModule(SetupContext context) {
    super.setupModule(context);
    SimpleSerializers serializers= new SimpleSerializers();
    serializers.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer());
    context.addSerializers(serializers);

    SimpleDeserializers deserializers = new SimpleDeserializers();
    deserializers.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer());
    context.addDeserializers(deserializers);
}
 
开发者ID:Byteflair,项目名称:resthooks,代码行数:12,代码来源:ResthooksModule.java

示例10: setupModule

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
@Override
public void setupModule(SetupContext context) {
  SimpleSerializers serializers = new SimpleSerializers();
  SimpleDeserializers deserializers = new SimpleDeserializers();

  serializers.addSerializer(DateTime.class, new DateTimeSerializer());
  deserializers.addDeserializer(DateTime.class, new DateTimeDeserializer());

  context.addSerializers(serializers);
  context.addDeserializers(deserializers);
}
 
开发者ID:ImmobilienScout24,项目名称:switchman,代码行数:12,代码来源:JsonMarshallingConfigModule.java

示例11: setupModule

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
@Override
public void setupModule(Module.SetupContext context) {
    SimpleSerializers serializers = new SimpleSerializers();
    SimpleDeserializers deserializers = new SimpleDeserializers();

    serializers.addSerializer(ModelObjectInterface.class, new NoJpaSerializer());
    serializers.addSerializer(Calendar.class, new CalendarSerializer());
    serializers.addSerializer(NList.class, new NListSerializer());
    context.addSerializers(serializers);
    context.addDeserializers(deserializers);
}
 
开发者ID:NoJPA-LESS-IS-MORE,项目名称:NoJPA,代码行数:12,代码来源:NoJpaModule.java

示例12: addDeserializers

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addDeserializers(SimpleDeserializers deserializers) {
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:4,代码来源:JobJacksonModule.java

示例13: addDeserializers

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addDeserializers(SimpleDeserializers deserializers) {
    deserializers.addDeserializer(MimeType.class, new MimeTypeDeserializer());
    deserializers.addDeserializer(Keeper.class, (JsonDeserializer) new KeeperDeserializer());
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:6,代码来源:DmJacksonModule.java

示例14: setDeserializerItems

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
public void setDeserializerItems(List<JsonDeserializer<?>> deserializers) {
    this.setDeserializers(new SimpleDeserializers(
        deserializers.stream().collect(SdcctStreamUtils.toMap(JsonDeserializer::handledType, Function.identity(), LinkedHashMap::new))));
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:5,代码来源:SdcctModule.java

示例15: setupModule

import com.fasterxml.jackson.databind.module.SimpleDeserializers; //导入依赖的package包/类
@Override
public void setupModule(SetupContext context) {
	SimpleDeserializers deserializers = new SimpleDeserializers();
	addDeserializerForIdentifiableModel(deserializers);
	context.addDeserializers(deserializers);
}
 
开发者ID:devhub-tud,项目名称:git-server,代码行数:7,代码来源:MappingModule.java


注:本文中的com.fasterxml.jackson.databind.module.SimpleDeserializers类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。