Package jsonij.json

Examples of jsonij.json.Value


        }
        return TYPE.UNKOWN;
    }

    protected Value marshalAnyObject(Object o, CycleDetector cycleDetector) {
        Value marshaledObject = null;
        Class<?> objectClass = o.getClass();
        TYPE objectType = inspectObjectType(objectClass);
        switch (objectType) {
            case BOOLEAN:
                marshaledObject = marshalJavaBoolean(o);
View Full Code Here


        }
        return marshaledObject;
    }

    protected Value marshalJavaBoolean(Object o) {
        Value value = null;
        boolean marshaledBoolean = (Boolean) o;
        if (marshaledBoolean) {
            value = JSON.TRUE;
        } else {
            value = JSON.FALSE;
View Full Code Here

        }
        return value;
    }

    protected Value marshalJavaNumeric(Object o) {
        Value value = null;
        Number marshaledNumber = null;
        marshaledNumber = (Number) o;
        if (marshaledNumber != null) {
            value = new JSON.Numeric(marshaledNumber);
        } else {
View Full Code Here

        }
        return value;
    }

    protected Value marshalJavaEnum(Object o) {
        Value value = null;
        if (o != null) {
            String marshaledEnumeration = o.toString();
            value = new JSON.String(marshaledEnumeration);
        } else {
            value = JSON.NULL;
View Full Code Here

        }
        return value;
    }

    protected Value marshalJavaString(Object o) {
        Value value = null;
        String marshaledString = (String) o;
        if (marshaledString != null) {
            value = new JSON.String(marshaledString);
        } else {
            value = JSON.NULL;
View Full Code Here

        }
        return value;
    }

    protected Value marshalJavaArray(Object o, CycleDetector cycleDetector) {
        Value value = null;
        if (o != null) {
            JSON.Array<Value> marshaledArray = new JSON.Array<Value>();
            int size = Array.getLength(o);
            Class<?> type = o.getClass();
            Class<?> componentType = type.getComponentType();
View Full Code Here

        }
        return value;
    }

    protected Value marshalJavaList(Object o, CycleDetector cycleDetector) {
        Value value = null;
        List<?> marshaledList = (List<?>) o;
        if (marshaledList != null) {
            JSON.Array<Value> marshaledArray = new JSON.Array<Value>();
            Iterator<?> marshaledListIterator = marshaledList.listIterator();
            Object listItem = null;
View Full Code Here

        }
        return value;
    }

    protected Value marshalJavaMap(Object o, CycleDetector cycleDetector) {
        Value value = null;
        Map<?, ?> marshaledMap = (Map<?, ?>) o;
        if (marshaledMap != null) {
            JSON.Object<JSON.String, Value> marshaledObject = new JSON.Object<JSON.String, Value>();
            Iterator<?> keySetIterator = marshaledMap.keySet().iterator();
            while (keySetIterator.hasNext()) {
View Full Code Here

        }
        return value;
    }

    protected Value marshalJavaObject(Object o, CycleDetector cycleDetector) {
        Value marshaledValue = javaObjectMarshaler.marshalJavaObject(o, cycleDetector);
        return marshaledValue;
    }
View Full Code Here

        recordEvaluateTime = false;
        lastEvaluateTime = -1;
    }

    public Value evaluate(JSON json) throws JPathRuntimeException {
        Value value = json.getRoot();
        return evaluate(value);
    }
View Full Code Here

TOP

Related Classes of jsonij.json.Value

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.