View Javadoc

1   package org.apache.maven.hibernate.jelly;
2   
3   /* ====================================================================
4    *   Copyright 2001-2004 The Apache Software Foundation.
5    *
6    *   Licensed under the Apache License, Version 2.0 (the "License");
7    *   you may not use this file except in compliance with the License.
8    *   You may obtain a copy of the License at
9    *
10   *       http://www.apache.org/licenses/LICENSE-2.0
11   *
12   *   Unless required by applicable law or agreed to in writing, software
13   *   distributed under the License is distributed on an "AS IS" BASIS,
14   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   *   See the License for the specific language governing permissions and
16   *   limitations under the License.
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  }