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


Java JSON.DEFAULT_TYPE_KEY属性代码示例

本文整理汇总了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) {
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:77,代码来源:SerializeConfig.java


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