Package jsonij.json

Examples of jsonij.json.Value


        Value value = json.getRoot();
        return evaluate(value);
    }

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


    }

    @Override
    public Value parse(java.lang.String target) throws IOException, ParserException {
        long requestStart = System.nanoTime();
        Value value = super.parse(target);
        long requestComplete = System.nanoTime();
        benchmark.reset();
        benchmark.setStartTime(requestStart);
        benchmark.setFinishTime(requestComplete);
        benchmark.setInstance(target);
        benchmark.setSteps(value.nestedSize());
        return value;
    }
View Full Code Here

    }

    @Override
    public Value parse(Reader targetReader) throws IOException, ParserException {
        long requestStart = System.nanoTime();
        Value value = super.parse(targetReader);
        long requestComplete = System.nanoTime();
        benchmark.reset();
        benchmark.setStartTime(requestStart);
        benchmark.setFinishTime(requestComplete);
        String instanceString = "";
        targetReader.reset();
        int c;
        while((c = targetReader.read()) != -1) {
            instanceString += (char) c;
        }
        benchmark.setInstance(instanceString);
        benchmark.setSteps(value.nestedSize());
        return value;
    }
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

        return String.format("KeyComponent [%s]", value);
    }

    @Override
    public List<Value> evaluate(List<Value> values, List<Value> results) {
        Value valueStore = null;
        for(Value currentValue: values) {
            String keyValue = getValue();
            if(currentValue.getValueType() == Value.TYPE.OBJECT) {
                valueStore = currentValue.get(keyValue);
                if(valueStore != null) {
View Full Code Here

    public List<Value> evaluate(List<Value> values, List<Value> results) {

        for (Value value : values) {
            if (value.getValueType() == Value.TYPE.ARRAY) {
                for (int j = 0; j < value.size(); j++) {
                    Value checkElement = value.get(j);
                    if (checkElement.getValueType() == Value.TYPE.OBJECT) {
                        boolean expressionValid = true;
                        for (ExpressionPredicateCondition condition : conditions) {
                            Value checkValue = checkElement.get(condition.getAttribute());
                            if (checkValue == null) {
                                expressionValid = false;
                                break;
                            }
                            ExpressionPredicateOperator expressionConditionOperator = condition.getOperator();
                            if (expressionConditionOperator.equals(ExpressionPredicateOperator.NOT_NULL)) {
                                if (checkValue.isNull()) {
                                    expressionValid = false;
                                    break;
                                }
                            } else if (expressionConditionOperator.equals(ExpressionPredicateOperator.EQUAL)) {
                                if (!checkValue.equals(condition.value)) {
                                    expressionValid = false;
                                    break;
                                }
                            } else if (expressionConditionOperator.equals(ExpressionPredicateOperator.LESS)) {
                            } else if (expressionConditionOperator.equals(ExpressionPredicateOperator.GREATER)) {
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.