使用类定义

ResultConfig resultConfig = new ResultConfig();
String resultName = resultElement.getAttribute("name");
resultConfig.setName(resultName);

String resultView = resultElement.getAttribute("view");

resultConfig.setView(resultView);
String resultRedirect = resultElement.getAttribute("redirect");
if (StringUtils.isEmpty(resultRedirect)){
    resultRedirect = "false";
}
resultConfig.setRedirect(Boolean.parseBoolean(resultRedirect));
String viewParameter = resultElement.getAttribute("viewParameter");
if (!StringUtils.isEmpty(viewParameter)){
    String [] viewParameterArr = StringUtils.split(viewParameter,",");
    for (String viewParameterItem : viewParameterArr) {
        String [] viewParameterItemArr =StringUtils.split(viewParameterItem, ":");
        String key = viewParameterItemArr[0].trim();
        String from = "attribute";
        if (viewParamterItemArr.length == 2){
            from = viewParameterItemArr[1].trim();
        }
        ViewParameterConfig viewParameterConfig = new ViewParameterConfig();
        resultConfig.addViewParameterConfig(viewParameterConfig);
    }
}
actionConfig.addResult(resultName,resultConfig);

ResultConfig
private String name;
private String view;
private boolean redirect;
private List<ViewParameterConfig> viewParameterConfigs = new ArrayList<>();
public void addViewParameterConfig(ViewParameterConfig viewParameterConfig){
    this.viewParameterConfigs.add(viewParameterConfig);
}

public String getName() {
    return name;
}

public void setName(String name) {
    this.name = name;
}

public String getView() {
    return view;
}

public void setView(String view) {
    this.view = view;
}

public boolean isRedirect() {
    return redirect;
}

public void setRedirect(boolean redirect) {
    this.redirect = redirect;
}

public List<ViewParameterConfig> getViewParameterConfigs() {
    return viewParameterConfigs;
}

public void setViewParameterConfigs(List<ViewParameterConfig> viewParameterConfigs) {
    this.viewParameterConfigs = viewParameterConfigs;
}

ViewParameterConfig
private String name;
private String from;

public ViewParameterConfig() {
}

public ViewParameterConfig(String name, String from) {
    this.name = name;
    this.from = from;
}

public String getName() {
    return name;
}

public void setName(String name) {
    this.name = name;
}

public String getFrom() {
    return from;
}

public void setFrom(String from) {
    this.from = from;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值