KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > web > jsps > parserapi > Node


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.web.jsps.parserapi;
21
22 import java.util.*;
23 import java.io.CharArrayWriter JavaDoc;
24 import javax.servlet.jsp.tagext.*;
25 import javax.servlet.jsp.JspException JavaDoc;
26 import org.xml.sax.Attributes JavaDoc;
27 //import org.apache.jasper.compiler.tagplugin.TagPluginContext;
28

29
30 /**
31  * An internal data representation of a JSP page or a JSP docuement (XML).
32  * Also included here is a visitor class for tranversing nodes.
33  *
34  * NOTE : Copied over from org.apache.jasper.compiler.Node.
35  *
36  * @author Kin-man Chung
37  * @author Jan Luehe
38  * @author Shawn Bayern
39  * @author Mark Roth
40  */

41
42 public abstract class Node {
43     
44     // BEGIN copied over from TagConstants
45
public static final String JavaDoc JSP_URI = "http://java.sun.com/JSP/Page";
46
47     public static final String JavaDoc DIRECTIVE_ACTION = "directive.";
48
49     public static final String JavaDoc ROOT_ACTION = "root";
50     public static final String JavaDoc JSP_ROOT_ACTION = "jsp:root";
51
52     public static final String JavaDoc PAGE_DIRECTIVE_ACTION = "directive.page";
53     public static final String JavaDoc JSP_PAGE_DIRECTIVE_ACTION = "jsp:directive.page";
54
55     public static final String JavaDoc INCLUDE_DIRECTIVE_ACTION = "directive.include";
56     public static final String JavaDoc JSP_INCLUDE_DIRECTIVE_ACTION = "jsp:directive.include";
57
58     public static final String JavaDoc DECLARATION_ACTION = "declaration";
59     public static final String JavaDoc JSP_DECLARATION_ACTION = "jsp:declaration";
60
61     public static final String JavaDoc SCRIPTLET_ACTION = "scriptlet";
62     public static final String JavaDoc JSP_SCRIPTLET_ACTION = "jsp:scriptlet";
63
64     public static final String JavaDoc EXPRESSION_ACTION = "expression";
65     public static final String JavaDoc JSP_EXPRESSION_ACTION = "jsp:expression";
66
67     public static final String JavaDoc USE_BEAN_ACTION = "useBean";
68     public static final String JavaDoc JSP_USE_BEAN_ACTION = "jsp:useBean";
69
70     public static final String JavaDoc SET_PROPERTY_ACTION = "setProperty";
71     public static final String JavaDoc JSP_SET_PROPERTY_ACTION = "jsp:setProperty";
72
73     public static final String JavaDoc GET_PROPERTY_ACTION = "getProperty";
74     public static final String JavaDoc JSP_GET_PROPERTY_ACTION = "jsp:getProperty";
75
76     public static final String JavaDoc INCLUDE_ACTION = "include";
77     public static final String JavaDoc JSP_INCLUDE_ACTION = "jsp:include";
78
79     public static final String JavaDoc FORWARD_ACTION = "forward";
80     public static final String JavaDoc JSP_FORWARD_ACTION = "jsp:forward";
81
82     public static final String JavaDoc PARAM_ACTION = "param";
83     public static final String JavaDoc JSP_PARAM_ACTION = "jsp:param";
84
85     public static final String JavaDoc PARAMS_ACTION = "params";
86     public static final String JavaDoc JSP_PARAMS_ACTION = "jsp:params";
87
88     public static final String JavaDoc PLUGIN_ACTION = "plugin";
89     public static final String JavaDoc JSP_PLUGIN_ACTION = "jsp:plugin";
90
91     public static final String JavaDoc FALLBACK_ACTION = "fallback";
92     public static final String JavaDoc JSP_FALLBACK_ACTION = "jsp:fallback";
93
94     public static final String JavaDoc TEXT_ACTION = "text";
95     public static final String JavaDoc JSP_TEXT_ACTION = "jsp:text";
96     public static final String JavaDoc JSP_TEXT_ACTION_END = "</jsp:text>";
97
98     public static final String JavaDoc ATTRIBUTE_ACTION = "attribute";
99     public static final String JavaDoc JSP_ATTRIBUTE_ACTION = "jsp:attribute";
100
101     public static final String JavaDoc BODY_ACTION = "body";
102     public static final String JavaDoc JSP_BODY_ACTION = "jsp:body";
103
104     public static final String JavaDoc ELEMENT_ACTION = "element";
105     public static final String JavaDoc JSP_ELEMENT_ACTION = "jsp:element";
106
107     public static final String JavaDoc OUTPUT_ACTION = "output";
108     public static final String JavaDoc JSP_OUTPUT_ACTION = "jsp:output";
109
110     public static final String JavaDoc TAGLIB_DIRECTIVE_ACTION = "taglib";
111     public static final String JavaDoc JSP_TAGLIB_DIRECTIVE_ACTION = "jsp:taglib";
112
113     /*
114      * Tag Files
115      */

116     public static final String JavaDoc INVOKE_ACTION = "invoke";
117     public static final String JavaDoc JSP_INVOKE_ACTION = "jsp:invoke";
118
119     public static final String JavaDoc DOBODY_ACTION = "doBody";
120     public static final String JavaDoc JSP_DOBODY_ACTION = "jsp:doBody";
121
122     /*
123      * Tag File Directives
124      */

125     public static final String JavaDoc TAG_DIRECTIVE_ACTION = "directive.tag";
126     public static final String JavaDoc JSP_TAG_DIRECTIVE_ACTION = "jsp:directive.tag";
127
128     public static final String JavaDoc ATTRIBUTE_DIRECTIVE_ACTION = "directive.attribute";
129     public static final String JavaDoc JSP_ATTRIBUTE_DIRECTIVE_ACTION = "jsp:directive.attribute";
130
131     public static final String JavaDoc VARIABLE_DIRECTIVE_ACTION = "directive.variable";
132     public static final String JavaDoc JSP_VARIABLE_DIRECTIVE_ACTION = "jsp:directive.variable";
133
134     /*
135      * Directive attributes
136      */

137     public static final String JavaDoc URN_JSPTAGDIR = "urn:jsptagdir:";
138     public static final String JavaDoc URN_JSPTLD = "urn:jsptld:";
139     // END copied over from TagConstants
140

141     
142     private static final VariableInfo[] ZERO_VARIABLE_INFO = { };
143     
144     protected Attributes JavaDoc attrs;
145
146     // xmlns attributes that represent tag libraries (only in XML syntax)
147
protected Attributes JavaDoc taglibAttrs;
148
149     /*
150      * xmlns attributes that do not represent tag libraries
151      * (only in XML syntax)
152      */

153     protected Attributes JavaDoc nonTaglibXmlnsAttrs;
154
155     protected Nodes body;
156     protected String JavaDoc text;
157     protected Mark startMark;
158     protected int beginJavaLine;
159     protected int endJavaLine;
160     protected Node parent;
161     protected Nodes namedAttributeNodes; // cached for performance
162
protected String JavaDoc qName;
163     protected String JavaDoc localName;
164
165     private boolean isDummy;
166
167     /**
168      * Zero-arg Constructor.
169      */

170     public Node() {
171     this.isDummy = true;
172     }
173
174     /**
175      * Constructor.
176      *
177      * @param start The location of the jsp page
178      * @param parent The enclosing node
179      */

180     public Node(Mark start, Node parent) {
181     this.startMark = start;
182     this.isDummy = (start == null);
183     addToParent(parent);
184     }
185
186     /**
187      * Constructor.
188      *
189      * @param qName The action's qualified name
190      * @param localName The action's local name
191      * @param start The location of the jsp page
192      * @param parent The enclosing node
193      */

194     public Node(String JavaDoc qName, String JavaDoc localName, Mark start, Node parent) {
195     this.qName = qName;
196     this.localName = localName;
197     this.startMark = start;
198     this.isDummy = (start == null);
199     addToParent(parent);
200     }
201
202     /**
203      * Constructor for Nodes parsed from standard syntax.
204      *
205      * @param qName The action's qualified name
206      * @param localName The action's local name
207      * @param attrs The attributes for this node
208      * @param start The location of the jsp page
209      * @param parent The enclosing node
210      */

211     public Node(String JavaDoc qName, String JavaDoc localName, Attributes JavaDoc attrs, Mark start, Node parent) {
212     this.qName = qName;
213     this.localName = localName;
214     this.attrs = attrs;
215     this.startMark = start;
216     this.isDummy = (start == null);
217     addToParent(parent);
218     }
219
220     /**
221      * Constructor for Nodes parsed from XML syntax.
222      *
223      * @param qName The action's qualified name
224      * @param localName The action's local name
225      * @param attrs The action's attributes whose name does not start with
226      * xmlns
227      * @param nonTaglibXmlnsAttrs The action's xmlns attributes that do not
228      * represent tag libraries
229      * @param taglibAttrs The action's xmlns attributes that represent tag
230      * libraries
231      * @param start The location of the jsp page
232      * @param parent The enclosing node
233      */

234     public Node(String JavaDoc qName, String JavaDoc localName, Attributes JavaDoc attrs, Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
235     this.qName = qName;
236     this.localName = localName;
237     this.attrs = attrs;
238     this.nonTaglibXmlnsAttrs = nonTaglibXmlnsAttrs;
239     this.taglibAttrs = taglibAttrs;
240     this.startMark = start;
241     this.isDummy = (start == null);
242     addToParent(parent);
243     }
244
245     /*
246      * Constructor.
247      *
248      * @param qName The action's qualified name
249      * @param localName The action's local name
250      * @param text The text associated with this node
251      * @param start The location of the jsp page
252      * @param parent The enclosing node
253      */

254     public Node(String JavaDoc qName, String JavaDoc localName, String JavaDoc text, Mark start, Node parent) {
255     this.qName = qName;
256     this.localName = localName;
257     this.text = text;
258     this.startMark = start;
259     this.isDummy = (start == null);
260     addToParent(parent);
261     }
262
263     public String JavaDoc getQName() {
264     return this.qName;
265     }
266
267     public String JavaDoc getLocalName() {
268     return this.localName;
269     }
270
271     /*
272      * Gets this Node's attributes.
273      *
274      * In the case of a Node parsed from standard syntax, this method returns
275      * all the Node's attributes.
276      *
277      * In the case of a Node parsed from XML syntax, this method returns only
278      * those attributes whose name does not start with xmlns.
279      */

280     public Attributes JavaDoc getAttributes() {
281     return this.attrs;
282     }
283
284     /*
285      * Gets this Node's xmlns attributes that represent tag libraries
286      * (only meaningful for Nodes parsed from XML syntax)
287      */

288     public Attributes JavaDoc getTaglibAttributes() {
289     return this.taglibAttrs;
290     }
291
292     /*
293      * Gets this Node's xmlns attributes that do not represent tag libraries
294      * (only meaningful for Nodes parsed from XML syntax)
295      */

296     public Attributes JavaDoc getNonTaglibXmlnsAttributes() {
297     return this.nonTaglibXmlnsAttrs;
298     }
299
300     public void setAttributes(Attributes JavaDoc attrs) {
301     this.attrs = attrs;
302     }
303
304     public String JavaDoc getAttributeValue(String JavaDoc name) {
305     return (attrs == null) ? null : attrs.getValue(name);
306     }
307
308     /**
309      * Get the attribute that is non request time expression, either
310      * from the attribute of the node, or from a jsp:attrbute
311      */

312     public String JavaDoc getTextAttribute(String JavaDoc name) {
313
314     String JavaDoc attr = getAttributeValue(name);
315     if (attr != null) {
316         return attr;
317     }
318
319     NamedAttribute namedAttribute = getNamedAttributeNode(name);
320     if (namedAttribute == null) {
321         return null;
322     }
323
324     return namedAttribute.getText();
325     }
326
327     /**
328      * Searches all subnodes of this node for jsp:attribute standard
329      * actions with the given name, and returns the NamedAttribute node
330      * of the matching named attribute, nor null if no such node is found.
331      * <p>
332      * This should always be called and only be called for nodes that
333      * accept dynamic runtime attribute expressions.
334      */

335     public NamedAttribute getNamedAttributeNode( String JavaDoc name ) {
336         NamedAttribute result = null;
337         
338         // Look for the attribute in NamedAttribute children
339
Nodes nodes = getNamedAttributeNodes();
340         int numChildNodes = nodes.size();
341         for( int i = 0; i < numChildNodes; i++ ) {
342             NamedAttribute na = (NamedAttribute)nodes.getNode( i );
343         boolean found = false;
344         int index = name.indexOf(':');
345         if (index != -1) {
346         // qualified name
347
found = na.getName().equals(name);
348         } else {
349         found = na.getLocalName().equals(name);
350         }
351         if (found) {
352                 result = na;
353                 break;
354             }
355         }
356         
357         return result;
358     }
359
360     /**
361      * Searches all subnodes of this node for jsp:attribute standard
362      * actions, and returns that set of nodes as a Node.Nodes object.
363      *
364      * @return Possibly empty Node.Nodes object containing any jsp:attribute
365      * subnodes of this Node
366      */

367     public Node.Nodes getNamedAttributeNodes() {
368
369     if (namedAttributeNodes != null) {
370         return namedAttributeNodes;
371     }
372
373         Node.Nodes result = new Node.Nodes();
374         
375         // Look for the attribute in NamedAttribute children
376
Nodes nodes = getBody();
377         if( nodes != null ) {
378             int numChildNodes = nodes.size();
379             for( int i = 0; i < numChildNodes; i++ ) {
380                 Node n = nodes.getNode( i );
381                 if( n instanceof NamedAttribute ) {
382                     result.add( n );
383                 }
384                 else {
385                     // Nothing can come before jsp:attribute, and only
386
// jsp:body can come after it.
387
break;
388                 }
389             }
390         }
391
392     namedAttributeNodes = result;
393         return result;
394     }
395     
396     public Nodes getBody() {
397     return body;
398     }
399
400     public void setBody(Nodes body) {
401     this.body = body;
402     }
403
404     public String JavaDoc getText() {
405     return text;
406     }
407
408     public Mark getStart() {
409     return startMark;
410     }
411
412     public Node getParent() {
413     return parent;
414     }
415
416     public int getBeginJavaLine() {
417     return beginJavaLine;
418     }
419
420     public void setBeginJavaLine(int begin) {
421     beginJavaLine = begin;
422     }
423
424     public int getEndJavaLine() {
425     return endJavaLine;
426     }
427
428     public void setEndJavaLine(int end) {
429     endJavaLine = end;
430     }
431
432     public boolean isDummy() {
433     return isDummy;
434     }
435
436     public Node.Root getRoot() {
437     Node n = this;
438     while (!(n instanceof Node.Root)) {
439         n = n.getParent();
440     }
441     return (Node.Root) n;
442     }
443
444     /**
445      * Selects and invokes a method in the visitor class based on the node
446      * type. This is abstract and should be overrode by the extending classes.
447      * @param v The visitor class
448      */

449     abstract void accept(Visitor v) throws JspException JavaDoc;
450
451
452     //*********************************************************************
453
// Private utility methods
454

455     /*
456      * Adds this Node to the body of the given parent.
457      */

458     private void addToParent(Node parent) {
459     if (parent != null) {
460         this.parent = parent;
461         Nodes parentBody = parent.getBody();
462         if (parentBody == null) {
463         parentBody = new Nodes();
464         parent.setBody(parentBody);
465         }
466         parentBody.add(this);
467     }
468     }
469
470
471     /*********************************************************************
472      * Child classes
473      */

474     
475     /**
476      * Represents the root of a Jsp page or Jsp document
477      */

478     public static class Root extends Node {
479
480     private Root parentRoot;
481     private boolean isXmlSyntax;
482
483     // Source encoding of the page containing this Root
484
private String JavaDoc pageEnc;
485     
486     // Page encoding specified in JSP config element
487
private String JavaDoc jspConfigPageEnc;
488
489     /*
490      * Flag indicating if the default page encoding is being used (only
491      * applicable with standard syntax).
492      *
493      * True if the page does not provide a page directive with a
494      * 'contentType' attribute (or the 'contentType' attribute doesn't
495      * have a CHARSET value), the page does not provide a page directive
496      * with a 'pageEncoding' attribute, and there is no JSP configuration
497      * element page-encoding whose URL pattern matches the page.
498      */

499     private boolean isDefaultPageEncoding;
500
501     /*
502      * Indicates whether an encoding has been explicitly specified in the
503      * page's XML prolog (only used for pages in XML syntax).
504      * This information is used to decide whether a translation error must
505      * be reported for encoding conflicts.
506      */

507     private boolean isEncodingSpecifiedInProlog;
508
509     /*
510      * Constructor.
511      */

512     Root(Mark start, Node parent, boolean isXmlSyntax) {
513         super(start, parent);
514         this.isXmlSyntax = isXmlSyntax;
515         this.qName = JSP_ROOT_ACTION;
516         this.localName = ROOT_ACTION;
517
518         // Figure out and set the parent root
519
Node r = parent;
520         while ((r != null) && !(r instanceof Node.Root))
521         r = r.getParent();
522         parentRoot = (Node.Root) r;
523     }
524
525     public void accept(Visitor v) throws JspException JavaDoc {
526         v.visit(this);
527     }
528
529     public boolean isXmlSyntax() {
530         return isXmlSyntax;
531     }
532
533     /*
534      * Sets the encoding specified in the JSP config element whose URL
535      * pattern matches the page containing this Root.
536      */

537     public void setJspConfigPageEncoding(String JavaDoc enc) {
538         jspConfigPageEnc = enc;
539     }
540
541     /*
542      * Gets the encoding specified in the JSP config element whose URL
543      * pattern matches the page containing this Root.
544      */

545     public String JavaDoc getJspConfigPageEncoding() {
546         return jspConfigPageEnc;
547     }
548
549     public void setPageEncoding(String JavaDoc enc) {
550         pageEnc = enc;
551     }
552
553     public String JavaDoc getPageEncoding() {
554         return pageEnc;
555     }
556
557     public void setIsDefaultPageEncoding(boolean isDefault) {
558         isDefaultPageEncoding = isDefault;
559     }
560
561     public boolean isDefaultPageEncoding() {
562         return isDefaultPageEncoding;
563     }
564     
565     public void setIsEncodingSpecifiedInProlog(boolean isSpecified) {
566         isEncodingSpecifiedInProlog = isSpecified;
567     }
568
569     public boolean isEncodingSpecifiedInProlog() {
570         return isEncodingSpecifiedInProlog;
571     }
572
573     /**
574      * @return The enclosing root to this Root. Usually represents the
575      * page that includes this one.
576      */

577     public Root getParentRoot() {
578         return parentRoot;
579     }
580     }
581     
582     /**
583      * Represents the root of a Jsp document (XML syntax)
584      */

585     public static class JspRoot extends Node {
586
587     public JspRoot(String JavaDoc qName, Attributes JavaDoc attrs,
588                Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
589                Mark start, Node parent) {
590         super(qName, ROOT_ACTION, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
591           start, parent);
592     }
593
594     public void accept(Visitor v) throws JspException JavaDoc {
595         v.visit(this);
596     }
597     }
598
599     /**
600      * Represents a page directive
601      */

602     public static class PageDirective extends Node {
603
604     private Vector<String JavaDoc> imports;
605
606     public PageDirective(Attributes JavaDoc attrs, Mark start, Node parent) {
607         this(JSP_PAGE_DIRECTIVE_ACTION, attrs, null, null, start, parent);
608     }
609
610     public PageDirective(String JavaDoc qName, Attributes JavaDoc attrs,
611                  Attributes JavaDoc nonTaglibXmlnsAttrs,
612                  Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
613         super(qName, PAGE_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
614           taglibAttrs, start, parent);
615         imports = new Vector<String JavaDoc>();
616     }
617
618     public void accept(Visitor v) throws JspException JavaDoc {
619         v.visit(this);
620     }
621
622     /**
623      * Parses the comma-separated list of class or package names in the
624      * given attribute value and adds each component to this
625      * PageDirective's vector of imported classes and packages.
626      * @param value A comma-separated string of imports.
627      */

628     public void addImport(String JavaDoc value) {
629         int start = 0;
630         int index;
631         while ((index = value.indexOf(',', start)) != -1) {
632         imports.add(value.substring(start, index).trim());
633         start = index + 1;
634         }
635         if (start == 0) {
636         // No comma found
637
imports.add(value.trim());
638         } else {
639         imports.add(value.substring(start).trim());
640         }
641     }
642
643     public List<String JavaDoc> getImports() {
644         return imports;
645     }
646     }
647
648     /**
649      * Represents an include directive
650      */

651     public static class IncludeDirective extends Node {
652
653     public IncludeDirective(Attributes JavaDoc attrs, Mark start, Node parent) {
654         this(JSP_INCLUDE_DIRECTIVE_ACTION, attrs, null, null, start,
655          parent);
656     }
657
658     public IncludeDirective(String JavaDoc qName, Attributes JavaDoc attrs,
659                 Attributes JavaDoc nonTaglibXmlnsAttrs,
660                 Attributes JavaDoc taglibAttrs, Mark start,
661                 Node parent) {
662         super(qName, INCLUDE_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
663           taglibAttrs, start, parent);
664     }
665
666     public void accept(Visitor v) throws JspException JavaDoc {
667         v.visit(this);
668     }
669     }
670
671     /**
672      * Represents a custom taglib directive
673      */

674     public static class TaglibDirective extends Node {
675
676     public TaglibDirective(Attributes JavaDoc attrs, Mark start, Node parent) {
677         super(JSP_TAGLIB_DIRECTIVE_ACTION, TAGLIB_DIRECTIVE_ACTION, attrs,
678           start, parent);
679     }
680
681     public void accept(Visitor v) throws JspException JavaDoc {
682         v.visit(this);
683     }
684     }
685
686     /**
687      * Represents a tag directive
688      */

689     public static class TagDirective extends Node {
690         private Vector<String JavaDoc> imports;
691
692     public TagDirective(Attributes JavaDoc attrs, Mark start, Node parent) {
693         this(JSP_TAG_DIRECTIVE_ACTION, attrs, null, null, start, parent);
694     }
695
696     public TagDirective(String JavaDoc qName, Attributes JavaDoc attrs,
697                 Attributes JavaDoc nonTaglibXmlnsAttrs,
698                 Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
699         super(qName, TAG_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
700           taglibAttrs, start, parent);
701             imports = new Vector<String JavaDoc>();
702     }
703
704     public void accept(Visitor v) throws JspException JavaDoc {
705         v.visit(this);
706         }
707  
708         /**
709          * Parses the comma-separated list of class or package names in the
710          * given attribute value and adds each component to this
711          * PageDirective's vector of imported classes and packages.
712          * @param value A comma-separated string of imports.
713          */

714         public void addImport(String JavaDoc value) {
715             int start = 0;
716             int index;
717             while ((index = value.indexOf(',', start)) != -1) {
718                 imports.add(value.substring(start, index).trim());
719                 start = index + 1;
720             }
721             if (start == 0) {
722                 // No comma found
723
imports.add(value.trim());
724             } else {
725                 imports.add(value.substring(start).trim());
726             }
727         }
728  
729         public List<String JavaDoc> getImports() {
730             return imports;
731     }
732     }
733
734     /**
735      * Represents an attribute directive
736      */

737     public static class AttributeDirective extends Node {
738
739     public AttributeDirective(Attributes JavaDoc attrs, Mark start, Node parent) {
740         this(JSP_ATTRIBUTE_DIRECTIVE_ACTION, attrs, null, null, start,
741          parent);
742     }
743
744     public AttributeDirective(String JavaDoc qName, Attributes JavaDoc attrs,
745                   Attributes JavaDoc nonTaglibXmlnsAttrs,
746                   Attributes JavaDoc taglibAttrs, Mark start,
747                   Node parent) {
748         super(qName, ATTRIBUTE_DIRECTIVE_ACTION, attrs,
749           nonTaglibXmlnsAttrs, taglibAttrs, start, parent);
750     }
751
752     public void accept(Visitor v) throws JspException JavaDoc {
753         v.visit(this);
754     }
755     }
756
757     /**
758      * Represents a variable directive
759      */

760     public static class VariableDirective extends Node {
761
762     public VariableDirective(Attributes JavaDoc attrs, Mark start, Node parent) {
763         this(JSP_VARIABLE_DIRECTIVE_ACTION, attrs, null, null, start,
764          parent);
765     }
766
767     public VariableDirective(String JavaDoc qName, Attributes JavaDoc attrs,
768                  Attributes JavaDoc nonTaglibXmlnsAttrs,
769                  Attributes JavaDoc taglibAttrs,
770                  Mark start, Node parent) {
771         super(qName, VARIABLE_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
772           taglibAttrs, start, parent);
773     }
774
775     public void accept(Visitor v) throws JspException JavaDoc {
776         v.visit(this);
777     }
778     }
779
780     /**
781      * Represents a <jsp:invoke> tag file action
782      */

783     public static class InvokeAction extends Node {
784
785     public InvokeAction(Attributes JavaDoc attrs, Mark start, Node parent) {
786         this(JSP_INVOKE_ACTION, attrs, null, null, start, parent);
787     }
788
789     public InvokeAction(String JavaDoc qName, Attributes JavaDoc attrs,
790                 Attributes JavaDoc nonTaglibXmlnsAttrs,
791                 Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
792         super(qName, INVOKE_ACTION, attrs, nonTaglibXmlnsAttrs,
793           taglibAttrs, start, parent);
794     }
795
796     public void accept(Visitor v) throws JspException JavaDoc {
797         v.visit(this);
798     }
799     }
800
801     /**
802      * Represents a <jsp:doBody> tag file action
803      */

804     public static class DoBodyAction extends Node {
805
806     public DoBodyAction(Attributes JavaDoc attrs, Mark start, Node parent) {
807         this(JSP_DOBODY_ACTION, attrs, null, null, start, parent);
808     }
809
810     public DoBodyAction(String JavaDoc qName, Attributes JavaDoc attrs,
811                 Attributes JavaDoc nonTaglibXmlnsAttrs,
812                 Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
813         super(qName, DOBODY_ACTION, attrs, nonTaglibXmlnsAttrs,
814           taglibAttrs, start, parent);
815     }
816
817     public void accept(Visitor v) throws JspException JavaDoc {
818         v.visit(this);
819     }
820     }
821
822     /**
823      * Represents a Jsp comment
824      * Comments are kept for completeness.
825      */

826     public static class Comment extends Node {
827
828     public Comment(String JavaDoc text, Mark start, Node parent) {
829         super(null, null, text, start, parent);
830     }
831
832     public void accept(Visitor v) throws JspException JavaDoc {
833         v.visit(this);
834     }
835     }
836
837     /**
838      * Represents an expression, declaration, or scriptlet
839      */

840     public static abstract class ScriptingElement extends Node {
841
842     public ScriptingElement(String JavaDoc qName, String JavaDoc localName, String JavaDoc text,
843                 Mark start, Node parent) {
844         super(qName, localName, text, start, parent);
845     }
846
847     public ScriptingElement(String JavaDoc qName, String JavaDoc localName,
848                 Attributes JavaDoc nonTaglibXmlnsAttrs,
849                 Attributes JavaDoc taglibAttrs, Mark start,
850                 Node parent) {
851         super(qName, localName, null, nonTaglibXmlnsAttrs, taglibAttrs,
852           start, parent);
853     }
854
855     /**
856      * When this node was created from a JSP page in JSP syntax, its text
857      * was stored as a String in the "text" field, whereas when this node
858      * was created from a JSP document, its text was stored as one or more
859      * TemplateText nodes in its body. This method handles either case.
860      * @return The text string
861      */

862     public String JavaDoc getText() {
863         String JavaDoc ret = text;
864         if ((ret == null) && (body != null)) {
865         StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
866         for (int i=0; i<body.size(); i++) {
867             buf.append(body.getNode(i).getText());
868         }
869         ret = buf.toString();
870         }
871         return ret;
872     }
873     }
874
875     /**
876      * Represents a declaration
877      */

878     public static class Declaration extends ScriptingElement {
879
880     public Declaration(String JavaDoc text, Mark start, Node parent) {
881         super(JSP_DECLARATION_ACTION, DECLARATION_ACTION, text, start,
882           parent);
883     }
884
885     public Declaration(String JavaDoc qName, Attributes JavaDoc nonTaglibXmlnsAttrs,
886                Attributes JavaDoc taglibAttrs, Mark start,
887                Node parent) {
888         super(qName, DECLARATION_ACTION, nonTaglibXmlnsAttrs,
889           taglibAttrs, start, parent);
890     }
891
892     public void accept(Visitor v) throws JspException JavaDoc {
893         v.visit(this);
894     }
895     }
896
897     /**
898      * Represents an expression. Expressions in attributes are embedded
899      * in the attribute string and not here.
900      */

901     public static class Expression extends ScriptingElement {
902
903     public Expression(String JavaDoc text, Mark start, Node parent) {
904         super(JSP_EXPRESSION_ACTION, EXPRESSION_ACTION, text, start,
905           parent);
906     }
907
908     public Expression(String JavaDoc qName, Attributes JavaDoc nonTaglibXmlnsAttrs,
909               Attributes JavaDoc taglibAttrs, Mark start,
910               Node parent) {
911         super(qName, EXPRESSION_ACTION, nonTaglibXmlnsAttrs, taglibAttrs,
912           start, parent);
913     }
914
915     public void accept(Visitor v) throws JspException JavaDoc {
916         v.visit(this);
917     }
918     }
919
920     /**
921      * Represents a scriptlet
922      */

923     public static class Scriptlet extends ScriptingElement {
924
925     public Scriptlet(String JavaDoc text, Mark start, Node parent) {
926         super(JSP_SCRIPTLET_ACTION, SCRIPTLET_ACTION, text, start, parent);
927     }
928
929     public Scriptlet(String JavaDoc qName, Attributes JavaDoc nonTaglibXmlnsAttrs,
930              Attributes JavaDoc taglibAttrs, Mark start,
931              Node parent) {
932         super(qName, SCRIPTLET_ACTION, nonTaglibXmlnsAttrs, taglibAttrs,
933           start, parent);
934     }
935
936     public void accept(Visitor v) throws JspException JavaDoc {
937         v.visit(this);
938     }
939     }
940
941     /**
942      * Represents an EL expression. Expressions in attributes are embedded
943      * in the attribute string and not here.
944      */

945     public static class ELExpression extends Node {
946
947     private ELNode.Nodes el;
948
949         public ELExpression(String JavaDoc text, Mark start, Node parent) {
950             super(null, null, text, start, parent);
951         }
952
953         public void accept(Visitor v) throws JspException JavaDoc {
954             v.visit(this);
955         }
956
957     public void setEL(ELNode.Nodes el) {
958         this.el = el;
959     }
960
961     public ELNode.Nodes getEL() {
962         return el;
963     }
964     }
965
966     /**
967      * Represents a param action
968      */

969     public static class ParamAction extends Node {
970
971     JspAttribute value;
972
973     public ParamAction(Attributes JavaDoc attrs, Mark start, Node parent) {
974         this(JSP_PARAM_ACTION, attrs, null, null, start, parent);
975     }
976
977     public ParamAction(String JavaDoc qName, Attributes JavaDoc attrs,
978                Attributes JavaDoc nonTaglibXmlnsAttrs,
979                Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
980         super(qName, PARAM_ACTION, attrs, nonTaglibXmlnsAttrs,
981           taglibAttrs, start, parent);
982     }
983
984     public void accept(Visitor v) throws JspException JavaDoc {
985         v.visit(this);
986     }
987
988     public void setValue(JspAttribute value) {
989         this.value = value;
990     }
991
992     public JspAttribute getValue() {
993         return value;
994     }
995     }
996
997     /**
998      * Represents a params action
999      */

1000    public static class ParamsAction extends Node {
1001
1002    public ParamsAction(Mark start, Node parent) {
1003        this(JSP_PARAMS_ACTION, null, null, start, parent);
1004    }
1005
1006    public ParamsAction(String JavaDoc qName,
1007                Attributes JavaDoc nonTaglibXmlnsAttrs,
1008                Attributes JavaDoc taglibAttrs,
1009                Mark start, Node parent) {
1010        super(qName, PARAMS_ACTION, null, nonTaglibXmlnsAttrs, taglibAttrs,
1011          start, parent);
1012    }
1013
1014    public void accept(Visitor v) throws JspException JavaDoc {
1015        v.visit(this);
1016    }
1017    }
1018
1019    /**
1020     * Represents a fallback action
1021     */

1022    public static class FallBackAction extends Node {
1023
1024    public FallBackAction(Mark start, Node parent) {
1025        this(JSP_FALLBACK_ACTION, null, null, start, parent);
1026    }
1027
1028    public FallBackAction(String JavaDoc qName,
1029                  Attributes JavaDoc nonTaglibXmlnsAttrs,
1030                  Attributes JavaDoc taglibAttrs, Mark start,
1031                  Node parent) {
1032        super(qName, FALLBACK_ACTION, null, nonTaglibXmlnsAttrs,
1033          taglibAttrs, start, parent);
1034    }
1035
1036    public void accept(Visitor v) throws JspException JavaDoc {
1037        v.visit(this);
1038    }
1039    }
1040
1041    /**
1042     * Represents an include action
1043     */

1044    public static class IncludeAction extends Node {
1045
1046    private JspAttribute page;
1047
1048    public IncludeAction(Attributes JavaDoc attrs, Mark start, Node parent) {
1049        this(JSP_INCLUDE_ACTION, attrs, null, null, start, parent);
1050    }
1051
1052    public IncludeAction(String JavaDoc qName, Attributes JavaDoc attrs,
1053                 Attributes JavaDoc nonTaglibXmlnsAttrs,
1054                 Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
1055        super(qName, INCLUDE_ACTION, attrs, nonTaglibXmlnsAttrs,
1056          taglibAttrs, start, parent);
1057    }
1058
1059    public void accept(Visitor v) throws JspException JavaDoc {
1060        v.visit(this);
1061    }
1062
1063    public void setPage(JspAttribute page) {
1064        this.page = page;
1065    }
1066
1067    public JspAttribute getPage() {
1068        return page;
1069    }
1070    }
1071
1072    /**
1073     * Represents a forward action
1074     */

1075    public static class ForwardAction extends Node {
1076
1077    private JspAttribute page;
1078
1079    public ForwardAction(Attributes JavaDoc attrs, Mark start, Node parent) {
1080        this(JSP_FORWARD_ACTION, attrs, null, null, start, parent);
1081    }
1082
1083    public ForwardAction(String JavaDoc qName, Attributes JavaDoc attrs,
1084                 Attributes JavaDoc nonTaglibXmlnsAttrs,
1085                 Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
1086        super(qName, FORWARD_ACTION, attrs, nonTaglibXmlnsAttrs,
1087          taglibAttrs, start, parent);
1088    }
1089
1090    public void accept(Visitor v) throws JspException JavaDoc {
1091        v.visit(this);
1092    }
1093
1094    public void setPage(JspAttribute page) {
1095        this.page = page;
1096    }
1097
1098    public JspAttribute getPage() {
1099        return page;
1100    }
1101    }
1102
1103    /**
1104     * Represents a getProperty action
1105     */

1106    public static class GetProperty extends Node {
1107
1108    public GetProperty(Attributes JavaDoc attrs, Mark start, Node parent) {
1109        this(JSP_GET_PROPERTY_ACTION, attrs, null, null, start, parent);
1110    }
1111
1112    public GetProperty(String JavaDoc qName, Attributes JavaDoc attrs,
1113               Attributes JavaDoc nonTaglibXmlnsAttrs,
1114               Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
1115        super(qName, GET_PROPERTY_ACTION, attrs, nonTaglibXmlnsAttrs,
1116          taglibAttrs, start, parent);
1117    }
1118
1119    public void accept(Visitor v) throws JspException JavaDoc {
1120        v.visit(this);
1121    }
1122    }
1123
1124    /**
1125     * Represents a setProperty action
1126     */

1127    public static class SetProperty extends Node {
1128
1129    private JspAttribute value;
1130
1131    public SetProperty(Attributes JavaDoc attrs, Mark start, Node parent) {
1132        this(JSP_SET_PROPERTY_ACTION, attrs, null, null, start, parent);
1133    }
1134
1135    public SetProperty(String JavaDoc qName, Attributes JavaDoc attrs,
1136               Attributes JavaDoc nonTaglibXmlnsAttrs,
1137               Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
1138        super(qName, SET_PROPERTY_ACTION, attrs, nonTaglibXmlnsAttrs,
1139          taglibAttrs, start, parent);
1140    }
1141
1142    public void accept(Visitor v) throws JspException JavaDoc {
1143        v.visit(this);
1144    }
1145
1146    public void setValue(JspAttribute value) {
1147        this.value = value;
1148    }
1149
1150    public JspAttribute getValue() {
1151        return value;
1152    }
1153    }
1154
1155    /**
1156     * Represents a useBean action
1157     */

1158    public static class UseBean extends Node {
1159
1160    JspAttribute beanName;
1161
1162    public UseBean(Attributes JavaDoc attrs, Mark start, Node parent) {
1163        this(JSP_USE_BEAN_ACTION, attrs, null, null, start, parent);
1164    }
1165
1166    public UseBean(String JavaDoc qName, Attributes JavaDoc attrs,
1167               Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
1168               Mark start, Node parent) {
1169        super(qName, USE_BEAN_ACTION, attrs, nonTaglibXmlnsAttrs,
1170          taglibAttrs, start, parent);
1171    }
1172
1173    public void accept(Visitor v) throws JspException JavaDoc {
1174        v.visit(this);
1175    }
1176
1177    public void setBeanName(JspAttribute beanName) {
1178        this.beanName = beanName;
1179    }
1180
1181    public JspAttribute getBeanName() {
1182        return beanName;
1183    }
1184    }
1185
1186    /**
1187     * Represents a plugin action
1188     */

1189    public static class PlugIn extends Node {
1190
1191        private JspAttribute width;
1192        private JspAttribute height;
1193        
1194    public PlugIn(Attributes JavaDoc attrs, Mark start, Node parent) {
1195        this(JSP_PLUGIN_ACTION, attrs, null, null, start, parent);
1196    }
1197
1198    public PlugIn(String JavaDoc qName, Attributes JavaDoc attrs,
1199              Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
1200              Mark start, Node parent) {
1201        super(qName, PLUGIN_ACTION, attrs, nonTaglibXmlnsAttrs,
1202          taglibAttrs, start, parent);
1203    }
1204
1205    public void accept(Visitor v) throws JspException JavaDoc {
1206        v.visit(this);
1207    }
1208
1209    public void setHeight(JspAttribute height) {
1210        this.height = height;
1211    }
1212
1213    public void setWidth(JspAttribute width) {
1214        this.width = width;
1215    }
1216
1217    public JspAttribute getHeight() {
1218        return height;
1219    }
1220
1221    public JspAttribute getWidth() {
1222        return width;
1223    }
1224    }
1225
1226    /**
1227     * Represents an uninterpreted tag, from a Jsp document
1228     */

1229    public static class UninterpretedTag extends Node {
1230
1231    private JspAttribute[] jspAttrs;
1232
1233    public UninterpretedTag(String JavaDoc qName, String JavaDoc localName,
1234                Attributes JavaDoc attrs,
1235                Attributes JavaDoc nonTaglibXmlnsAttrs,
1236                Attributes JavaDoc taglibAttrs,
1237                Mark start, Node parent) {
1238        super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
1239          start, parent);
1240    }
1241
1242    public void accept(Visitor v) throws JspException JavaDoc {
1243        v.visit(this);
1244    }
1245
1246    public void setJspAttributes(JspAttribute[] jspAttrs) {
1247        this.jspAttrs = jspAttrs;
1248    }
1249
1250    public JspAttribute[] getJspAttributes() {
1251        return jspAttrs;
1252    }
1253    }
1254    
1255    /**
1256     * Represents a <jsp:element>.
1257     */

