/** * <p> * Returns true if the string-value of the * first item in <code>args</code> contains string-value of the second * item; false otherwise. * If necessary one or both items are converted to a string as if by the XPath * <code>string()</code> function. * </p> * * @param context the context at the point in the * expression when the function is called * @param args a list containing exactly two items * * @return the result of evaluating the function; * <code>Boolean.TRUE</code> or <code>Boolean.FALSE</code> * * @throws FunctionCallException if <code>args</code> does not have exactly two items */ public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 2) { return evaluate(args.get(0), args.get(1), context.getNavigator() ); } throw new FunctionCallException("contains() requires two arguments."); }
new ContainsFunction() );
"contains", new ContainsFunction());
"contains", new ContainsFunction());