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) {