1258    public static class JspElement extends Node {
1259
1260    private JspAttribute[] jspAttrs;
1261    private JspAttribute nameAttr;
1262
1263    public JspElement(Attributes JavaDoc attrs, Mark start, Node parent) {
1264        this(JSP_ELEMENT_ACTION, attrs, null, null, start, parent);
1265    }
1266
1267    public JspElement(String JavaDoc qName, Attributes JavaDoc attrs,
1268              Attributes JavaDoc nonTaglibXmlnsAttrs,
1269              Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
1270        super(qName, ELEMENT_ACTION, attrs, nonTaglibXmlnsAttrs,
1271          taglibAttrs, start, parent);
1272    }
1273
1274    public void accept(Visitor v) throws JspException JavaDoc {
1275        v.visit(this);
1276    }
1277
1278    public void setJspAttributes(JspAttribute[] jspAttrs) {
1279        this.jspAttrs = jspAttrs;
1280    }
1281
1282    public JspAttribute[] getJspAttributes() {
1283        return jspAttrs;
1284    }
1285
1286    /*
1287     * Sets the XML-style 'name' attribute
1288     */

1289    public void setNameAttribute(JspAttribute nameAttr) {
1290        this.nameAttr = nameAttr;
1291    }
1292
1293    /*
1294     * Gets the XML-style 'name' attribute
1295     */

1296    public JspAttribute getNameAttribute() {
1297        return this.nameAttr;
1298    }
1299    }
1300
1301    /**
1302     * Represents a <jsp:output>.
1303     */

