Package flexjson

Examples of flexjson.JsonNumber


* to the underlying type found in the JSON stream in these situations we need to convert
* the JsonNumber to something valid: Double or Long.
*/
public class JsonNumberObjectFactory implements ObjectFactory {
    public Object instantiate(ObjectBinder context, Object value, Type targetType, Class targetClass) {
        JsonNumber number = (JsonNumber) value;
        if( number.isLong() ) {
            return number.longValue();
        } else {
            return number.doubleValue();
        }
    }
View Full Code Here

TOP

Related Classes of flexjson.JsonNumber

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.