KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > velocity > runtime > parser > node > ASTElseStatement


1 package org.apache.velocity.runtime.parser.node;
2
3 /*
4  * Copyright 2000-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 import org.apache.velocity.context.InternalContextAdapter;
20 import org.apache.velocity.runtime.parser.Parser;
21
22 /**
23  * This class is responsible for handling the Else VTL control statement.
24  *
25  * Please look at the Parser.jjt file which is
26  * what controls the generation of this class.
27  *
28  * @author <a HREF="mailto:jvanzyl@apache.org">Jason van Zyl</a>
29  * @author <a HREF="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
30  * @version $Id: ASTElseStatement.java,v 1.8.4.1 2004/03/03 23:22:58 geirm Exp $
31  */

32 public class ASTElseStatement extends SimpleNode
33 {
34     public ASTElseStatement(int id)
35     {
36         super(id);
37     }
38
39     public ASTElseStatement(Parser p, int id)
40     {
41         super(p, id);
42     }
43
44     /** Accept the visitor. **/
45     public Object JavaDoc jjtAccept(ParserVisitor visitor, Object JavaDoc data)
46     {
47         return visitor.visit(this, data);
48     }
49     
50     /**
51      * An ASTElseStatement always evaluates to
52      * true. Basically behaves like an #if(true).
53      */

54     public boolean evaluate( InternalContextAdapter context)
55     {
56         return true;
57     }
58 }
59
60
Popular Tags