1304    public static class JspOutput extends Node {
1305
1306    public JspOutput(String JavaDoc qName, Attributes JavaDoc attrs,
1307             Attributes JavaDoc nonTaglibXmlnsAttrs,
1308             Attributes JavaDoc taglibAttrs,
1309             Mark start, Node parent) {
1310        super(qName, OUTPUT_ACTION, attrs, nonTaglibXmlnsAttrs,
1311          taglibAttrs, start, parent);
1312    }
1313
1314    public void accept(Visitor v) throws JspException JavaDoc {
1315        v.visit(this);
1316    }
1317    }
1318
1319    /**
1320     * Collected information about child elements. Used by nodes like
1321     * CustomTag, JspBody, and NamedAttribute. The information is
1322     * set in the Collector.
1323     */

1324    public static class ChildInfo {
1325    private boolean scriptless; // true if the tag and its body
1326
// contain no scripting elements.
1327
private boolean hasUseBean;
1328    private boolean hasIncludeAction;
1329    private boolean hasParamAction;
1330    private boolean hasSetProperty;
1331    private boolean hasScriptingVars;
1332
1333    public void setScriptless(boolean s) {
1334        scriptless = s;
1335    }
1336
1337    public boolean isScriptless() {
1338        return scriptless;
1339    }
1340
1341    public void setHasUseBean(boolean u) {
1342        hasUseBean = u;
1343    }
1344
1345    public boolean hasUseBean() {
1346        return hasUseBean;
1347    }
1348
1349    public void setHasIncludeAction(boolean i) {
1350        hasIncludeAction = i;
1351    }
1352
1353    public boolean hasIncludeAction() {
1354        return hasIncludeAction;
1355    }
1356
1357    public void setHasParamAction(boolean i) {
1358        hasParamAction = i;
1359    }
1360
1361    public boolean hasParamAction() {
1362        return hasParamAction;
1363    }
1364
1365    public void setHasSetProperty(boolean s) {
1366        hasSetProperty = s;
1367    }
1368
1369    public boolean hasSetProperty() {
1370        return hasSetProperty;
1371    }
1372        
1373    public void setHasScriptingVars(boolean s) {
1374        hasScriptingVars = s;
1375    }
1376
1377    public boolean hasScriptingVars() {
1378        return hasScriptingVars;
1379    }
1380    }
1381
1382    /**
1383     * Represents a custom tag
1384     */

