1 28 29 package com.caucho.jsp.cfg; 30 31 import com.caucho.config.types.InitParam; 32 import com.caucho.util.BeanUtil; 33 import com.caucho.util.RegistryException; 34 35 import javax.servlet.jsp.tagext.TagLibraryValidator ; 36 import java.util.HashMap ; 37 38 41 public class TldValidator { 42 private Class _validatorClass; 43 private HashMap <String ,String > _initParamMap = new HashMap <String ,String >(); 44 private String _description; 45 46 49 public void setValidatorClass(Class validatorClass) 50 throws RegistryException 51 { 52 _validatorClass = validatorClass; 53 54 BeanUtil.validateClass(_validatorClass, TagLibraryValidator .class); 55 } 56 57 60 public Class getValidatorClass() 61 { 62 return _validatorClass; 63 } 64 65 68 public void addInitParam(String name, String value) 69 { 70 _initParamMap.put(name, value); 71 } 72 73 76 public void setInitParam(InitParam initParam) 77 { 78 _initParamMap.putAll(initParam.getParameters()); 79 } 80 81 84 public HashMap getInitParamMap() 85 { 86 return _initParamMap; 87 } 88 89 92 public void setDescription(String description) 93 { 94 _description = description; 95 } 96 97 100 public String getDescription() 101 { 102 return _description; 103 } 104 105 108 public TagLibraryValidator getValidator() 109 throws Exception 110 { 111 TagLibraryValidator validator; 112 113 validator = (TagLibraryValidator ) _validatorClass.newInstance(); 114 115 validator.setInitParameters(_initParamMap); 116 117 return validator; 118 } 119 } 120 | Popular Tags |