當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。