1385    public static class CustomTag extends Node {
1386
1387    private String JavaDoc uri;
1388    private String JavaDoc prefix;
1389    private JspAttribute[] jspAttrs;
1390    private TagData tagData;
1391    private String JavaDoc tagHandlerPoolName;
1392    private TagInfo tagInfo;
1393    private TagFileInfo tagFileInfo;
1394    private Class JavaDoc tagHandlerClass;
1395    private VariableInfo[] varInfos;
1396    private int customNestingLevel;
1397        private ChildInfo childInfo;
1398    private boolean implementsIterationTag;
1399    private boolean implementsBodyTag;
1400    private boolean implementsTryCatchFinally;
1401    private boolean implementsSimpleTag;
1402    private boolean implementsDynamicAttributes;
1403    private Vector atBeginScriptingVars;
1404    private Vector atEndScriptingVars;
1405    private Vector nestedScriptingVars;
1406    private Node.CustomTag customTagParent;
1407    private Integer JavaDoc numCount;
1408    //private boolean useTagPlugin;
1409
//private TagPluginContext tagPluginContext;
1410

1411    /**
1412     * The following two fields are used for holding the Java
1413     * scriptlets that the tag plugins may generate. Meaningful
1414     * only if useTagPlugin is true;
1415     * Could move them into TagPluginContextImpl, but we'll need
1416     * to cast tagPluginContext to TagPluginContextImpl all the time...
1417     */

1418    //private Nodes atSTag;
1419
//private Nodes atETag;
1420

1421    /*
1422     * Constructor for custom action implemented by tag handler.
1423     */

1424    public CustomTag(String JavaDoc qName, String JavaDoc prefix, String JavaDoc localName,
1425             String JavaDoc uri, Attributes JavaDoc attrs, Mark start, Node parent,
1426             TagInfo tagInfo, Class JavaDoc tagHandlerClass) {
1427        this(qName, prefix, localName, uri, attrs, null, null, start,
1428         parent, tagInfo, tagHandlerClass);
1429    }
1430
1431    /*
1432     * Constructor for custom action implemented by tag handler.
1433     */

1434    public CustomTag(String JavaDoc qName, String JavaDoc prefix, String JavaDoc localName,
1435             String JavaDoc uri, Attributes JavaDoc attrs,
1436             Attributes JavaDoc nonTaglibXmlnsAttrs,
1437             Attributes JavaDoc taglibAttrs,
1438             Mark start, Node parent, TagInfo tagInfo,
1439             Class JavaDoc tagHandlerClass) {
1440        super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
1441          start, parent);
1442
1443        this.uri = uri;
1444        this.prefix = prefix;
1445        this.tagInfo = tagInfo;
1446        this.tagHandlerClass = tagHandlerClass;
1447        this.customNestingLevel = makeCustomNestingLevel();
1448            this.childInfo = new ChildInfo();
1449
1450        this.implementsIterationTag =
1451        IterationTag.class.isAssignableFrom(tagHandlerClass);
1452        this.implementsBodyTag =
1453        BodyTag.class.isAssignableFrom(tagHandlerClass);
1454        this.implementsTryCatchFinally =
1455        TryCatchFinally.class.isAssignableFrom(tagHandlerClass);
1456        this.implementsSimpleTag =
1457        SimpleTag.class.isAssignableFrom(tagHandlerClass);
1458        this.implementsDynamicAttributes =
1459        DynamicAttributes.class.isAssignableFrom(tagHandlerClass);
1460    }
1461
1462    /*
1463     * Constructor for custom action implemented by tag file.
1464     */

