public static Object getInstance() { Object o = fn; if (o == null) { synchronized (Functions.class) { o = new CoreFunctions(); fn = o; } } return o; }
/** * @since 5.9.3 */ protected Map<String, Object> getBindings(OperationContext ctx) { return Scripting.initBindings(ctx); } }
public static Expression newTemplate(String expr) { return new MvelTemplate(expr); }
@OperationMethod public Blob run() throws CompileException, RuntimeException { if (expr == null) { String text = script.replaceAll("<", "<"); text = text.replaceAll(">", ">"); text = text.replaceAll("&", "&"); expr = Scripting.newExpression(text); } return (Blob) expr.eval(ctx); }
public DateWrapper calendar(Calendar date) { return new DateWrapper(date); }
/** * Evaluate the expression against this context if needed * * @param obj * @return the resolved value * @since 9.1 */ public Object resolve(Object obj) { if (!(obj instanceof Expression)) { return obj; } return ((Expression) obj).eval(this); }
public DateWrapper years(int years) { return dateWrapper(Calendar.YEAR, years); }
public DocumentWrapper getWorkspace() { return getParent("Workspace"); }
public GroovyScripting(boolean debug) { this(getParentLoader(), debug); }
@Override public String toString() { return toQueryString(); }
public static Expression newExpression(String expr) { return new MvelExpression(expr); }
@OperationMethod public DocumentModel run() throws CompileException, RuntimeException { if (expr == null) { String text = script.replaceAll("<", "<"); text = text.replaceAll(">", ">"); text = text.replaceAll("&", "&"); expr = Scripting.newExpression(text); } return (DocumentModel) expr.eval(ctx); }
public DateWrapper date(Date date) { return new DateWrapper(date); }
public DateWrapper weeks(int weeks) { return dateWrapper(Calendar.WEEK_OF_MONTH, weeks); }
public static void setInstance(Object fn) { if (fn == null) { fn = new CoreFunctions(); } synchronized (Functions.class) { Functions.fn = fn; } }
public DocumentWrapper getDomain() { return getParent("Domain"); }
@OperationMethod public DocumentModelList run() throws CompileException, RuntimeException { if (expr == null) { String text = script.replaceAll("<", "<"); text = text.replaceAll(">", ">"); text = text.replaceAll("&", "&"); expr = Scripting.newExpression(text); } return (DocumentModelList) expr.eval(ctx); }
public DateWrapper days(int days) { return dateWrapper(Calendar.DAY_OF_MONTH, days); }
public DateWrapper seconds(int seconds) { return dateWrapper(Calendar.SECOND, seconds); }
public DateWrapper months(int months) { return dateWrapper(Calendar.MONTH, months); }