Package org.amplafi.json

Examples of org.amplafi.json.JSONArray.asList()


        if ( serialized instanceof JSONArray) {
            jsonArray = (JSONArray) serialized;
        } else {
            jsonArray = new JSONArray(ObjectUtils.toString(serialized, null));
        }
        for(Object o : jsonArray.asList()) {
            T element= (T) dataClassDefinition.getElementDataClassDefinition().deserialize(flowPropertyProvider, flowPropertyDefinition, o);
            collection.add(element);
        }
    }
    @Override
View Full Code Here


    public <K> K fromJson(Class<K> clazz, Object value, Object... parameters) {
        JSONArray array = JSONArray.toJsonArray(value);
        K result = null;
        if ( array != null && !array.isEmpty() ) {
            if ( clazz == Set.class) {
                result = (K) new LinkedHashSet(array.asList());
            } else if (clazz == List.class) {
                result = (K) new ArrayList(array.asList());
            }
        }
        return result;
View Full Code Here

        K result = null;
        if ( array != null && !array.isEmpty() ) {
            if ( clazz == Set.class) {
                result = (K) new LinkedHashSet(array.asList());
            } else if (clazz == List.class) {
                result = (K) new ArrayList(array.asList());
            }
        }
        return result;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.