Examples of evaluate()


Examples of com.alibaba.fastjson.support.odps.udf.JSONArrayAdd.evaluate()

public class JSONArrayAdd_int extends TestCase {
    public void test_udf() throws Exception {
        JSONArrayAdd udf = new JSONArrayAdd();
       
        String text = udf.evaluate("[]", "$", new Long(1), new Long(2));
        Assert.assertEquals("[1,2]", text);
    }
   
    public void test_double() throws Exception {
        JSONArrayAdd udf = new JSONArrayAdd();

Examples of com.alibaba.fastjson.support.odps.udf.JSONContains.evaluate()

public class JSONContains_Test extends TestCase {

    public void test_contians() throws Exception {
        JSONContains udf = new JSONContains();
        Assert.assertTrue(udf.evaluate("{\"name\":\"123\"}", "$.name"));
        Assert.assertFalse(udf.evaluate("{\"name\":\"123\"}", "$.value"));
    }

}

Examples of com.alibaba.fastjson.support.odps.udf.JSONContainsValue.evaluate()


public class JSONContainsValue_Test extends TestCase {
    public void test_contians() throws Exception {
        JSONContainsValue udf = new JSONContainsValue();
        Assert.assertTrue(udf.evaluate("{\"name\":\"123\"}", "$.name", "123"));
        Assert.assertFalse(udf.evaluate("{\"name\":\"123\"}", "$.name", "124"));
        Assert.assertTrue(udf.evaluate("{\"name\":\"123\"}", "$.value", (Long) null));
    }
   
    public void test_array_contians() throws Exception {

Examples of com.alibaba.fastjson.support.odps.udf.JSONExtract.evaluate()


public class GetJSONObjectTest extends TestCase {
    public void test_udf() throws Exception {
        JSONExtract udf = new JSONExtract();
        String result = udf.evaluate("{\"id\":123,\"name\":\"wenshao\"}", "$");
        System.out.println(result);
    }
}

Examples of com.alibaba.fastjson.support.odps.udf.JSONSet.evaluate()

public class JSONSetTest extends TestCase {
    public void test_udf() throws Exception {
        JSONSet udf = new JSONSet();
       
        String text = udf.evaluate("[0,1,2]", "$[1]", new Long(123));
        Assert.assertEquals("[0,123,2]", text);
    }
   
    public void test_double() throws Exception {
        JSONSet udf = new JSONSet();

Examples of com.alibaba.tamper.process.script.ScriptExecutor.evaluate()

                param.putAll(newParam);
            }

            // 进行值转化处理
            ScriptExecutor scriptExecutor = ScriptHelper.getInstance().getScriptExecutor();
            value = scriptExecutor.evaluate(param, currentField.getScript());
        }

        // 继续走到下一步处理
        return invocation.proceed(value);

Examples of com.alibaba.toolkit.util.collection.Predicate.evaluate()

        // ͨ��ָ����predicate��������ƥ����
        for (Iterator i = matchItemList.iterator(); i.hasNext();) {
            MatchItem item = (MatchItem) i.next();

            if (predicate.evaluate(item)) {
                context.setLastMatchItem(item);
                return true;
            }
        }

Examples of com.antlersoft.query.SetExpression.evaluate()

        line=in.readLine();
        if ( line==null || line.length()==0)
      break;
        qp.setLine( line);
        SetExpression se=qp.getExpression();
        Enumeration e=se.evaluate( sadb);
        while ( e.hasMoreElements())
        {
      System.out.println( e.nextElement().toString());
        }
    }

Examples of com.bazaarvoice.jolt.common.pathelement.DollarPathElement.evaluate()

        if ( this.pathElement instanceof DollarPathElement ) {
            DollarPathElement subRef = (DollarPathElement) this.pathElement;

            // The data is the parent key, so evaluate against the parent's path
            data = subRef.evaluate( walkedPath );
            realChild = false// don't block further Shiftr matches
        }
        else if ( this.pathElement instanceof AtPathElement ) {

            // The data is our parent's data

Examples of com.bazaarvoice.jolt.common.pathelement.EvaluatablePathElement.evaluate()

        ShiftrWriter outputPath = new ShiftrWriter( "&(1,2).&.value" );
        WalkedPath twoSteps = new WalkedPath( null, lpe );
        twoSteps.add( null, lpe2 );
        {
            EvaluatablePathElement outputElement = (EvaluatablePathElement) outputPath.get( 0 );
            String evaledLeafOutput = outputElement.evaluate( twoSteps );
            AssertJUnit.assertEquals( "AAA", evaledLeafOutput );
        }
        {
            EvaluatablePathElement outputElement = (EvaluatablePathElement) outputPath.get( 1 );
            String evaledLeafOutput = outputElement.evaluate( twoSteps );
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.