1 package com.opensymphony.webwork.config_browser; 2 3 import com.opensymphony.xwork.ActionSupport; 4 import com.opensymphony.xwork.validator.ActionValidatorManager; 5 6 import java.util.Collections ; 7 import java.util.List ; 8 9 15 public class ListValidatorsAction extends ActionSupport { 16 private Class clazz; 17 private String context; 18 List validators = Collections.EMPTY_LIST; 19 20 public Class getClazz() { 21 return clazz; 22 } 23 24 public void setClazz(Class clazz) { 25 this.clazz = clazz; 26 } 27 28 public String stripPackage(Class clazz) { 29 return clazz.getName().substring(clazz.getName().lastIndexOf('.') + 1); 30 } 31 32 public String getContext() { 33 return context; 34 } 35 36 public void setContext(String context) { 37 this.context = context; 38 } 39 40 public List getValidators() { 41 return validators; 42 } 43 44 public String execute() throws Exception { 45 loadValidators(); 46 return super.execute(); 47 } 48 49 protected void loadValidators() { 50 validators = ActionValidatorManager.getValidators(clazz, context); 51 } 52 } 53 | Popular Tags |