예제 #1
0
        protected override void setValueBody(OgnlContext context, object target, object value) // throws OgnlException
        {
            object test   = children[0].getValue(context, target);
            int    branch = OgnlOps.booleanValue(test)? 1 : 2;

            children[branch].setValue(context, target, value);
        }
예제 #2
0
        protected override object getValueBody(OgnlContext context, object source) // throws OgnlException
        {
            object v1 = children[0].getValue(context, source);
            object v2 = children[1].getValue(context, source);

            return(OgnlOps.remainder(v1, v2));
        }
예제 #3
0
        protected override object getValueBody(OgnlContext context, object source) // throws OgnlException
        {
            object v1 = children[0].getValue(context, source);
            object v2 = children[1].getValue(context, source);

            return(OgnlOps.operin(v1, v2)? false : true);
        }
예제 #4
0
        protected override object getValueBody(OgnlContext context, object source) // throws OgnlException
        {
            object test   = children[0].getValue(context, source);
            int    branch = OgnlOps.booleanValue(test)? 1 : 2;

            return(children[branch].getValue(context, source));
        }
예제 #5
0
        protected override object getValueBody(OgnlContext context, object source) // throws OgnlException
        {
            object result = children[0].getValue(context, source);

            for (int i = 1; i < children.Length; ++i)
            {
                result = OgnlOps.multiply(result, children[i].getValue(context, source));
            }
            return(result);
        }
예제 #6
0
        protected override void setValueBody(OgnlContext context, object target, object value) // throws OgnlException
        {
            int last = children.Length - 1;

            for (int i = 0; i < last; ++i)
            {
                object v = children[i].getValue(context, target);
                if (OgnlOps.booleanValue(v))
                {
                    return;
                }
            }
            children[last].setValue(context, target, value);
        }
예제 #7
0
        protected override object getValueBody(OgnlContext context, object source) // throws OgnlException
        {
            object result = null;
            int    last   = children.Length - 1;

            for (int i = 0; i <= last; ++i)
            {
                result = children[i].getValue(context, source);
                if (i != last && OgnlOps.booleanValue(result))
                {
                    break;
                }
            }
            return(result);
        }
예제 #8
0
        /*===================================================================
        *       Overridden methods
        *  ===================================================================*/
        protected internal override void runTest()         // throws OgnlException
        {
            object result;

            result = OgnlOps.convertValue(value, toClass);
            if (!isEqual(result, expectedValue))
            {
                if (scale >= 0)
                {
                    double scalingFactor = Math.Pow(10, scale),
                           v1            = Convert.ToDouble(value) * scalingFactor,
                           v2            = Convert.ToDouble(expectedValue) * scalingFactor;

                    Assert.IsTrue((int)v1 == (int)v2);
                }
                else
                {
                    Assert.Fail();
                }
            }
        }
예제 #9
0
 protected override object getValueBody(OgnlContext context, object source) // throws OgnlException
 {
     return(OgnlOps.negate(children[0].getValue(context, source)));
 }
예제 #10
0
 protected override object getValueBody(OgnlContext context, object source) // throws OgnlException
 {
     return(OgnlOps.booleanValue(children[0].getValue(context, source))? false : true);
 }