View Javadoc

1   package org.apache.maven.hibernate.jelly;
2   
3   /* ====================================================================
4    *   Copyright 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.TagSupport;
22  import org.apache.commons.jelly.XMLOutput;
23  import org.apache.maven.hibernate.beans.SchemaBeanBase;
24  
25  /**
26   * 
27   * Base class for Jelly tags that uses Hibernate's Schema classes
28   * 
29   * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a> 
30   * @author <a href="maven@felipeal.net">Felipe Leme</a> 
31   * @version $Id: SchemaTagBase.java 170200 2005-05-15 06:24:19Z brett $
32   */
33  public abstract class SchemaTagBase extends TagSupport
34  {
35  
36     protected final SchemaBeanBase bean;
37     
38     protected SchemaTagBase( SchemaBeanBase b ) {
39       bean = b;     
40     }
41  
42     /**
43      * 
44      */
45     protected void execute() throws JellyTagException
46     {
47        try
48        {
49           bean.execute();
50        }
51        catch (Exception e)
52        {
53           String msg = "Schema operation failed";
54           throw new JellyTagException(msg, e);
55        }
56  
57     }
58  
59     /**
60      * @see org.apache.commons.jelly.Tag#doTag(org.apache.commons.jelly.XMLOutput)
61      */
62     public void doTag(XMLOutput arg0) throws JellyTagException
63     {
64        execute();
65     }
66  
67     /**
68      * @return
69      */
70     public boolean getText()
71     {
72        return bean.getText();
73     }
74  
75     /* (non-Javadoc)
76      * @see java.lang.Object#toString()
77      */
78     public String toString()
79     {
80        return bean.toString();
81     }
82  
83     /**
84      * @return
85      */
86     public boolean getQuiet()
87     {
88        return bean.getQuiet();
89     }
90  
91     /**
92      * @param string
93      */
94     public void setExcludes(String string)
95     {
96        bean.setExcludes(string);
97     }
98  
99     /**
100     * @param string
101     */
102    public void setIncludes(String string)
103    {
104       bean.setIncludes(string);
105    }
106 
107    /**
108     * @return
109     */
110    public String getExcludes()
111    {
112       return bean.getExcludes();
113    }
114 
115    /**
116     * @param string
117     */
118    public void setConfig(String string)
119    {
120       bean.setConfig(string);
121    }
122 
123    /**
124     * @return
125     */
126    public String getIncludes()
127    {
128       return bean.getIncludes();
129    }
130 
131    /**
132     * @return
133     */
134    public String getBasedir()
135    {
136       return bean.getBasedir();
137    }
138 
139    /**
140     * @return
141     */
142    public String getProperties()
143    {
144       return bean.getProperties();
145    }
146 
147    /**
148     * @return
149     */
150    public String getConfig()
151    {
152       return bean.getConfig();
153    }
154 
155    /**
156     * @param b
157     */
158    public void setText(boolean b)
159    {
160       bean.setText(b);
161    }
162 
163    /**
164     * @param string
165     */
166    public void setBasedir(String string)
167    {
168       bean.setBasedir(string);
169    }
170 
171    /**
172     * @param b
173     */
174    public void setQuiet(boolean b)
175    {
176       bean.setQuiet(b);
177    }
178 
179    /**
180     * @param string
181     */
182    public void setProperties(String string)
183    {
184       bean.setProperties(string);
185    }
186 
187       
188 	/**
189 	 */
190 	public String getSchemaOutputFile() {
191 		return bean.getSchemaOutputFile();
192 	}
193 	/**
194 	 */
195 	public void setSchemaOutputFile(String string) {
196 		bean.setSchemaOutputFile(string);
197 	}
198   
199 }