1465    public CustomTag(String JavaDoc qName, String JavaDoc prefix, String JavaDoc localName,
1466             String JavaDoc uri, Attributes JavaDoc attrs, Mark start, Node parent,
1467             TagFileInfo tagFileInfo) {
1468        this(qName, prefix, localName, uri, attrs, null, null, start,
1469         parent, tagFileInfo);
1470    }
1471
1472    /*
1473     * Constructor for custom action implemented by tag file.
1474     */

1475    public CustomTag(String JavaDoc qName, String JavaDoc prefix, String JavaDoc localName,
1476             String JavaDoc uri, Attributes JavaDoc attrs,
1477             Attributes JavaDoc nonTaglibXmlnsAttrs,
1478             Attributes JavaDoc taglibAttrs,
1479             Mark start, Node parent, TagFileInfo tagFileInfo) {
1480
1481        super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
1482          start, parent);
1483
1484        this.uri = uri;
1485        this.prefix = prefix;
1486        this.tagFileInfo = tagFileInfo;
1487        this.tagInfo = tagFileInfo.getTagInfo();
1488        this.customNestingLevel = makeCustomNestingLevel();
1489            this.childInfo = new ChildInfo();
1490
1491        this.implementsIterationTag = false;
1492        this.implementsBodyTag = false;
1493        this.implementsTryCatchFinally = false;
1494        this.implementsSimpleTag = true;
1495        this.implementsDynamicAttributes = tagInfo.hasDynamicAttributes();
1496    }
1497
1498    public void accept(Visitor v) throws JspException JavaDoc {
1499        v.visit(this);
1500    }
1501
1502    /**
1503     * @return The URI namespace that this custom action belongs to
1504     */

