1 package org.apache.maven.hibernate.jelly;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 import org.apache.commons.jelly.JellyTagException;
21 import org.apache.commons.jelly.MissingAttributeException;
22 import org.apache.commons.jelly.TagSupport;
23 import org.apache.commons.jelly.XMLOutput;
24 import org.apache.maven.hibernate.beans.CodeGenerationBean;
25
26 /**
27 * @author <a href="paulkearney@gmail.com">Paul Kearney</a>
28 * @version $Id$
29 */
30 public class CodeGenerationTag extends TagSupport {
31
32 private CodeGenerationBean bean = new CodeGenerationBean();
33
34 /**
35 * @see org.apache.commons.jelly.Tag#doTag(org.apache.commons.jelly.XMLOutput)
36 */
37 public void doTag(XMLOutput arg0) throws MissingAttributeException, JellyTagException {
38
39 execute();
40 }
41
42 /**
43 *
44 */
45 protected void execute() throws JellyTagException
46 {
47 try {
48 bean.execute();
49 } catch (Exception e) {
50 String msg = "Code generation operation failed";
51 throw new JellyTagException(msg, e);
52 }
53 }
54
55 public String getBasedir()
56 {
57 return bean.getBasedir();
58 }
59
60 public String getExcludes()
61 {
62 return bean.getExcludes();
63 }
64
65 public String getIncludes()
66 {
67 return bean.getIncludes();
68 }
69
70 public String getOutputdir()
71 {
72 return bean.getOutputdir();
73 }
74
75 public void setBasedir(String string)
76 {
77 bean.setBasedir(string);
78 }
79
80 public void setExcludes(String string)
81 {
82 bean.setExcludes(string);
83 }
84
85 public void setIncludes(String string)
86 {
87 bean.setIncludes(string);
88 }
89
90 public void setOutputdir(String dir)
91 {
92 bean.setOutputdir(dir);
93 }
94
95 public String toString()
96 {
97 return bean.toString();
98 }
99 }