1 5 package xdoclet.modules.spring; 6 7 import xdoclet.XDocletException; 8 import xdoclet.XDocletMessages; 9 import xdoclet.XmlSubTask; 10 import xdoclet.util.Translator; 11 12 21 public class SpringXmlSubTask extends XmlSubTask 22 { 23 private final static String SPRING_PUBLIC_ID = "-//SPRING//DTD BEAN//EN"; 24 25 private final static String SPRING_SYSTEM_ID = "http://www.springframework.org/dtd/spring-beans.dtd"; 26 27 private final static String SPRING_DTD = "resources/spring-beans.dtd"; 28 29 private final static String DEFAULT_TEMPLATE_FILE = "resources/spring_xml.xdt"; 30 31 private final static String GENERATED_FILE_NAME = "spring.xml"; 32 33 private String defaultAutowire = "no"; 34 private String defaultLazyInit = "false"; 35 private String defaultDependencyCheck = "none"; 36 37 public SpringXmlSubTask() 38 { 39 setPublicId(SPRING_PUBLIC_ID); 40 setSystemId(SPRING_SYSTEM_ID); 41 setDtdURL(getClass().getResource(SPRING_DTD)); 42 setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE)); 43 setDestinationFile(GENERATED_FILE_NAME); 44 } 45 46 public String getDefaultAutowire() 47 { 48 return defaultAutowire; 49 } 50 51 public String getDefaultDependencyCheck() 52 { 53 return defaultDependencyCheck; 54 } 55 56 public String getDefaultLazyInit() 57 { 58 return defaultLazyInit; 59 } 60 61 66 public void setDestinationFile(String destinationFile) 67 { 68 super.setDestinationFile(destinationFile); 69 } 70 71 77 public void setDefaultAutowire(String autowire) 78 { 79 defaultAutowire = autowire; 80 } 81 82 88 public void setDefaultDependencyCheck(String dependencyCheck) 89 { 90 defaultDependencyCheck = dependencyCheck; 91 } 92 93 99 public void setDefaultLazyInit(String lazyInit) 100 { 101 defaultLazyInit = lazyInit; 102 } 103 104 109 public void execute() throws XDocletException 110 { 111 startProcess(); 112 } 113 114 protected void engineStarted() throws XDocletException 115 { 116 System.out.println(Translator.getString(XDocletMessages.class, XDocletMessages.GENERATING_SOMETHING, new String []{getDestinationFile()})); 117 } 118 } 119 | Popular Tags |