Github user shubham-pathak22 commented on a diff in the pull request:

    
https://github.com/apache/incubator-apex-malhar/pull/170#discussion_r49583462
  
    --- Diff: 
library/src/main/java/com/datatorrent/lib/expressions/ExpressionEvaluator.java 
---
    @@ -0,0 +1,440 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package com.datatorrent.lib.expressions;
    +
    +import org.codehaus.commons.compiler.CompilerFactoryFactory;
    +import org.codehaus.commons.compiler.IScriptEvaluator;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.lang.reflect.Field;
    +import java.lang.reflect.Method;
    +import java.lang.reflect.Modifier;
    +import java.util.*;
    +import java.util.regex.Matcher;
    +import java.util.regex.Pattern;
    +
    +/**
    + * This class is used for evaluating expressions which takes multiple 
parameter object and the result is returned for that expression.
    + *
    + * The way to reference a variable in an object is ${placeholder.varname}.
    + * The variable will be resolved to its accessible variable or getter 
method in order. After this the variable can be used as if its a Java variable.
    + *
    + * ExpressionEvaluator also allows you to set extra imports that needs to 
be added over default is java.lang.*
    + *
    + * ExpressionEvaluator needs to be configured with following 
configurations as minimal configuration:
    + * 1. Mapping of input object place holders to it corresponding types.
    + * This can be done with setInputObjectPlaceholders method.
    + * 2. Return type of of expression evaluation.
    + * 3. Expression to be evaluated. This is a standard java expression 
except for referencing the variable inside object JEL syntax needs to be used 
i.e. ${objectPlaceHolder.varName}
    + *
    + * Expression cab be defined as per JSL 7 syntax:
    --- End diff --
    
    can


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to