1505    public String JavaDoc getURI() {
1506        return this.uri;
1507    }
1508
1509    /**
1510     * @return The tag prefix
1511     */

1512    public String JavaDoc getPrefix() {
1513        return prefix;
1514    }
1515
1516    public void setJspAttributes(JspAttribute[] jspAttrs) {
1517        this.jspAttrs = jspAttrs;
1518    }
1519
1520    public JspAttribute[] getJspAttributes() {
1521        return jspAttrs;
1522    }
1523        
1524        public ChildInfo getChildInfo() {
1525            return childInfo;
1526        }
1527    
1528    public void setTagData(TagData tagData) {
1529        this.tagData = tagData;
1530        this.varInfos = tagInfo.getVariableInfo(tagData);
1531        if (this.varInfos == null) {
1532        this.varInfos = ZERO_VARIABLE_INFO;
1533        }
1534    }
1535
1536    public TagData getTagData() {
1537        return tagData;
1538    }
1539
1540    public void setTagHandlerPoolName(String JavaDoc s) {
1541        tagHandlerPoolName = s;
1542    }
1543
1544    public String JavaDoc getTagHandlerPoolName() {
1545        return tagHandlerPoolName;
1546    }
1547
1548    public TagInfo getTagInfo() {
1549        return tagInfo;
1550    }
1551
1552    public TagFileInfo getTagFileInfo() {
1553        return tagFileInfo;
1554    }
1555
1556    /*
1557     * @return true if this custom action is supported by a tag file,
1558     * false otherwise
1559     */

1560    public boolean isTagFile() {
1561        return tagFileInfo != null;
1562    }
1563
1564    public Class JavaDoc getTagHandlerClass() {
1565        return tagHandlerClass;
1566    }
1567
1568    public void setTagHandlerClass(Class JavaDoc hc) {
1569        tagHandlerClass = hc;
1570    }
1571
1572    public boolean implementsIterationTag() {
1573        return implementsIterationTag;
1574    }
1575
1576    public boolean implementsBodyTag() {
1577        return implementsBodyTag;
1578    }
1579
1580    public boolean implementsTryCatchFinally() {
1581        return implementsTryCatchFinally;
1582    }
1583
1584    public boolean implementsSimpleTag() {
1585        return implementsSimpleTag;
1586    }
1587
1588    public boolean implementsDynamicAttributes() {
1589        return implementsDynamicAttributes;
1590    }
1591
1592    public TagVariableInfo[] getTagVariableInfos() {
1593        return tagInfo.getTagVariableInfos();
1594    }
1595 
1596    public VariableInfo[] getVariableInfos() {
1597        return varInfos;
1598    }
1599
1600    public void setCustomTagParent(Node.CustomTag n) {
1601        this.customTagParent = n;
1602    }
1603
1604    public Node.CustomTag getCustomTagParent() {
1605        return this.customTagParent;
1606    }
1607
1608    public void setNumCount(Integer JavaDoc count) {
1609        this.numCount = count;
1610    }
1611
1612    public Integer JavaDoc getNumCount() {
1613        return this.numCount;
1614    }
1615
1616    public void setScriptingVars(Vector vec, int scope) {
1617        switch (scope) {
1618        case VariableInfo.AT_BEGIN:
1619        this.atBeginScriptingVars = vec;
1620        break;
1621        case VariableInfo.AT_END:
1622        this.atEndScriptingVars = vec;
1623        break;
1624        case VariableInfo.NESTED:
1625        this.nestedScriptingVars = vec;
1626        break;
1627        }
1628    }
1629
1630    /*
1631     * Gets the scripting variables for the given scope that need to be
1632     * declared.
1633     */

1634    public Vector getScriptingVars(int scope) {
1635        Vector vec = null;
1636
1637        switch (scope) {
1638        case VariableInfo.AT_BEGIN:
1639        vec = this.atBeginScriptingVars;
1640        break;
1641        case VariableInfo.AT_END:
1642        vec = this.atEndScriptingVars;
1643        break;
1644        case VariableInfo.NESTED:
1645        vec = this.nestedScriptingVars;
1646        break;
1647        }
1648
1649        return vec;
1650    }
1651
1652    /*
1653     * Gets this custom tag's custom nesting level, which is given as
1654     * the number of times this custom tag is nested inside itself.
1655     */

1656    public int getCustomNestingLevel() {
1657        return customNestingLevel;
1658    }
1659
1660        /**
1661         * Checks to see if the attribute of the given name is of type
1662     * JspFragment.
1663         */

1664        public boolean checkIfAttributeIsJspFragment( String JavaDoc name ) {
1665            boolean result = false;
1666
1667        TagAttributeInfo[] attributes = tagInfo.getAttributes();
1668        for (int i = 0; i < attributes.length; i++) {
1669        if (attributes[i].getName().equals(name) &&
1670                    attributes[i].isFragment()) {
1671            result = true;
1672            break;
1673        }
1674        }
1675            
1676            return result;
1677        }
1678
1679    /*public void setUseTagPlugin(boolean use) {
1680        useTagPlugin = use;
1681    }
1682
1683    public boolean useTagPlugin() {
1684        return useTagPlugin;
1685    }
1686
1687    public void setTagPluginContext(TagPluginContext tagPluginContext) {
1688        this.tagPluginContext = tagPluginContext;
1689    }
1690
1691    public TagPluginContext getTagPluginContext() {
1692        return tagPluginContext;
1693    }
1694
1695    public void setAtSTag(Nodes sTag) {
1696        atSTag = sTag;
1697    }
1698
1699    public Nodes getAtSTag() {
1700        return atSTag;
1701    }
1702        
1703    public void setAtETag(Nodes eTag) {
1704        atETag = eTag;
1705    }
1706
1707    public Nodes getAtETag() {
1708        return atETag;
1709    }*/

1710        
1711    /*
1712     * Computes this custom tag's custom nesting level, which corresponds
1713     * to the number of times this custom tag is nested inside itself.
1714     *
1715     * Example:
1716     *
1717     * <g:h>
1718     * <a:b> -- nesting level 0
1719     * <c:d>
1720     * <e:f>
1721     * <a:b> -- nesting level 1
1722     * <a:b> -- nesting level 2
1723     * </a:b>
1724     * </a:b>
1725     * <a:b> -- nesting level 1
1726     * </a:b>
1727     * </e:f>
1728     * </c:d>
1729     * </a:b>
1730     * </g:h>
1731     *
1732     * @return Custom tag's nesting level
1733     */

1734    private int makeCustomNestingLevel() {
1735        int n = 0;
1736        Node p = parent;
1737        while (p != null) {
1738        if ((p instanceof Node.CustomTag)
1739                && qName.equals(((Node.CustomTag) p).qName)) {
1740            n++;
1741        }
1742        p = p.parent;
1743        }
1744        return n;
1745    }
1746
1747    /**
1748     * Returns true if this custom action has an empty body, and false
1749     * otherwise.
1750     *
1751     * A custom action is considered to have an empty body if the
1752     * following holds true:
1753     * - getBody() returns null, or
1754     * - all immediate children are jsp:attribute actions, or
1755     * - the action's jsp:body is empty.
1756     */

