001: /*
002: * The Apache Software License, Version 1.1
003: *
004: * Copyright (c) 1999 The Apache Software Foundation. All rights
005: * reserved.
006: *
007: * Redistribution and use in source and binary forms, with or without
008: * modification, are permitted provided that the following conditions
009: * are met:
010: *
011: * 1. Redistributions of source code must retain the above copyright
012: * notice, this list of conditions and the following disclaimer.
013: *
014: * 2. Redistributions in binary form must reproduce the above copyright
015: * notice, this list of conditions and the following disclaimer in
016: * the documentation and/or other materials provided with the
017: * distribution.
018: *
019: * 3. The end-user documentation included with the redistribution, if
020: * any, must include the following acknowlegement:
021: * "This product includes software developed by the
022: * Apache Software Foundation (http://www.apache.org/)."
023: * Alternately, this acknowlegement may appear in the software itself,
024: * if and wherever such third-party acknowlegements normally appear.
025: *
026: * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
027: * Foundation" must not be used to endorse or promote products derived
028: * from this software without prior written permission. For written
029: * permission, please contact apache@apache.org.
030: *
031: * 5. Products derived from this software may not be called "Apache"
032: * nor may "Apache" appear in their names without prior written
033: * permission of the Apache Group.
034: *
035: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
036: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
037: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
038: * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
039: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
040: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
041: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
042: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
043: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
044: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
045: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
046: * SUCH DAMAGE.
047: * ====================================================================
048: *
049: * This software consists of voluntary contributions made by many
050: * individuals on behalf of the Apache Software Foundation. For more
051: * information on the Apache Software Foundation, please see
052: * <http://www.apache.org/>.
053: *
054: */
055: package com.sun.portal.providers.jsp.jasper3.jasper.compiler;
056:
057: import java.util.Hashtable;
058: import java.util.Vector;
059:
060: import javax.servlet.jsp.tagext.TagInfo;
061: import javax.servlet.jsp.tagext.TagLibraryInfo;
062:
063: import com.sun.portal.providers.jsp.jasper3.jasper.JasperException;
064: import com.sun.portal.providers.jsp.jasper3.jasper.Constants;
065:
066: /**
067: * An abstract base class to make things easy during development.
068: *
069: * @author Anil K. Vijendran
070: */
071: public class BaseJspListener implements ParseEventListener {
072: protected JspReader reader;
073: protected ServletWriter writer;
074:
075: protected BaseJspListener(JspReader reader, ServletWriter writer) {
076: this .reader = reader;
077: this .writer = writer;
078: }
079:
080: public void setTemplateInfo(Mark start, Mark stop) {
081: }
082:
083: public void beginPageProcessing() throws JasperException {
084: }
085:
086: public void endPageProcessing() throws JasperException {
087: }
088:
089: public void handleComment(Mark start, Mark stop)
090: throws JasperException {
091: throw new JasperException(Constants
092: .getString("jsp.error.not.impl.comments"));
093: }
094:
095: public void handleDirective(String directive, Mark start,
096: Mark stop, Hashtable attrs) throws JasperException {
097: throw new JasperException(Constants
098: .getString("jsp.error.not.impl.directives"));
099: }
100:
101: public void handleDeclaration(Mark start, Mark stop, Hashtable attrs)
102: throws JasperException {
103: throw new JasperException(Constants
104: .getString("jsp.error.not.impl.declarations"));
105: }
106:
107: public void handleScriptlet(Mark start, Mark stop, Hashtable attrs)
108: throws JasperException {
109: throw new JasperException(Constants
110: .getString("jsp.error.not.impl.scriptlets"));
111: }
112:
113: public void handleExpression(Mark start, Mark stop, Hashtable attrs)
114: throws JasperException {
115: throw new JasperException(Constants
116: .getString("jsp.error.not.impl.expressions"));
117: }
118:
119: public void handleBean(Mark start, Mark stop, Hashtable attrs,
120: boolean isBodyEmpty) throws JasperException {
121: throw new JasperException(Constants
122: .getString("jsp.error.not.impl.usebean"));
123: }
124:
125: public void handleBeanEnd(Mark start, Mark stop, Hashtable attrs,
126: boolean isBodyEmpty) throws JasperException {
127: throw new JasperException(Constants
128: .getString("jsp.error.not.impl.usebean"));
129: }
130:
131: public void handleGetProperty(Mark start, Mark stop, Hashtable attrs)
132: throws JasperException {
133: throw new JasperException(Constants
134: .getString("jsp.error.not.impl.getp"));
135: }
136:
137: public void handleSetProperty(Mark start, Mark stop, Hashtable attrs)
138: throws JasperException {
139: throw new JasperException(Constants
140: .getString("jsp.error.not.impl.setp"));
141: }
142:
143: public void handlePlugin(Mark start, Mark stop, Hashtable attrs,
144: Hashtable param, String fallback) throws JasperException {
145: throw new JasperException(Constants
146: .getString("jsp.error.not.impl.plugin"));
147: }
148:
149: public void handleCharData(Mark start, Mark stop, char[] chars)
150: throws JasperException {
151: System.err.print(chars);
152: }
153:
154: public void handleForward(Mark start, Mark stop, Hashtable attrs,
155: Hashtable param) throws JasperException {
156: throw new JasperException(Constants
157: .getString("jsp.error.not.impl.forward"));
158: }
159:
160: public void handleInclude(Mark start, Mark stop, Hashtable attrs,
161: Hashtable param) throws JasperException {
162: throw new JasperException(Constants
163: .getString("jsp.error.not.impl.include"));
164: }
165:
166: public void handleTagBegin(Mark start, Mark stop, Hashtable attrs,
167: String prefix, String shortTagName, TagLibraryInfo tli,
168: TagInfo ti) throws JasperException {
169: throw new JasperException(Constants
170: .getString("jsp.error.not.impl.taglib"));
171: }
172:
173: public void handleTagEnd(Mark start, Mark stop, String prefix,
174: String shortTagName, Hashtable attrs, TagLibraryInfo tli,
175: TagInfo ti) throws JasperException {
176: throw new JasperException(Constants
177: .getString("jsp.error.not.impl.taglib"));
178: }
179:
180: public TagLibraries getTagLibraries() {
181: return null;
182: }
183: }
|