Package mfinder.annotation

Examples of mfinder.annotation.Result


            res = invocation.invoke(params);
            //result is string
            if (res instanceof String) {
                String resInfo = res.toString();
                ActionProxy ap = invocation.getActionProxy();
                Result result = null;

                //如果action中存在相应的结果映射
                if ((result = ap.getResults().get(resInfo)) != null) {
                    //调用结果对象相应的结果类型
                    Object rr = invokeByResult(invocation, result);
                    if (rr != null)
                        res = rr;
                } //如果Action调用结果的路径信息中包含':'可省略Action中的@Result(name = "*"...)
                else if ((result = ap.getResults().get(match)) != null || resInfo.indexOf(':') != -1) {
                    //非完全匹配字符串路径的调用
                    Object rr = invokeByString(invocation, result, resInfo);
                    if (rr != null)
                        res = rr;
                } //如果全局结果对象集合中存在相应的结果映射
                else if (results.containsKey(resInfo)) {
                    ResultProxy rp = results.get(resInfo);
                    Object rr = rp.invoke(rp.isRequireAction() ? invocation : null);
                    if (rr != null)
                        res = rr;

                    result = rp.getResult();
                    //当Result的type值不为空时,执行相应的ResultType
                    if (StringUtil.isNotNull(result.type())) {
                        rr = invokeByResult(invocation, result);
                        if (rr != null)
                            res = rr;
                    }
                } else {
View Full Code Here


        //parse the string "type:location"
        String[] parseRes = parseMatch(pathinfo, type, loc);
        type = parseRes[0];
        loc = parseRes[1];
        //重新封装result参数
        Result res = new DefaultActionInvocation.ResultProxy(match, type, loc);
        return invokeByResult(invocation, res);
    }
View Full Code Here

     * @param obj 方法所在的对象。
     *
     * @return Result代理对象
     */
    private ResultProxy createResultProxy(Method method, Object obj) {
        Result res = method.getAnnotation(Result.class);
        Class[] params = method.getParameterTypes();

        boolean requireAction = false;
        //ResultType代理的方法无参数或参数仅为ActionInvocation或其子类
        if (params.length == 0) {
View Full Code Here

TOP

Related Classes of mfinder.annotation.Result

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.