| 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 java.io.Writer; |
| 20 | import java.io.IOException; |
| 21 | |
| 22 | import org.apache.velocity.context.InternalContextAdapter; |
| 23 | import org.apache.velocity.runtime.parser.Parser; |
| 24 | |
| 25 | /** |
| 26 | * This class is responsible for handling EscapedDirectives |
| 27 | * in VTL. |
| 28 | * |
| 29 | * Please look at the Parser.jjt file which is |
| 30 | * what controls the generation of this class. |
| 31 | * |
| 32 | * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a> |
| 33 | * @version $Id: ASTEscapedDirective.java,v 1.3.14.1 2004/03/03 23:22:58 geirm Exp $ |
| 34 | */ |
| 35 | public class ASTEscapedDirective extends SimpleNode |
| 36 | { |
| 37 | public ASTEscapedDirective(int id) |
| 38 | { |
| 39 | super(id); |
| 40 | } |
| 41 | |
| 42 | public ASTEscapedDirective(Parser p, int id) |
| 43 | { |
| 44 | super(p, id); |
| 45 | } |
| 46 | |
| 47 | |
| 48 | /** Accept the visitor. **/ |
| 49 | public Object jjtAccept(ParserVisitor visitor, Object data) |
| 50 | { |
| 51 | return visitor.visit(this, data); |
| 52 | } |
| 53 | |
| 54 | public boolean render(InternalContextAdapter context, Writer writer) |
| 55 | throws IOException |
| 56 | { |
| 57 | writer.write(getFirstToken().image); |
| 58 | return true; |
| 59 | } |
| 60 | |
| 61 | } |