本文整理汇总了Java中com.fasterxml.jackson.databind.module.SimpleSerializers类的典型用法代码示例。如果您正苦于以下问题:Java SimpleSerializers类的具体用法?Java SimpleSerializers怎么用?Java SimpleSerializers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleSerializers类属于com.fasterxml.jackson.databind.module包,在下文中一共展示了SimpleSerializers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的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);
}
示例2: setupModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的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);
}
示例3: setupModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的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);
}
示例4: setupModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的package包/类
@Override
public void setupModule(SetupContext context) {
context.addSerializers(new SimpleSerializers(Arrays.<JsonSerializer<?>>asList(
new GaugeSerializer(timestampFieldname),
new CounterSerializer(timestampFieldname),
new HistogramSerializer(timestampFieldname),
new MeterSerializer(rateUnit, timestampFieldname),
new TimerSerializer(rateUnit, durationUnit, timestampFieldname),
new BulkIndexOperationHeaderSerializer(timestampFieldname)
)));
}
示例5: setupModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的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);
}
示例6: setupModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的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());
}
示例7: setupModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的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);
}
示例8: setupModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的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);
}
示例9: testPageModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的package包/类
@Test
public void testPageModule() throws Exception {
PageModuleProvider pmp = new PageModuleProvider();
Module module = pmp.getModule();
assertTrue(module instanceof SimpleModule);
Field field = module.getClass().getDeclaredField("_serializers");
field.setAccessible(true);
SimpleSerializers simpleSerializers = (SimpleSerializers) field.get(module);
field = simpleSerializers.getClass().getDeclaredField("_interfaceMappings");
field.setAccessible(true);
HashMap<ClassKey, JsonSerializer<?>> classMappings = (HashMap) field.get(simpleSerializers);
assertTrue(classMappings.containsKey(new ClassKey(Page.class)));
}
示例10: setupModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的package包/类
@Override
public void setupModule(SetupContext context) {
SimpleSerializers serializers = new SimpleSerializers();
serializers.addSerializer(ServiceType.class, new ServiceTypeSerializer());
context.addSerializers(serializers);
}
示例11: setupModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的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);
}
示例12: setupModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的package包/类
@Override
public void setupModule(SetupContext context) {
context.addSerializers(new SimpleSerializers(Arrays.<JsonSerializer<?>>asList(
new GaugeSerializer(timestampFieldname, additionalFields),
new CounterSerializer(timestampFieldname, additionalFields),
new HistogramSerializer(timestampFieldname, additionalFields),
new MeterSerializer(rateUnit, timestampFieldname, additionalFields),
new TimerSerializer(rateUnit, durationUnit, timestampFieldname, additionalFields),
new BulkIndexOperationHeaderSerializer()
)));
}
示例13: setupModule
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的package包/类
@Override
public void setupModule(SetupContext context) {
SimpleSerializers serializers = new SimpleSerializers();
serializers.addSerializer(Integer.class, new CustomIntegerSerializer());
context.addSerializers(serializers);
}
示例14: addSerializers
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的package包/类
private void addSerializers(SimpleSerializers serializers) {
if(jobParameterDescriptionSerializer != null) {
serializers.addSerializer(JobParameterDescription.class, jobParameterDescriptionSerializer);
}
}
示例15: addSerializers
import com.fasterxml.jackson.databind.module.SimpleSerializers; //导入依赖的package包/类
private void addSerializers(SimpleSerializers serializers) {
serializers.addSerializer(MimeType.class, new MimeTypeSerializer());
serializers.addSerializer(Keeper.class, new KeeperSerializer());
}