TypeUtils (fastjson 1.1.26 API)

fastjson



com.alibaba.fastjson.util Class TypeUtils

java.lang.Object
  extended by com.alibaba.fastjson.util.TypeUtils

public class TypeUtils
extends Object

Author:
wenshao

Constructor Summary
 
Method Summary
static void
static void
static
<T> T
cast(Object obj, Class<T> clazz, ParserConfig mapping)
           
static
<T> T
cast(Object obj, ParameterizedType type, ParserConfig mapping)
           
static
<T> T
cast(Object obj, Type type, ParserConfig mapping)
            static BigDecimal castToBigDecimal(Object value)
            static BigInteger castToBigInteger(Object value)
            static Boolean castToBoolean(Object value)
            static Byte castToByte(Object value)
            static byte[] castToBytes(Object value)
            static Character castToChar(Object value)
            static Date castToDate(Object value)
            static Double castToDouble(Object value)
           
static
<T> T
castToEnum(Object obj, Class<T> clazz, ParserConfig mapping)
            static Float castToFloat(Object value)
            static Integer castToInt(Object value)
           
static
<T> T
castToJavaBean(Map<String,Object> map, Class<T> clazz, ParserConfig mapping)
           
static
<T> T
castToJavaBean(Object obj, Class<T> clazz)
            static Long castToLong(Object value)
            static Short castToShort(Object value)
            static Date castToSqlDate(Object value)
            static String castToString(Object value)
            static Timestamp castToTimestamp(Object value)
            static void clearClassMapping()
            static List<FieldInfo> computeGetters(Class<?> clazz, Map<String,String> aliasMap)
            static List<FieldInfo> computeGetters(Class<?> clazz, Map<String,String> aliasMap, boolean sorted)
            static Class<?> getClass(Type type)
            static Class<?> loadClass(String className)
             
Methods inherited from class java.lang.Object
 

Constructor Detail

TypeUtils

public TypeUtils()
Method Detail

castToString

public static final String castToString(Object value)

castToByte

public static final Byte castToByte(Object value)

castToChar

public static final Character castToChar(Object value)

castToShort

public static final Short castToShort(Object value)

castToBigDecimal

public static final BigDecimal castToBigDecimal(Object value)

castToBigInteger

public static final BigInteger castToBigInteger(Object value)

castToFloat

public static final Float castToFloat(Object value)

castToDouble

public static final Double castToDouble(Object value)

castToDate

public static final Date castToDate(Object value)

castToSqlDate

public static final Date castToSqlDate(Object value)

castToTimestamp

public static final Timestamp castToTimestamp(Object value)

castToLong

public static final Long castToLong(Object value)

castToInt

public static final Integer castToInt(Object value)

castToBytes

public static final byte[] castToBytes(Object value)

castToBoolean

public static final Boolean castToBoolean(Object value)

castToJavaBean

public static final <T> T castToJavaBean(Object obj,
                                         Class<T> clazz)

cast

public static final <T> T cast(Object obj,
                               Class<T> clazz,
                               ParserConfig mapping)

castToEnum

public static final <T> T castToEnum(Object obj,
                                     Class<T> clazz,
                                     ParserConfig mapping)

cast

public static final <T> T cast(Object obj,
                               Type type,
                               ParserConfig mapping)

cast

public static final <T> T cast(Object obj,
                               ParameterizedType type,
                               ParserConfig mapping)

castToJavaBean

public static final <T> T castToJavaBean(Map<String,Object> map,
                                         Class<T> clazz,
                                         ParserConfig mapping)

addClassMapping

public static void addClassMapping(String className,
                                   Class<?> clazz)

addBaseClassMappings

public static void addBaseClassMappings()

clearClassMapping

public static void clearClassMapping()

loadClass

public static Class<?> loadClass(String className)

computeGetters

public static List<FieldInfo> computeGetters(Class<?> clazz,
                                             Map<String,String> aliasMap)

computeGetters

public static List<FieldInfo> computeGetters(Class<?> clazz,
                                             Map<String,String> aliasMap,
                                             boolean sorted)

getClass

public static Class<?> getClass(Type type)


Copyright © 2012 Alibaba Group. All Rights Reserved.