1700485370
1700485371
//方法名,默认是execute
1700485372
1700485373
private String methodName=“excuete”;
1700485374
1700485375
//视图路径
1700485376
1700485377
private String view;
1700485378
1700485379
public String getActionName(){
1700485380
1700485381
return actionName;
1700485382
1700485383
}
1700485384
1700485385
public String getActionClass(){
1700485386
1700485387
return actionClass;
1700485388
1700485389
}
1700485390
1700485391
public String getMethodName(){
1700485392
1700485393
return methodName;
1700485394
1700485395
}
1700485396
1700485397
public abstract String getView(String Result);
1700485398
1700485399
}
1700485400
1700485401
它是一个抽象类,其中的getView是一个抽象方法,是根据执行结果查找到视图路径。只要编写一个适配器就可以把Elemet对象转为Action节点,如代码清单38-28所示。
1700485402
1700485403
代码清单38-28 Action节点
1700485404
1700485405
public class XmlActionNode extends ActionNode{
1700485406
1700485407
//需要转换的element
1700485408
1700485409
private Element el;
1700485410
1700485411
//通过构造函数传递
1700485412
1700485413
public XmlActionNode(Element_el){
1700485414
1700485415
this.el=_el;
1700485416
1700485417
}
1700485418
1700485419
@Override
[
上一页 ]
[ :1.70048537e+09 ]
[
下一页 ]