本文整理汇总了Java中org.codehaus.jackson.map.deser.std.StdDeserializer类的典型用法代码示例。如果您正苦于以下问题:Java StdDeserializer类的具体用法?Java StdDeserializer怎么用?Java StdDeserializer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StdDeserializer类属于org.codehaus.jackson.map.deser.std包,在下文中一共展示了StdDeserializer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addJodaDeserializers
import org.codehaus.jackson.map.deser.std.StdDeserializer; //导入依赖的package包/类
/**
* Add Joda-Time deserializers to a module.
*/
private static void addJodaDeserializers(final SimpleModule module) {
for (final StdDeserializer<?> deserializer : new JodaDeserializers().provide()) {
module.addDeserializer((Class) deserializer.getValueClass(), deserializer);
}
module.addDeserializer(Duration.class, DurationDeserializer.create());
module.addDeserializer(Instant.class, InstantDeserializer.create());
module.addDeserializer(ReadableInstant.class, InstantDeserializer.create());
module.addDeserializer(Interval.class, IntervalDeserializer.create());
module.addDeserializer(LocalDate.class, LocalDateDeserializer.create());
}
示例2: StdDeserializers
import org.codehaus.jackson.map.deser.std.StdDeserializer; //导入依赖的package包/类
private StdDeserializers()
{
add(new UntypedObjectDeserializer());
StringDeserializer localStringDeserializer = new StringDeserializer();
add(localStringDeserializer, String.class);
add(localStringDeserializer, CharSequence.class);
add(new ClassDeserializer());
add(new StdDeserializer.BooleanDeserializer(Boolean.class, null));
add(new StdDeserializer.ByteDeserializer(Byte.class, null));
add(new StdDeserializer.ShortDeserializer(Short.class, null));
add(new StdDeserializer.CharacterDeserializer(Character.class, null));
add(new StdDeserializer.IntegerDeserializer(Integer.class, null));
add(new StdDeserializer.LongDeserializer(Long.class, null));
add(new StdDeserializer.FloatDeserializer(Float.class, null));
add(new StdDeserializer.DoubleDeserializer(Double.class, null));
add(new StdDeserializer.BooleanDeserializer(Boolean.TYPE, Boolean.FALSE));
add(new StdDeserializer.ByteDeserializer(Byte.TYPE, Byte.valueOf((byte)0)));
add(new StdDeserializer.ShortDeserializer(Short.TYPE, Short.valueOf((short)0)));
add(new StdDeserializer.CharacterDeserializer(Character.TYPE, Character.valueOf('\000')));
add(new StdDeserializer.IntegerDeserializer(Integer.TYPE, Integer.valueOf(0)));
add(new StdDeserializer.LongDeserializer(Long.TYPE, Long.valueOf(0L)));
add(new StdDeserializer.FloatDeserializer(Float.TYPE, Float.valueOf(0.0F)));
add(new StdDeserializer.DoubleDeserializer(Double.TYPE, Double.valueOf(0.0D)));
add(new StdDeserializer.NumberDeserializer());
add(new StdDeserializer.BigDecimalDeserializer());
add(new StdDeserializer.BigIntegerDeserializer());
add(new CalendarDeserializer());
add(new DateDeserializer());
add(new CalendarDeserializer(GregorianCalendar.class), GregorianCalendar.class);
add(new StdDeserializer.SqlDateDeserializer());
add(new TimestampDeserializer());
Iterator localIterator = FromStringDeserializer.all().iterator();
while (localIterator.hasNext())
add((FromStringDeserializer)localIterator.next());
add(new StdDeserializer.StackTraceElementDeserializer());
add(new AtomicBooleanDeserializer());
add(new TokenBufferDeserializer());
add(new JavaTypeDeserializer());
}
示例3: add
import org.codehaus.jackson.map.deser.std.StdDeserializer; //导入依赖的package包/类
private void add(StdDeserializer<?> paramStdDeserializer)
{
add(paramStdDeserializer, paramStdDeserializer.getValueClass());
}