try {if (true) return FunctionCallExpression.createFunctionCall(func_name.image, arg_list);}
/** * Evalutate the given expression, which consists of a call to this function, in the context given. Creates * a list containing the evaluated results of its argument expressions. * * @param expr - the expression consisting of a call to this function. * @param message_ctx - the context in which the call is being evaluated. * @return java.util.List - the result of the evaluation. */ public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message) throws javax.jms.JMSException { java.util.ArrayList ele_arr; int num_arg; int cur; num_arg = expr.getNumArguments(); ele_arr = new java.util.ArrayList(num_arg); cur = 0; while (cur < num_arg) { ele_arr.add(expr.getArgument(cur).evaluate(message)); cur++; } return (java.util.List) ele_arr; } }
public static void register() { FunctionCallExpression.registerFunction("INLIST", new inListFunction()); FunctionCallExpression.registerFunction("MAKELIST", new makeListFunction()); FunctionCallExpression.registerFunction("REGEX", new regexMatchFunction()); FunctionCallExpression.registerFunction("REPLACE", new replaceFunction()); FunctionCallExpression.registerFunction("SPLIT", new splitFunction()); } }
/** * Check whether the given expression is valid for this function. * * @param expr - the expression consisting of a call to this function. * @return true - if two or three arguments are passed to the function; false - otherwise. */ public boolean isValid(FunctionCallExpression expr) { if ((expr.getNumArguments() >= 2) && (expr.getNumArguments() <= 3)) return true; return false; }
/** * Evalutate the given expression, which consists of a call to this function, in the context given. Checks * whether the second argument is a member of the list in the first argument. * * @param expr - the expression consisting of a call to this function. * @param message_ctx - the context in which the call is being evaluated. * @return Boolean - the result of the evaluation. */ public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message_ctx) throws javax.jms.JMSException { java.util.List arr; int cur; Object cand; boolean found_f; arr = (java.util.List) expr.getArgument(0).evaluate(message_ctx); cand = expr.getArgument(1).evaluate(message_ctx); cur = 0; found_f = false; while ((cur < arr.size()) && (!found_f)) { found_f = arr.get(cur).equals(cand); cur++; } return Boolean.valueOf(found_f); } }
result = new FunctionCallExpression(func_name, args);
/** * Check whether the given expression is valid for this function. * * @param expr - the expression consisting of a call to this function. * @return true - if three arguments are passed to the function; false - otherwise. */ public boolean isValid(FunctionCallExpression expr) { if (expr.getNumArguments() == 3) return true; return false; }
/** * Evaluate the given expression for this function in the given context. The result of the evaluation is a * string with all matches of the regular expression, from the evaluation of the second argument, replaced by * the string result from the evaluation of the third argument. Replacement is performed by * String#replaceAll(). * <p/> * Note that all three arguments must be Strings. * * @param expr - the expression consisting of a call to this function. * @return String - the result of the replacement. */ public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message_ctx) throws javax.jms.JMSException { String src; String match_regex; String repl_lit; String result; src = (String) expr.getArgument(0).evaluate(message_ctx); match_regex = (String) expr.getArgument(1).evaluate(message_ctx); repl_lit = (String) expr.getArgument(2).evaluate(message_ctx); result = src.replaceAll(match_regex, repl_lit); return result; } }
result = new FunctionCallExpression(func_name, args);
String[] result; src = (String) expr.getArgument(0).evaluate(message_ctx); split_pat = (String) expr.getArgument(1).evaluate(message_ctx); if (expr.getNumArguments() > 2) { Integer limit; limit = (Integer) expr.getArgument(2).evaluate(message_ctx);
/** * Check whether the given expression is a valid call of this function. Two arguments are required. When * evaluated, the arguments are converted to strings if they are not already strings. * * @param expr - the expression consisting of a call to this function. * @return true - if the expression is valid; false - otherwise. */ public boolean isValid(FunctionCallExpression expr) { if (expr.getNumArguments() == 2) return true; return false; }
reg = expr.getArgument(0).evaluate(message); cand = expr.getArgument(1).evaluate(message);
public static void register() { FunctionCallExpression.registerFunction("INLIST", new inListFunction()); FunctionCallExpression.registerFunction("MAKELIST", new makeListFunction()); FunctionCallExpression.registerFunction("REGEX", new regexMatchFunction()); FunctionCallExpression.registerFunction("REPLACE", new replaceFunction()); FunctionCallExpression.registerFunction("SPLIT", new splitFunction()); } }
try {if (true) return FunctionCallExpression.createFunctionCall(func_name.image, arg_list);}
result = new FunctionCallExpression(func_name, args);
/** * Evalutate the given expression, which consists of a call to this function, in the context given. Creates * a list containing the evaluated results of its argument expressions. * * @param expr - the expression consisting of a call to this function. * @param message_ctx - the context in which the call is being evaluated. * @return java.util.List - the result of the evaluation. */ public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message) throws javax.jms.JMSException { java.util.ArrayList ele_arr; int num_arg; int cur; num_arg = expr.getNumArguments(); ele_arr = new java.util.ArrayList(num_arg); cur = 0; while (cur < num_arg) { ele_arr.add(expr.getArgument(cur).evaluate(message)); cur++; } return (java.util.List) ele_arr; } }
/** * Check whether the given expression is a valid call of this function. Two arguments are required. Note that * the evaluated results of the arguments will be compared with Object#equals(). * * @param expr - the expression consisting of a call to this function. * @return true - if the expression is valid; false - otherwise. */ public boolean isValid(FunctionCallExpression expr) { if (expr.getNumArguments() != 2) return false; return true; }
/** * Evaluate the given expression for this function in the given context. The result of the evaluation is a * string with all matches of the regular expression, from the evaluation of the second argument, replaced by * the string result from the evaluation of the third argument. Replacement is performed by * String#replaceAll(). * <p/> * Note that all three arguments must be Strings. * * @param expr - the expression consisting of a call to this function. * @return String - the result of the replacement. */ public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message_ctx) throws javax.jms.JMSException { String src; String match_regex; String repl_lit; String result; src = (String) expr.getArgument(0).evaluate(message_ctx); match_regex = (String) expr.getArgument(1).evaluate(message_ctx); repl_lit = (String) expr.getArgument(2).evaluate(message_ctx); result = src.replaceAll(match_regex, repl_lit); return result; } }
public static void register() { FunctionCallExpression.registerFunction("INLIST", new inListFunction()); FunctionCallExpression.registerFunction("MAKELIST", new makeListFunction()); FunctionCallExpression.registerFunction("REGEX", new regexMatchFunction()); FunctionCallExpression.registerFunction("REPLACE", new replaceFunction()); FunctionCallExpression.registerFunction("SPLIT", new splitFunction()); } }
try {if (true) return FunctionCallExpression.createFunctionCall(func_name.image, arg_list);}