예제 #1
0
        public object callMethod(IDictionary context, object target, string methodName, object[] args) // throws MethodFailedException
        {
            Type   targetClass = (target == null) ? null : target.GetType();
            object source      = target;
            IList  methods     = OgnlRuntime.getMethods(targetClass, methodName, false);

            if ((methods == null) || (methods.Count == 0))
            {
                methods = OgnlRuntime.getMethods(targetClass, methodName, true);
                source  = targetClass;
            }
            return(OgnlRuntime.callAppropriateMethod((OgnlContext)context, target, target, methodName, null, methods, args));
        }
예제 #2
0
        /* MethodAccessor interface */
        public object callStaticMethod(IDictionary context, Type targetClass, string methodName, object[] args) // throws MethodFailedException
        {
            IList methods = OgnlRuntime.getMethods(targetClass, methodName, true);

            return(OgnlRuntime.callAppropriateMethod((OgnlContext)context, targetClass, null, methodName, null, methods, args));
        }