Package com.astamuse.asta4d.web.dispatch.mapping

Examples of com.astamuse.asta4d.web.dispatch.mapping.UrlMappingRule


    public List<UrlMappingRule> getArrangedRuleList() {
        List<UrlMappingRule> arrangedRuleList = new ArrayList<>(ruleList);

        // config remapped rule at first
        Object reMapId;
        UrlMappingRule copyFromRule;
        for (UrlMappingRule rule : arrangedRuleList) {
            reMapId = rule.extraVar(REMAP_ID_VAR_NAME);
            if (reMapId == null) {
                continue;
            }
            copyFromRule = searchRuleById(arrangedRuleList, reMapId.toString());
            rule.setAttributeList(new ArrayList<>(copyFromRule.getAttributeList()));
            rule.setExtraVarMap(new HashMap<>(copyFromRule.getExtraVarMap()));
            rule.setHandlerList(new ArrayList<>(copyFromRule.getHandlerList()));
            rule.setInterceptorList(new ArrayList<>(copyFromRule.getInterceptorList()));
            rule.setPriority(copyFromRule.getPriority());
            rule.setResultTransformerList(new ArrayList<>(copyFromRule.getResultTransformerList()));
        }

        Collections.sort(arrangedRuleList, new Comparator<UrlMappingRule>() {
            @Override
            public int compare(UrlMappingRule r1, UrlMappingRule r2) {
View Full Code Here


        return arrangedRuleList;
    }

    private UrlMappingRule createDefaultRule(HttpMethod method, String sourcePath) {
        UrlMappingRule rule = new UrlMappingRule();
        ruleList.add(rule);

        rule.setMethod(method);
        rule.setSourcePath(sourcePath);
        rule.setSeq(Sequencer.incrementAndGet());
        rule.setPriority(DEFAULT_PRIORITY);

        return rule;
    }
View Full Code Here

        HandyRuleWithRemap handyRule = new HandyRuleWithRemap(createDefaultRule(method, sourcePath));
        return handyRule;
    }

    public HandyRuleWithAttrOnly add(HttpMethod method, String sourcePath, String targetPath) {
        UrlMappingRule rule = createDefaultRule(method, sourcePath);
        HandyRule handyRule = new HandyRule(rule);
        handyRule.forward(targetPath);
        return new HandyRuleWithAttrOnly(rule);
    }
View Full Code Here

        }

        WebApplicationContext context = (WebApplicationContext) Context.getCurrentThreadContext();
        writePathVarToContext(context, result.getPathVarMap());

        UrlMappingRule rule = result.getRule();
        context.setData(KEY_CURRENT_RULE, rule);
        writePathVarToContext(context, rule.getExtraVarMap());
        retrieveFlashScopeData(request);

        List<ContentProvider<?>> requestResult = handleRequest(rule);
        ContentWriter cw;
        for (ContentProvider<?> cp : requestResult) {
View Full Code Here

TOP

Related Classes of com.astamuse.asta4d.web.dispatch.mapping.UrlMappingRule

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.