1757     public boolean hasEmptyBody() {
1758         boolean hasEmptyBody = true;
1759         Nodes nodes = getBody();
1760         if (nodes != null) {
1761         int numChildNodes = nodes.size();
1762         for (int i=0; i<numChildNodes; i++) {
1763             Node n = nodes.getNode(i);
1764             if (!(n instanceof NamedAttribute)) {
1765             if (n instanceof JspBody) {
1766                 hasEmptyBody = (n.getBody() == null);
1767             } else {
1768                 hasEmptyBody = false;
1769             }
1770             break;
1771             }
1772         }
1773         }
1774
1775         return hasEmptyBody;
1776     }
1777    }
1778
1779    /**
1780     * Used as a placeholder for the evaluation code of a custom action
1781     * attribute (used by the tag plugin machinery only).
1782     */

1783    public static class AttributeGenerator extends Node {
1784    String JavaDoc name; // name of the attribute
1785
CustomTag tag; // The tag this attribute belongs to
1786

1787    public AttributeGenerator(Mark start, String JavaDoc name, CustomTag tag) {
1788        super(start, null);
1789        this.name = name;
1790        this.tag = tag;
1791    }
1792
1793    public void accept(Visitor v) throws JspException JavaDoc {
1794        v.visit(this);
1795    }
1796
1797    public String JavaDoc getName() {
1798        return name;
1799    }
1800
1801    public CustomTag getTag() {
1802        return tag;
1803    }
1804    }
1805
1806    /**
1807     * Represents the body of a &lt;jsp:text&gt; element
1808     */

1809    public static class JspText extends Node {
1810
1811    public JspText(String JavaDoc qName, Attributes JavaDoc nonTaglibXmlnsAttrs,
1812               Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
1813        super(qName, TEXT_ACTION, null, nonTaglibXmlnsAttrs, taglibAttrs,
1814          start, parent);
1815    }
1816
1817    public void accept(Visitor v) throws JspException JavaDoc {
1818        v.visit(this);
1819    }
1820    }
1821
1822    /**
1823     * Represents a Named Attribute (&lt;jsp:attribute&gt;)
1824     */

1825    public static class NamedAttribute extends Node {
1826
1827        // A unique temporary variable name suitable for code generation
1828
//private String temporaryVariableName;
1829

1830        // True if this node is to be trimmed, or false otherwise
1831
private boolean trim = true;
1832        
1833        private ChildInfo childInfo;
1834    private String JavaDoc name;
1835    private String JavaDoc localName;
1836    private String JavaDoc prefix;
1837
1838        public NamedAttribute(Attributes JavaDoc attrs, Mark start, Node parent) {
1839        this(JSP_ATTRIBUTE_ACTION, attrs, null, null, start, parent);
1840    }
1841
1842        public NamedAttribute(String JavaDoc qName, Attributes JavaDoc attrs,
1843                  Attributes JavaDoc nonTaglibXmlnsAttrs,
1844                  Attributes JavaDoc taglibAttrs,
1845                  Mark start, Node parent) {
1846
1847            super(qName, ATTRIBUTE_ACTION, attrs, nonTaglibXmlnsAttrs,
1848          taglibAttrs, start, parent);
1849            //temporaryVariableName = JspUtil.nextTemporaryVariableName();
1850
if( "false".equals( this.getAttributeValue( "trim" ) ) ) {
1851                // (if null or true, leave default of true)
1852
trim = false;
1853            }
1854            childInfo = new ChildInfo();
1855        name = this.getAttributeValue("name");
1856            if (name != null) {
1857                // Mandatary attribute "name" will be checked in Validator
1858
localName = name;
1859            int index = name.indexOf(':');
1860            if (index != -1) {
1861            prefix = name.substring(0, index);
1862            localName = name.substring(index+1);
1863                }
1864        }
1865        }
1866
1867        public void accept(Visitor v) throws JspException JavaDoc {
1868            v.visit(this);
1869        }
1870
1871        public String JavaDoc getName() {
1872            return this.name;
1873        }
1874
1875        public String JavaDoc getLocalName() {
1876            return this.localName;
1877        }
1878
1879        public String JavaDoc getPrefix() {
1880            return this.prefix;
1881        }
1882        
1883        public ChildInfo getChildInfo() {
1884            return this.childInfo;
1885        }
1886
1887        public boolean isTrim() {
1888            return trim;
1889        }
1890
1891        /**
1892         * @return A unique temporary variable name to store the result in.
1893         * (this probably could go elsewhere, but it's convenient here)
1894         */

1895        /*public String getTemporaryVariableName() {
1896            return temporaryVariableName;
1897        }*/

1898
1899    /*
1900     * Get the attribute value from this named attribute (<jsp:attribute>).
1901     * Since this method is only for attributes that are not rtexpr,
1902     * we can assume the body of the jsp:attribute is a template text.
1903     */

1904    public String JavaDoc getText() {
1905
1906        class AttributeVisitor extends Visitor {
1907        String JavaDoc attrValue = null;
1908        public void visit(TemplateText txt) {
1909            attrValue = new String JavaDoc(txt.getText());
1910        }
1911        
1912        public String JavaDoc getAttrValue() {
1913            return attrValue;
1914        }
1915        }
1916
1917        // According to JSP 2.0, if the body of the <jsp:attribute>
1918
// action is empty, it is equivalent of specifying "" as the value
1919
// of the attribute.
1920
String JavaDoc text = "";
1921        if (getBody() != null) {
1922        AttributeVisitor attributeVisitor = new AttributeVisitor();
1923        try {
1924            getBody().visit(attributeVisitor);
1925        } catch (JspException JavaDoc e) {
1926        }
1927        text = attributeVisitor.getAttrValue();
1928        }
1929        
1930        return text;
1931    }
1932    }
1933
1934    /**
1935     * Represents a JspBody node (&lt;jsp:body&gt;)
1936     */

1937    public static class JspBody extends Node {
1938
1939        private ChildInfo childInfo;
1940
1941        public JspBody(Mark start, Node parent) {
1942            this(JSP_BODY_ACTION, null, null, start, parent);
1943        }
1944
1945        public JspBody(String JavaDoc qName, Attributes JavaDoc nonTaglibXmlnsAttrs,
1946               Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
1947            super(qName, BODY_ACTION, null, nonTaglibXmlnsAttrs, taglibAttrs,
1948          start, parent);
1949            this.childInfo = new ChildInfo();
1950        }
1951
1952        public void accept(Visitor v) throws JspException JavaDoc {
1953            v.visit(this);
1954        }
1955
1956        public ChildInfo getChildInfo() {
1957            return childInfo;
1958        }
1959    }
1960
1961    /**
1962     * Represents a template text string
1963     */

1964    public static class TemplateText extends Node {
1965
1966    public TemplateText(String JavaDoc text, Mark start, Node parent) {
1967        super(null, null, text, start, parent);
1968    }
1969
1970    public void accept(Visitor v) throws JspException JavaDoc {
1971        v.visit(this);
1972    }
1973
1974        /**
1975         * Trim all whitespace from the left of the template text
1976         */

1977        public void ltrim() {
1978        int index = 0;
1979            while ((index < text.length()) && (text.charAt(index) <= ' ')) {
1980        index++;
1981            }
1982            text = text.substring(index);
1983        }
1984
1985        /**
1986         * Trim all whitespace from the right of the template text
1987         */

1988        public void rtrim() {
1989            int index = text.length();
1990            while( (index > 0) && (text.charAt(index-1) <= ' ') ) {
1991                index--;
1992            }
1993            text = text.substring(0, index);
1994        }
1995
1996    /**
1997     * Returns true if this template text contains whitespace only.
1998     */

1999    public boolean isAllSpace() {
2000        boolean isAllSpace = true;
2001        for (int i=0; i<text.length(); i++) {
2002        if (!Character.isSpace(text.charAt(i))) {
2003            isAllSpace = false;
2004            break;
2005        }
2006        }
2007        return isAllSpace;
2008    }
2009    }
2010
2011    /*********************************************************************
2012     * Auxillary classes used in Node
2013     */

2014
2015    /**
2016     * Represents attributes that can be request time expressions.
2017     *
2018     * Can either be a plain attribute, an attribute that represents a
2019     * request time expression value, or a named attribute (specified using
2020     * the jsp:attribute standard action).
2021     */

