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:
056: package com.sun.portal.providers.jsp.jasper3.jasper.compiler;
057:
058: import java.util.Hashtable;
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:
065: /**
066: * Throwaway class that can be used for debugging during development
067: * etc. This probably should go away soon.
068: *
069: * @author Anil K. Vijendran
070: */
071: public class DumbParseEventListener extends BaseJspListener {
072:
073: public DumbParseEventListener(JspReader reader, ServletWriter writer) {
074: super (reader, writer);
075: }
076:
077: public void handleComment(Mark start, Mark stop)
078: throws JasperException {
079: System.err.println("\nComment: ");
080: System.err.print("\t");
081: System.err.println(reader.getChars(start, stop));
082: }
083:
084: public void handleDirective(String directive, Mark start,
085: Mark stop, Hashtable attrs) throws JasperException {
086: System.err.println("\nDirective: " + directive);
087: System.err.println("\t" + attrs);
088: }
089:
090: public void handleDeclaration(Mark start, Mark stop, Hashtable attrs)
091: throws JasperException {
092: System.err.println("\nDeclaration: ");
093: System.err.println(reader.getChars(start, stop));
094: }
095:
096: public void handleScriptlet(Mark start, Mark stop, Hashtable attrs)
097: throws JasperException {
098: System.err.println("\nScriptlet: ");
099: System.err.println(reader.getChars(start, stop));
100: }
101:
102: public void handleExpression(Mark start, Mark stop, Hashtable attrs)
103: throws JasperException {
104: System.err.println("\nExpression: ");
105: System.err.println(reader.getChars(start, stop));
106: }
107:
108: public void handleBean(Mark start, Mark stop, Hashtable attrs,
109: boolean bodyEmpty) throws JasperException {
110: System.err.println("\nBean: ");
111: System.err.println("\t" + attrs);
112: }
113:
114: public void handleBeanEnd(Mark start, Mark stop, Hashtable attrs,
115: boolean bodyEmpty) throws JasperException {
116:
117: System.err.println("\nBean: ");
118: System.err.println("\t" + attrs);
119: }
120:
121: public void handleGetProperty(Mark start, Mark stop, Hashtable attrs)
122: throws JasperException {
123: System.err.println("\nGetProperty: ");
124: System.err.println("\t" + attrs);
125: }
126:
127: public void handleSetProperty(Mark start, Mark stop, Hashtable attrs)
128: throws JasperException {
129: System.err.println("\nSetProperty: ");
130: System.err.println("\t" + attrs);
131: }
132:
133: public void handlePlugin(Mark start, Mark stop, Hashtable attrs)
134: throws JasperException {
135: System.err.println("\nPlugin: ");
136: System.err.println("\t" + attrs);
137: }
138:
139: public void handleCharData(char[] chars) throws JasperException {
140: System.err.print(chars);
141: }
142:
143: public void handleForward(Mark start, Mark stop, Hashtable attrs)
144: throws JasperException {
145: System.err.println("\n Forward: ");
146: System.err.println("\t" + attrs);
147: }
148:
149: public void handleInclude(Mark start, Mark stop, Hashtable attrs)
150: throws JasperException {
151: System.err.println("\n Include: ");
152: System.err.println("\t" + attrs);
153: }
154:
155: public TagLibraries getTagLibraries() {
156: return null;
157: }
158:
159: public void handleTagBegin(Mark start, Hashtable attrs,
160: String prefix, String shortTagName, TagLibraryInfo tli,
161: TagInfo ti) throws JasperException {
162: System.err.println("\nUser-defined Tag Start " + prefix + ":"
163: + shortTagName + " --> ");
164: System.err.println("\tAttrs" + attrs);
165: }
166:
167: public void handleTagEnd(Mark start, Mark stop, String prefix,
168: String shortTagName, Hashtable attrs, TagLibraryInfo tli,
169: TagInfo ti) throws JasperException {
170: System.err.println("\nUser-defined Tag End " + prefix + ":"
171: + shortTagName + " --> ");
172: System.err.println("\tBody " + reader.getChars(start, stop));
173: }
174:
175: }
|