1 /*
2 * Copyright 2003-2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.apache.velocity.tools.generic.app;
18
19 import java.io.IOException;
20 import java.io.InputStream;
21 import java.io.Reader;
22 import java.io.Writer;
23 import java.util.Properties;
24
25 import org.apache.commons.collections.ExtendedProperties;
26 import org.apache.velocity.Template;
27 import org.apache.velocity.app.Velocity;
28 import org.apache.velocity.app.VelocityEngine;
29 import org.apache.velocity.context.Context;
30 import org.apache.velocity.exception.MethodInvocationException;
31 import org.apache.velocity.exception.ParseErrorException;
32 import org.apache.velocity.exception.ResourceNotFoundException;
33 import org.apache.velocity.runtime.configuration.Configuration;
34
35 /***
36 * @author <a href="mailto:shinobu@ieee.org">Shinobu Kawai</a>
37 * @version $Id: $
38 */
39 public class MonostateVelocityEngine extends VelocityEngine
40 {
41
42 /***
43 *
44 */
45 public MonostateVelocityEngine()
46 {
47 }
48 /***
49 * @param arg0
50 * @throws java.lang.Exception
51 */
52 public MonostateVelocityEngine(String arg0) throws Exception
53 {
54 Velocity.init(arg0);
55 }
56 /***
57 * @param arg0
58 * @throws java.lang.Exception
59 */
60 public MonostateVelocityEngine(Properties arg0) throws Exception
61 {
62 Velocity.init(arg0);
63 }
64 /* (non-Javadoc)
65 * @see org.apache.velocity.app.VelocityEngine#addProperty(java.lang.String, java.lang.Object)
66 */
67 public void addProperty(String arg0, Object arg1)
68 {
69 Velocity.addProperty(arg0, arg1);
70 }
71 /* (non-Javadoc)
72 * @see org.apache.velocity.app.VelocityEngine#clearProperty(java.lang.String)
73 */
74 public void clearProperty(String arg0)
75 {
76 Velocity.clearProperty(arg0);
77 }
78 /* (non-Javadoc)
79 * @see org.apache.velocity.app.VelocityEngine#debug(java.lang.Object)
80 */
81 public void debug(Object arg0)
82 {
83 Velocity.debug(arg0);
84 }
85 /* (non-Javadoc)
86 * @see org.apache.velocity.app.VelocityEngine#error(java.lang.Object)
87 */
88 public void error(Object arg0)
89 {
90 Velocity.error(arg0);
91 }
92 /* (non-Javadoc)
93 * @see org.apache.velocity.app.VelocityEngine#evaluate(org.apache.velocity.context.Context, java.io.Writer, java.lang.String, java.io.InputStream)
94 */
95 public boolean evaluate(Context arg0, Writer arg1, String arg2,
96 InputStream arg3) throws ParseErrorException,
97 MethodInvocationException, ResourceNotFoundException, IOException
98 {
99 return Velocity.evaluate(arg0, arg1, arg2, arg3);
100 }
101 /* (non-Javadoc)
102 * @see org.apache.velocity.app.VelocityEngine#evaluate(org.apache.velocity.context.Context, java.io.Writer, java.lang.String, java.io.Reader)
103 */
104 public boolean evaluate(Context arg0, Writer arg1, String arg2, Reader arg3)
105 throws ParseErrorException, MethodInvocationException,
106 ResourceNotFoundException, IOException
107 {
108 return Velocity.evaluate(arg0, arg1, arg2, arg3);
109 }
110 /* (non-Javadoc)
111 * @see org.apache.velocity.app.VelocityEngine#evaluate(org.apache.velocity.context.Context, java.io.Writer, java.lang.String, java.lang.String)
112 */
113 public boolean evaluate(Context arg0, Writer arg1, String arg2, String arg3)
114 throws ParseErrorException, MethodInvocationException,
115 ResourceNotFoundException, IOException
116 {
117 return Velocity.evaluate(arg0, arg1, arg2, arg3);
118 }
119 /* (non-Javadoc)
120 * @see org.apache.velocity.app.VelocityEngine#getProperty(java.lang.String)
121 */
122 public Object getProperty(String arg0)
123 {
124 return Velocity.getProperty(arg0);
125 }
126 /* (non-Javadoc)
127 * @see org.apache.velocity.app.VelocityEngine#getTemplate(java.lang.String, java.lang.String)
128 */
129 public Template getTemplate(String arg0, String arg1)
130 throws ResourceNotFoundException, ParseErrorException, Exception
131 {
132 return Velocity.getTemplate(arg0, arg1);
133 }
134 /* (non-Javadoc)
135 * @see org.apache.velocity.app.VelocityEngine#getTemplate(java.lang.String)
136 */
137 public Template getTemplate(String arg0) throws ResourceNotFoundException,
138 ParseErrorException, Exception
139 {
140 return Velocity.getTemplate(arg0);
141 }
142 /* (non-Javadoc)
143 * @see org.apache.velocity.app.VelocityEngine#info(java.lang.Object)
144 */
145 public void info(Object arg0)
146 {
147 Velocity.info(arg0);
148 }
149 /* (non-Javadoc)
150 * @see org.apache.velocity.app.VelocityEngine#init()
151 */
152 public void init() throws Exception
153 {
154 Velocity.init();
155 }
156 /* (non-Javadoc)
157 * @see org.apache.velocity.app.VelocityEngine#init(java.util.Properties)
158 */
159 public void init(Properties arg0) throws Exception
160 {
161 Velocity.init(arg0);
162 }
163 /* (non-Javadoc)
164 * @see org.apache.velocity.app.VelocityEngine#init(java.lang.String)
165 */
166 public void init(String arg0) throws Exception
167 {
168 Velocity.init(arg0);
169 }
170 /* (non-Javadoc)
171 * @see org.apache.velocity.app.VelocityEngine#invokeVelocimacro(java.lang.String, java.lang.String, java.lang.String[], org.apache.velocity.context.Context, java.io.Writer)
172 */
173 public boolean invokeVelocimacro(String arg0, String arg1, String[] arg2,
174 Context arg3, Writer arg4) throws Exception
175 {
176 return Velocity.invokeVelocimacro(arg0, arg1, arg2, arg3, arg4);
177 }
178 /* (non-Javadoc)
179 * @see org.apache.velocity.app.VelocityEngine#mergeTemplate(java.lang.String, org.apache.velocity.context.Context, java.io.Writer)
180 */
181 public boolean mergeTemplate(String arg0, Context arg1, Writer arg2)
182 throws ResourceNotFoundException, ParseErrorException,
183 MethodInvocationException, Exception
184 {
185 return Velocity.mergeTemplate(arg0, arg1, arg2);
186 }
187 /* (non-Javadoc)
188 * @see org.apache.velocity.app.VelocityEngine#mergeTemplate(java.lang.String, java.lang.String, org.apache.velocity.context.Context, java.io.Writer)
189 */
190 public boolean mergeTemplate(String arg0, String arg1, Context arg2,
191 Writer arg3) throws ResourceNotFoundException, ParseErrorException,
192 MethodInvocationException, Exception
193 {
194 return Velocity.mergeTemplate(arg0, arg1, arg2, arg3);
195 }
196 /* (non-Javadoc)
197 * @see org.apache.velocity.app.VelocityEngine#setApplicationAttribute(java.lang.Object, java.lang.Object)
198 */
199 public void setApplicationAttribute(Object arg0, Object arg1)
200 {
201 Velocity.setApplicationAttribute(arg0, arg1);
202 }
203 /* (non-Javadoc)
204 * @see org.apache.velocity.app.VelocityEngine#setConfiguration(org.apache.velocity.runtime.configuration.Configuration)
205 */
206 public void setConfiguration(Configuration arg0)
207 {
208 Velocity.setConfiguration(arg0);
209 }
210 /* (non-Javadoc)
211 * @see org.apache.velocity.app.VelocityEngine#setExtendedProperties(org.apache.commons.collections.ExtendedProperties)
212 */
213 public void setExtendedProperties(ExtendedProperties arg0)
214 {
215 Velocity.setExtendedProperties(arg0);
216 }
217 /* (non-Javadoc)
218 * @see org.apache.velocity.app.VelocityEngine#setProperty(java.lang.String, java.lang.Object)
219 */
220 public void setProperty(String arg0, Object arg1)
221 {
222 Velocity.setProperty(arg0, arg1);
223 }
224 /* (non-Javadoc)
225 * @see org.apache.velocity.app.VelocityEngine#templateExists(java.lang.String)
226 */
227 public boolean templateExists(String arg0)
228 {
229 return Velocity.templateExists(arg0);
230 }
231 /* (non-Javadoc)
232 * @see org.apache.velocity.app.VelocityEngine#warn(java.lang.Object)
233 */
234 public void warn(Object arg0)
235 {
236 Velocity.warn(arg0);
237 }
238
239 }