public void testObjectIndexInSubclass() // throws OgnlException { SimpleNode expression = (SimpleNode)Ognl.parseExpression("#ka.sunk[#root]"); context ["ka"] = (new Test2()); Ognl.getValue(expression, context, "aksdj"); }
public SimpleNode getExpression() // throws OgnlException { if (expression == null) { expression = (SimpleNode)Ognl.parseExpression(expressionString); } return(expression); }
/*=================================================================== * Constructors * ===================================================================*/ public Performance(string name, string expressionString, string javaMethodName) // throws OgnlException { this.name = name; expression = (SimpleNode)Ognl.parseExpression(expressionString); try { method = GetType().GetMethod(javaMethodName, new Type[] {}); } catch (Exception ex) { throw new OgnlException("java method not found", ex); } }
public void testMultipleObjectIndexMethodPairs() // throws OgnlException { SimpleNode expression = (SimpleNode)Ognl.parseExpression("#ka.sunk[#root]"); context ["ka"] = (new Test5()); try { Ognl.getValue(expression, context, "aksdj"); Assert.Fail(); } catch (OgnlException ex) { /* Should throw */ } }
protected override void setValueBody(OgnlContext context, object target, object value) // throws OgnlException { object expr = children[0].getValue(context, target), previousRoot = context.getRoot(); Node node; target = children[1].getValue(context, target); node = (expr is Node) ? (Node)expr : (Node)Ognl.parseExpression(expr.ToString()); try { context.setRoot(target); node.setValue(context, target, value); } finally { context.setRoot(previousRoot); } }
protected override object getValueBody(OgnlContext context, object source) // throws OgnlException { object result, expr = children[0].getValue(context, source), previousRoot = context.getRoot(); Node node; source = children[1].getValue(context, source); node = (expr is Node) ? (Node)expr : (Node)Ognl.parseExpression(expr.ToString()); try { context.setRoot(source); result = node.getValue(context, source); } finally { context.setRoot(previousRoot); } return(result); }