コード例 #1
0
        public void testObjectIndexInSubclass()         // throws OgnlException
        {
            SimpleNode expression = (SimpleNode)Ognl.parseExpression("#ka.sunk[#root]");

            context ["ka"] = (new Test2());
            Ognl.getValue(expression, context, "aksdj");
        }
コード例 #2
0
 public SimpleNode getExpression()         // throws OgnlException
 {
     if (expression == null)
     {
         expression = (SimpleNode)Ognl.parseExpression(expressionString);
     }
     return(expression);
 }
コード例 #3
0
 /*===================================================================
 *       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);
     }
 }
コード例 #4
0
        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 */
            }
        }
コード例 #5
0
ファイル: ASTEval.cs プロジェクト: KidFashion/OGNL.Net
        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);
            }
        }
コード例 #6
0
ファイル: ASTEval.cs プロジェクト: KidFashion/OGNL.Net
        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);
        }