Package jsonij.json

Examples of jsonij.json.Value


        }
        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

       
        if(!value.has(attributeName)) {
            return null;
        }
       
        Value regexValue = ((ValueArgument) args[1]).getValue();
       
        if(regexValue.getValueType() != Value.TYPE.STRING) {
            throw new JPathRuntimeException("InvalidArg", args[1]);
        }
       
        Value matchValue = value.get(attributeName);
       
        Pattern pattern = Pattern.compile(regexValue.getString());
        Matcher matcher = pattern.matcher(matchValue.getString());
       
        if(matcher.matches()) {
            return matchValue;
        } else {
            return null;
View Full Code Here

            }
        }
        // Check for JSONCodec
        if (codecStore != null && codecStore.hasCodec(objectClass)) {
            JSONCodec codec = codecStore.getCodec(objectClass);
            Value value = codec.encode(o);
            return value;
        }

        // Find an object inspector
        Inspector inspector = null;
        synchronized (inspectedClasses) {
            if (inspectedClasses.containsKey(objectClass)) {
                inspector = inspectedClasses.get(objectClass);
            } else {
                inspector = new Inspector(o);
                inspector.inspect();
                inspectedClasses.put(objectClass, inspector);
            }
        }
        HashMap<String, Value> valueCollector = new HashMap<String, Value>();
        InspectorProperty[] properties = inspector.getProperties();
        String name = null;
        Value value = null;
        int propCount = 0;
        for (InspectorProperty property : properties) {
            if (!property.hasAccessor()) {
                continue;
            }
View Full Code Here

            return marshaledObject;
        }
    }

    protected Value marshalObjectMethodValue(Method method, Object o, CycleDetector cycleDetector) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        Value value = null;
        Object marshaledObject = method.invoke(o);
        if (marshaledObject == null) {
            value = null;
        } else {
            int hashCode = marshaledObject.hashCode();
View Full Code Here

        }
        return value;
    }

    protected Value marshalObjectFieldValue(Field field, Object o, CycleDetector cycleDetector) throws IllegalArgumentException, IllegalAccessException {
        Value value = null;
        Object marshaledObject = field.get(o);
        if (marshaledObject == null) {
            value = null;
        } else {
            int hashCode = marshaledObject.hashCode();
View Full Code Here

                                expressionStringBuilder.append(c);
                                predicateComponentBuilder.append(c);
                            }
                            value = predicateComponentBuilder.toString().trim();
                            JSONParser jsonParser = new JSONParser();
                            Value jsonValue = jsonParser.parseValue(value);
                            target.skipWhitepace(expressionStringBuilder);
                            ExpressionPredicateCondition predicateCondition = new ExpressionPredicateCondition(attribute, expressionPredicateOperator, jsonValue);
                            if(op != null) {
                                predicateCondition.setCombine(op);
                                op = null;
View Full Code Here

            }
        }
        // Check for JSONCodec
        if (codecStore != null && codecStore.hasCodec(objectClass)) {
            JSONCodec codec = codecStore.getCodec(objectClass);
            Value value = codec.encode(o);
            return value;
        }

        // Find an object inspector
        Inspector inspector = null;
        synchronized (inspectedClasses) {
            if (inspectedClasses.containsKey(objectClass)) {
                inspector = inspectedClasses.get(objectClass);
            } else {
                inspector = new Inspector(o);
                inspector.inspect();
                inspectedClasses.put(objectClass, inspector);
            }
        }

        // Inspect Marshal the JSON Object
        JSON.Object<JSON.String, Value> marshaledObject = new JSON.Object<JSON.String, Value>();

        Inspector.InspectorProperty[] properties = inspector.getProperties();
        String name = null;
        Value value = null;
        for (Inspector.InspectorProperty property : properties) {
            if (property.isIgnore() || !property.isValidAccessor()) {
                continue;
            }
            name = property.getName();
View Full Code Here

        }
        return marshaledObject;
    }

    protected Value marshalObjectMethodValue(Method method, Object o, CycleDetector cycleDetector) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        Value value = null;
        Object marshaledObject = method.invoke(o);
        if (marshaledObject == null) {
            value = null;
        } else {
            int hashCode = marshaledObject.hashCode();
View Full Code Here

        }
        return value;
    }

    protected Value marshalObjectFieldValue(Field field, Object o, CycleDetector cycleDetector) throws IllegalArgumentException, IllegalAccessException {
        Value value = null;
        Object marshaledObject = field.get(o);
        if (marshaledObject == null) {
            value = null;
        } else {
            int hashCode = marshaledObject.hashCode();
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.