2022
2023    public static class JspAttribute {
2024
2025    private String JavaDoc qName;
2026    private String JavaDoc uri;
2027    private String JavaDoc localName;
2028    private String JavaDoc value;
2029    private boolean expression;
2030    private boolean dynamic;
2031        private ELNode.Nodes el;
2032
2033        // If true, this JspAttribute represents a <jsp:attribute>
2034
private boolean namedAttribute;
2035        // The node in the parse tree for the NamedAttribute
2036
private NamedAttribute namedAttributeNode;
2037
2038        JspAttribute(String JavaDoc qName, String JavaDoc uri, String JavaDoc localName, String JavaDoc value,
2039             boolean expr, ELNode.Nodes el, boolean dyn ) {
2040        this.qName = qName;
2041        this.uri = uri;
2042        this.localName = localName;
2043        this.value = value;
2044            this.namedAttributeNode = null;
2045        this.expression = expr;
2046            this.el = el;
2047        this.dynamic = dyn;
2048            this.namedAttribute = false;
2049    }
2050
2051        /**
2052         * Use this constructor if the JspAttribute represents a
2053         * named attribute. In this case, we have to store the nodes of
2054         * the body of the attribute.
2055         */

2056        JspAttribute(NamedAttribute na, boolean dyn) {
2057            this.qName = na.getName();
2058        this.localName = na.getLocalName();
2059            this.value = null;
2060            this.namedAttributeNode = na;
2061            this.expression = false;
2062            this.el = null;
2063        this.dynamic = dyn;
2064            this.namedAttribute = true;
2065        }
2066
2067    /**
2068     * @return The name of the attribute
2069     */

2070    public String JavaDoc getName() {
2071        return qName;
2072    }
2073
2074    /**
2075     * @return The local name of the attribute
2076     */

2077    public String JavaDoc getLocalName() {
2078        return localName;
2079    }
2080
2081    /**
2082     * @return The namespace of the attribute, or null if in the default
2083     * namespace
2084     */

2085    public String JavaDoc getURI() {
2086        return uri;
2087    }
2088
2089    /**
2090         * Only makes sense if namedAttribute is false.
2091         *
2092         * @return the value for the attribute, or the expression string
2093         * (stripped of "<%=", "%>", "%=", or "%"
2094         * but containing "${" and "}" for EL expressions)
2095     */

2096    public String JavaDoc getValue() {
2097        return value;
2098    }
2099
2100        /**
2101         * Only makes sense if namedAttribute is true.
2102         *
2103         * @return the nodes that evaluate to the body of this attribute.
2104         */

2105        public NamedAttribute getNamedAttributeNode() {
2106            return namedAttributeNode;
2107        }
2108
2109    /**
2110         * @return true if the value represents a traditional rtexprvalue
2111     */

2112    public boolean isExpression() {
2113        return expression;
2114    }
2115
2116        /**
2117         * @return true if the value represents a NamedAttribute value.
2118         */

2119        public boolean isNamedAttribute() {
2120            return namedAttribute;
2121        }
2122
2123        /**
2124         * @return true if the value represents an expression that should
2125         * be fed to the expression interpreter
2126         * @return false for string literals or rtexprvalues that should
2127         * not be interpreted or reevaluated
2128         */

2129        public boolean isELInterpreterInput() {
2130            return el != null;
2131        }
2132
2133    /**
2134     * @return true if the value is a string literal known at translation
2135     * time.
2136     */

2137    public boolean isLiteral() {
2138        return !expression && (el != null) && !namedAttribute;
2139    }
2140
2141    /**
2142     * XXX
2143     */

2144    public boolean isDynamic() {
2145        return dynamic;
2146    }
2147
2148    public ELNode.Nodes getEL() {
2149        return el;
2150    }
2151    }
2152
2153    /**
2154     * An ordered list of Node, used to represent the body of an element, or
2155     * a jsp page of jsp document.
2156     */

2157    public static class Nodes {
2158
2159    private List<Node> list;
2160    private Node.Root root; // null if this is not a page
2161

2162    public Nodes() {
2163        list = new Vector<Node>();
2164    }
2165
2166    public Nodes(List<Node> l) {
2167        list = l;
2168    }
2169
2170    public Nodes(Node.Root root) {
2171        this.root = root;
2172        list = new Vector<Node>();
2173        list.add(root);
2174    }
2175
2176    /**
2177     * Appends a node to the list
2178     * @param n The node to add
2179     */

2180    public void add(Node n) {
2181        list.add(n);
2182        root = null;
2183    }
2184
2185    /**
2186     * Removes the given node from the list.
2187     * @param n The node to be removed
2188     */

2189    public void remove(Node n) {
2190        list.remove(n);
2191    }
2192
2193    /**
2194     * Visit the nodes in the list with the supplied visitor
2195     * @param v The visitor used
2196     */

2197    public void visit(Visitor v) throws JspException JavaDoc {
2198            for (Node n : list) {
2199        n.accept(v);
2200        }
2201    }
2202
2203    public int size() {
2204        return list.size();
2205    }
2206
2207    public Node getNode(int index) {
2208        Node n = null;
2209        try {
2210        n = list.get(index);
2211        } catch (ArrayIndexOutOfBoundsException JavaDoc e) {
2212        }
2213        return n;
2214    }
2215    
2216    public Node.Root getRoot() {
2217        return root;
2218    }
2219        
2220        public String JavaDoc toString() {
2221            return DumpVisitor.dump(this);
2222        }
2223    }
2224
2225    /**
2226     * A visitor class for visiting the node. This class also provides the
2227     * default action (i.e. nop) for each of the child class of the Node.
2228     * An actual visitor should extend this class and supply the visit
2229     * method for the nodes that it cares.
2230     */

2231    public static class Visitor {
2232
2233    /**
2234     * This method provides a place to put actions that are common to
2235     * all nodes. Override this in the child visitor class if need to.
2236     */

2237    protected void doVisit(Node n) throws JspException JavaDoc {
2238    }
2239
2240    /**
2241     * Visit the body of a node, using the current visitor
2242     */

2243    protected void visitBody(Node n) throws JspException JavaDoc {
2244        if (n.getBody() != null) {
2245        n.getBody().visit(this);
2246        }
2247    }
2248
2249    public void visit(Root n) throws JspException JavaDoc {
2250        doVisit(n);
2251        visitBody(n);
2252    }
2253
2254    public void visit(JspRoot n) throws JspException JavaDoc {
2255        doVisit(n);
2256        visitBody(n);
2257    }
2258
2259    public void visit(PageDirective n) throws JspException JavaDoc {
2260        doVisit(n);
2261    }
2262
2263    public void visit(TagDirective n) throws JspException JavaDoc {
2264        doVisit(n);
2265    }
2266
2267    public void visit(IncludeDirective n) throws JspException JavaDoc {
2268        doVisit(n);
2269        visitBody(n);
2270    }
2271
2272    public void visit(TaglibDirective n) throws JspException JavaDoc {
2273        doVisit(n);
2274    }
2275
2276    public void visit(AttributeDirective n) throws JspException JavaDoc {
2277        doVisit(n);
2278    }
2279
2280    public void visit(VariableDirective n) throws JspException JavaDoc {
2281        doVisit(n);
2282    }
2283
2284    public void visit(Comment n) throws JspException JavaDoc {
2285        doVisit(n);
2286    }
2287
2288    public void visit(Declaration n) throws JspException JavaDoc {
2289        doVisit(n);
2290    }
2291
2292    public void visit(Expression n) throws JspException JavaDoc {
2293        doVisit(n);
2294    }
2295
2296    public void visit(Scriptlet n) throws JspException JavaDoc {
2297        doVisit(n);
2298    }
2299
2300        public void visit(ELExpression n) throws JspException JavaDoc {
2301            doVisit(n);
2302        }
2303
2304    public void visit(IncludeAction n) throws JspException JavaDoc {
2305        doVisit(n);
2306        visitBody(n);
2307    }
2308
2309    public void visit(ForwardAction n) throws JspException JavaDoc {
2310        doVisit(n);
2311        visitBody(n);
2312    }
2313
2314    public void visit(GetProperty n) throws JspException JavaDoc {
2315        doVisit(n);
2316        visitBody(n);
2317    }
2318
2319    public void visit(SetProperty n) throws JspException JavaDoc {
2320        doVisit(n);
2321        visitBody(n);
2322    }
2323
2324    public void visit(ParamAction n) throws JspException JavaDoc {
2325        doVisit(n);
2326        visitBody(n);
2327    }
2328
2329    public void visit(ParamsAction n) throws JspException JavaDoc {
2330        doVisit(n);
2331        visitBody(n);
2332    }
2333
2334    public void visit(FallBackAction n) throws JspException JavaDoc {
2335        doVisit(n);
2336        visitBody(n);
2337    }
2338
2339    public void visit(UseBean n) throws JspException JavaDoc {
2340        doVisit(n);
2341        visitBody(n);
2342    }
2343
2344    public void visit(PlugIn n) throws JspException JavaDoc {
2345        doVisit(n);
2346        visitBody(n);
2347    }
2348
2349    public void visit(CustomTag n) throws JspException JavaDoc {
2350        doVisit(n);
2351        visitBody(n);
2352    }
2353
2354    public void visit(UninterpretedTag n) throws JspException JavaDoc {
2355        doVisit(n);
2356        visitBody(n);
2357    }
2358
2359    public void visit(JspElement n) throws JspException JavaDoc {
2360        doVisit(n);
2361        visitBody(n);
2362    }
2363
2364    public void visit(JspText n) throws JspException JavaDoc {
2365        doVisit(n);
2366        visitBody(n);
2367    }
2368
2369        public void visit(NamedAttribute n) throws JspException JavaDoc {
2370            doVisit(n);
2371            visitBody(n);
2372        }
2373
2374        public void visit(JspBody n) throws JspException JavaDoc {
2375            doVisit(n);
2376            visitBody(n);
2377        }
2378
2379        public void visit(InvokeAction n) throws JspException JavaDoc {
2380            doVisit(n);
2381            visitBody(n);
2382        }
2383
2384        public void visit(DoBodyAction n) throws JspException JavaDoc {
2385            doVisit(n);
2386            visitBody(n);
2387        }
2388
2389    public void visit(TemplateText n) throws JspException JavaDoc {
2390        doVisit(n);
2391    }
2392
2393    public void visit(JspOutput n) throws JspException JavaDoc {
2394        doVisit(n);
2395    }
2396
2397    public void visit(AttributeGenerator n) throws JspException JavaDoc {
2398        doVisit(n);
2399    }
2400    }
2401}
2402
Popular Tags