1 5 package xdoclet.modules.ejb; 6 7 import org.apache.tools.ant.BuildException; 8 9 import xdoclet.DocletTask; 10 import xdoclet.util.Translator; 11 12 22 public class EjbDocletTask extends DocletTask 23 { 24 27 private String ejbspec = EjbSpecVersion.EJB_2_0; 28 29 32 private String ejbClassNameSuffix = "Bean,EJB,Ejb"; 33 34 39 public String getEjbSpec() 40 { 41 return ejbspec; 42 } 43 44 49 public String getEjbClassNameSuffix() 50 { 51 return ejbClassNameSuffix; 52 } 53 54 61 public void setEjbSpec(EjbSpecVersion ejbspec) 62 { 63 this.ejbspec = ejbspec.getValue(); 64 } 65 66 73 public void setEjbClassNameSuffix(String ejbClassNameSuffix) 74 { 75 this.ejbClassNameSuffix = ejbClassNameSuffix; 76 } 77 78 79 protected void validateOptions() throws BuildException 80 { 81 super.validateOptions(); 82 try { 83 checkClass("javax.ejb.EntityBean"); 84 } 85 catch (BuildException ex) { 86 throw new BuildException(Translator.getString(XDocletModulesEjbMessages.class, XDocletModulesEjbMessages.MISSING_J2EE_CLASSES), ex); 87 } 88 } 89 90 94 public static class EjbSpecVersion extends org.apache.tools.ant.types.EnumeratedAttribute 95 { 96 public final static String EJB_1_1 = "1.1"; 97 98 public final static String EJB_2_0 = "2.0"; 99 100 public final static String EJB_2_1 = "2.1"; 101 102 107 public java.lang.String [] getValues() 108 { 109 return (new java.lang.String []{ 110 EJB_1_1, EJB_2_0, EJB_2_1 111 }); 112 } 113 } 114 115 } 116 | Popular Tags |