public Object getValue( OgnlContext context, Object rootObject ) throws OgnlException { return Ognl.getValue( expression, context, rootObject ); }
private static Object executeExpression( final IEngineConfiguration configuration, final Object parsedExpression, final Map<String,Object> context, final Object root) throws Exception { if (parsedExpression instanceof OGNLShortcutExpression) { return ((OGNLShortcutExpression) parsedExpression).evaluate(configuration, context, root); } // We create the OgnlContext here instead of just sending the Map as context because that prevents OGNL from // creating the OgnlContext empty and then setting the context Map variables one by one final OgnlContext ognlContext = new OgnlContext(context); return ognl.Ognl.getValue(parsedExpression, ognlContext, root); }
Object res = Ognl.getValue(object, context, context.getRoot(), valueType); return (T) res;
@Override public Object get(String express) throws ExpressException { try { context.setMemberAccess(new DefaultMemberAccess(true)); return Ognl.getValue(express, context, bindObject); } catch (Exception e) { throw new ExpressException(express, e); } }
@Override public Object get(String express) throws ExpressException { try { context.setMemberAccess(new DefaultMemberAccess(true)); return Ognl.getValue(express, context, bindObject); } catch (Exception e) { throw new ExpressException(express, e); } }
public boolean evaluate() { try { return constraint == null || (Boolean) Ognl.getValue(constraint, bindings, (Object) null); } catch (OgnlException ex) { throw new EvaluationException(ex); } }
public Object evaluateNoException() { try { return Ognl.getValue(source, context, root); } catch (OgnlException e) { exception = e; } return null; }
public Object getProperty(Object object, String property) { if ((object == null) || (property == null)) { return null; } try { return Ognl.getValue(property, object); } catch (OgnlException e) { return null; } }
public static Object getValue(String path, Object object){ try{ return Ognl.getValue(path, object); }catch(Exception e){ return null; } }
public Object getProperty(Object object, String property) { if ((object == null) || (property == null)) { return null; } try { return Ognl.getValue(property, object); } catch (OgnlException e) { return null; } }
public Object getValueExpression(Object expression,Object root,Map context) { Object ret=null; try { ret = Ognl.getValue(expression, context, root); } catch (Exception re) { catchException(re,expression,root,context,"EBRI0002"); } return ret; }
public static Object getValue(String path, ActionContext actionContext) throws OgnlException{ if(path == null || "".equals(path)){ return null; } ActionContext context = (ActionContext) actionContext.get("context"); return Ognl.getValue(path, context); } }
public static void deleteNode(Object node, Map<String, Object> treeNodes) throws OgnlException{ Object nodeId = Ognl.getValue("id", node); if(nodeId != null){ TreeItem treeItem = (TreeItem) treeNodes.get(nodeId.toString()); treeNodes.remove(nodeId.toString()); treeItem.dispose(); } }
public Void execute(Object expr) throws OgnlException { Object value = Ognl.getValue(expr, contextFrom, from); Ognl.setValue(expr, contextTo, to, value); return null; } });
public boolean evaluate() { try { return constraint == null || (Boolean) Ognl.getValue(constraint, bindings, (Object) null); } catch (OgnlException ex) { throw new EvaluationException(ex); } }
public static Object create(ActionContext actionContext) throws OgnlException{ Thing self = actionContext.getObject("self"); String type = self.getString("type"); if("Var".equals(type)){ return Ognl.getValue(self.getString("varName"), actionContext); }else if("DecimalFormat".equals(type)){ return new DecimalFormat(self.getString("format")); } return null; }
protected Object evaluate(Object o, ResourcePropertyMapping resourcePropertyMapping) throws ConversionException { OgnlContext ctx = new OgnlContext(); ctx.put(DATA_CONTEXT_KEY, o); try { return Ognl.getValue(expression, ctx, o); } catch (Exception e) { throw new ConversionException("Failed to evaluate [" + o + "] with expression [" + expression + "]", e); } } }
public Object evaluate(String expression) { Check.notNull(rootObject, "Root object is null"); Check.notNull(expression, "Expression to evaluate cannot be null"); try { return Ognl.getValue(expression, ognlContext, rootObject); } catch (OgnlException e) { throw invalidExpressionException(e); } }
public static Object run(ActionContext actionContext) throws OgnlException{ Thing self = (Thing) actionContext.get("self"); String value = self.getString("value"); //通过Ognl表达式获取 //log.info("value=" + value); Object data = Ognl.getValue(value, actionContext); UtilAction.putVarByActioScope(self, self.getString("varName"), data, actionContext); return data; }
public static Object getValue(String script, Map<String, Object> paramMap) { OgnlContext context = new OgnlContext(null, null, new DefaultMemberAccess(true)); try { return Ognl.getValue(script, context, paramMap); } catch (OgnlException e) { throw new UtilException(e); } } }