1 5 package xdoclet.modules.sybase.easerver.ejb; 6 7 import org.apache.commons.logging.Log; 8 9 import xdoclet.XDocletException; 10 import xdoclet.XDocletMessages; 11 import xdoclet.modules.ejb.dd.AbstractEjbDeploymentDescriptorSubTask; 12 import xdoclet.util.LogUtil; 13 import xdoclet.util.Translator; 14 15 31 public class EAServerSubTask extends AbstractEjbDeploymentDescriptorSubTask 32 { 33 36 private final static String DEFAULT_TEMPLATE_FILE = "resources/sybase-easerver-config_xml.xdt"; 37 38 41 private final static String GENERATED_FILE_NAME = "sybase-easerver-config.xml"; 42 43 46 private final static String JAGUAR_DD_PUBLICID = "-//Sybase, Inc.//DTD EAServer configuration 1.0//EN"; 47 48 51 private final static String JAGUAR_DD_SYSTEMID = "http://www.sybase.com/dtds/easerver/sybase-easerver-config_1_0.dtd"; 52 53 56 private final static String JAGUAR_DD_DTD_FILE_NAME = "resources/sybase-easerver-config_1_0.dtd"; 57 58 61 private String packageName = null; 62 63 66 private String packageDescription = null; 67 68 71 private String version = EAServerVersionTypes.VERSION_4_1; 72 73 public EAServerSubTask() 74 { 75 setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE)); 76 setDestinationFile(GENERATED_FILE_NAME); 77 setPublicId(JAGUAR_DD_PUBLICID); 78 setSystemId(JAGUAR_DD_SYSTEMID); 79 setDtdURL(getClass().getResource(JAGUAR_DD_DTD_FILE_NAME)); 80 setValidateXML(true); 81 } 82 83 88 public String getVersion() 89 { 90 return version; 91 } 92 93 98 public String getPackageName() 99 { 100 return packageName; 101 } 102 103 108 public String getPackageDescription() 109 { 110 return packageDescription; 111 } 112 113 118 public void setVersion(String version) 119 { 120 this.version = version; 121 } 122 123 129 public void setPackageName(String packageName) 130 { 131 this.packageName = packageName; 132 } 133 134 139 public void setPackageDescription(String packageDescription) 140 { 141 this.packageDescription = packageDescription; 142 } 143 144 149 public void validateOptions() throws XDocletException 150 { 151 super.validateOptions(); 152 153 Log log = LogUtil.getLog(EAServerSubTask.class, "validateOptions"); 154 155 log.debug("packageName = " + getPackageName()); 156 if (getPackageName() == null || getPackageName().equals("")) { 157 throw new XDocletException(Translator.getString(XDocletMessages.class, XDocletMessages.PARAMETER_MISSING_OR_EMPTY, new String []{"packageName"})); 158 } 159 } 160 161 163 166 public static class EAServerVersionTypes extends org.apache.tools.ant.types.EnumeratedAttribute 167 { 168 public final static String VERSION_4_1 = "4.1"; 169 170 175 public String [] getValues() 176 { 177 return (new String []{VERSION_4_1}); 178 } 179 } 180 181 } 182 | Popular Tags |