本文整理汇总了Java中com.alibaba.fastjson.JSON.DEFAULT_TYPE_KEY属性的典型用法代码示例。如果您正苦于以下问题:Java JSON.DEFAULT_TYPE_KEY属性的具体用法?Java JSON.DEFAULT_TYPE_KEY怎么用?Java JSON.DEFAULT_TYPE_KEY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.alibaba.fastjson.JSON
的用法示例。
在下文中一共展示了JSON.DEFAULT_TYPE_KEY属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SerializeConfig
public SerializeConfig(int tableSize) {
super(tableSize);
this.asm = !ASMUtils.isAndroid();
this.typeKey = JSON.DEFAULT_TYPE_KEY;
try {
this.asmFactory = new ASMSerializerFactory();
} catch (ExceptionInInitializerError e) {
this.asm = false;
}
put(Boolean.class, BooleanCodec.instance);
put(Character.class, CharacterCodec.instance);
put(Byte.class, IntegerCodec.instance);
put(Short.class, IntegerCodec.instance);
put(Integer.class, IntegerCodec.instance);
put(Long.class, LongCodec.instance);
put(Float.class, FloatCodec.instance);
put(Double.class, DoubleSerializer.instance);
put(BigDecimal.class, BigDecimalCodec.instance);
put(BigInteger.class, BigIntegerCodec.instance);
put(String.class, StringCodec.instance);
put(byte[].class, ByteArraySerializer.instance);
put(short[].class, ShortArraySerializer.instance);
put(int[].class, IntArraySerializer.instance);
put(long[].class, LongArraySerializer.instance);
put(float[].class, FloatArraySerializer.instance);
put(double[].class, DoubleArraySerializer.instance);
put(boolean[].class, BooleanArraySerializer.instance);
put(char[].class, CharArraySerializer.instance);
put(Object[].class, ObjectArraySerializer.instance);
put(Class.class, ClassSerializer.instance);
put(SimpleDateFormat.class, DateFormatSerializer.instance);
put(Locale.class, LocaleCodec.instance);
put(Currency.class, CurrencyCodec.instance);
put(TimeZone.class, TimeZoneCodec.instance);
put(UUID.class, UUIDCodec.instance);
put(InetAddress.class, InetAddressCodec.instance);
put(Inet4Address.class, InetAddressCodec.instance);
put(Inet6Address.class, InetAddressCodec.instance);
put(InetSocketAddress.class, InetSocketAddressCodec.instance);
put(File.class, FileCodec.instance);
put(URI.class, URICodec.instance);
put(URL.class, URLCodec.instance);
put(Appendable.class, AppendableSerializer.instance);
put(StringBuffer.class, AppendableSerializer.instance);
put(StringBuilder.class, AppendableSerializer.instance);
put(Pattern.class, PatternCodec.instance);
put(Charset.class, CharsetCodec.instance);
put(AtomicBoolean.class, AtomicBooleanSerializer.instance);
put(AtomicInteger.class, AtomicIntegerSerializer.instance);
put(AtomicLong.class, AtomicLongSerializer.instance);
put(AtomicReference.class, ReferenceCodec.instance);
put(AtomicIntegerArray.class, AtomicIntegerArrayCodec.instance);
put(AtomicLongArray.class, AtomicLongArrayCodec.instance);
put(WeakReference.class, ReferenceCodec.instance);
put(SoftReference.class, ReferenceCodec.instance);
try {
put(Class.forName("java.awt.Color"), ColorCodec.instance);
put(Class.forName("java.awt.Font"), FontCodec.instance);
put(Class.forName("java.awt.Point"), PointCodec.instance);
put(Class.forName("java.awt.Rectangle"), RectangleCodec.instance);
} catch (Throwable th) {
}
try {
put(Class.forName("java.time.LocalDateTime"), Jdk8DateCodec.instance);
put(Class.forName("java.time.LocalDate"), Jdk8DateCodec.instance);
put(Class.forName("java.time.LocalTime"), Jdk8DateCodec.instance);
put(Class.forName("java.time.ZonedDateTime"), Jdk8DateCodec.instance);
put(Class.forName("java.time.OffsetDateTime"), Jdk8DateCodec.instance);
put(Class.forName("java.time.OffsetTime"), Jdk8DateCodec.instance);
put(Class.forName("java.time.ZoneOffset"), Jdk8DateCodec.instance);
put(Class.forName("java.time.ZoneRegion"), Jdk8DateCodec.instance);
put(Class.forName("java.time.Period"), Jdk8DateCodec.instance);
put(Class.forName("java.time.Duration"), Jdk8DateCodec.instance);
put(Class.forName("java.time.Instant"), Jdk8DateCodec.instance);
} catch (Throwable th2) {
}
}