KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jasper > compiler > Node


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 package org.apache.jasper.compiler;
19
20 import java.util.Iterator JavaDoc;
21 import java.util.List JavaDoc;
22 import java.util.Vector JavaDoc;
23 import java.util.ArrayList JavaDoc;
24
25 import javax.el.ELContext;
26 import javax.el.ELException;
27 import javax.el.ExpressionFactory;
28 import javax.el.ValueExpression;
29 import javax.servlet.jsp.tagext.BodyTag JavaDoc;
30 import javax.servlet.jsp.tagext.DynamicAttributes JavaDoc;
31 import javax.servlet.jsp.tagext.IterationTag JavaDoc;
32 import javax.servlet.jsp.tagext.JspIdConsumer JavaDoc;
33 import javax.servlet.jsp.tagext.SimpleTag JavaDoc;
34 import javax.servlet.jsp.tagext.TagAttributeInfo JavaDoc;
35 import javax.servlet.jsp.tagext.TagData JavaDoc;
36 import javax.servlet.jsp.tagext.TagFileInfo JavaDoc;
37 import javax.servlet.jsp.tagext.TagInfo JavaDoc;
38 import javax.servlet.jsp.tagext.TagVariableInfo JavaDoc;
39 import javax.servlet.jsp.tagext.TryCatchFinally JavaDoc;
40 import javax.servlet.jsp.tagext.VariableInfo JavaDoc;
41
42 import org.apache.jasper.JasperException;
43 import org.apache.jasper.compiler.tagplugin.TagPluginContext;
44 import org.xml.sax.Attributes JavaDoc;
45
46 /**
47  * An internal data representation of a JSP page or a JSP docuement (XML). Also
48  * included here is a visitor class for tranversing nodes.
49  *
50  * @author Kin-man Chung
51  * @author Jan Luehe
52  * @author Shawn Bayern
53  * @author Mark Roth
54  */

55
56 abstract class Node implements TagConstants {
57
58     private static final VariableInfo JavaDoc[] ZERO_VARIABLE_INFO = {};
59
60     protected Attributes JavaDoc attrs;
61
62     // xmlns attributes that represent tag libraries (only in XML syntax)
63
protected Attributes JavaDoc taglibAttrs;
64
65     /*
66      * xmlns attributes that do not represent tag libraries (only in XML syntax)
67      */

68     protected Attributes JavaDoc nonTaglibXmlnsAttrs;
69
70     protected Nodes body;
71
72     protected String JavaDoc text;
73
74     protected Mark startMark;
75
76     protected int beginJavaLine;
77
78     protected int endJavaLine;
79
80     protected Node parent;
81
82     protected Nodes namedAttributeNodes; // cached for performance
83

84     protected String JavaDoc qName;
85
86     protected String JavaDoc localName;
87
88     /*
89      * The name of the inner class to which the codes for this node and its body
90      * are generated. For instance, for <jsp:body> in foo.jsp, this is
91      * "foo_jspHelper". This is primarily used for communicating such info from
92      * Generator to Smap generator.
93      */

94     protected String JavaDoc innerClassName;
95
96     private boolean isDummy;
97
98     /**
99      * Zero-arg Constructor.
100      */

101     public Node() {
102         this.isDummy = true;
103     }
104
105     /**
106      * Constructor.
107      *
108      * @param start
109      * The location of the jsp page
110      * @param parent
111      * The enclosing node
112      */

113     public Node(Mark start, Node parent) {
114         this.startMark = start;
115         this.isDummy = (start == null);
116         addToParent(parent);
117     }
118
119     /**
120      * Constructor.
121      *
122      * @param qName
123      * The action's qualified name
124      * @param localName
125      * The action's local name
126      * @param start
127      * The location of the jsp page
128      * @param parent
129      * The enclosing node
130      */

131     public Node(String JavaDoc qName, String JavaDoc localName, Mark start, Node parent) {
132         this.qName = qName;
133         this.localName = localName;
134         this.startMark = start;
135         this.isDummy = (start == null);
136         addToParent(parent);
137     }
138
139     /**
140      * Constructor for Nodes parsed from standard syntax.
141      *
142      * @param qName
143      * The action's qualified name
144      * @param localName
145      * The action's local name
146      * @param attrs
147      * The attributes for this node
148      * @param start
149      * The location of the jsp page
150      * @param parent
151      * The enclosing node
152      */

153     public Node(String JavaDoc qName, String JavaDoc localName, Attributes JavaDoc attrs, Mark start,
154             Node parent) {
155         this.qName = qName;
156         this.localName = localName;
157         this.attrs = attrs;
158         this.startMark = start;
159         this.isDummy = (start == null);
160         addToParent(parent);
161     }
162
163     /**
164      * Constructor for Nodes parsed from XML syntax.
165      *
166      * @param qName
167      * The action's qualified name
168      * @param localName
169      * The action's local name
170      * @param attrs
171      * The action's attributes whose name does not start with xmlns
172      * @param nonTaglibXmlnsAttrs
173      * The action's xmlns attributes that do not represent tag
174      * libraries
175      * @param taglibAttrs
176      * The action's xmlns attributes that represent tag libraries
177      * @param start
178      * The location of the jsp page
179      * @param parent
180      * The enclosing node
181      */

182     public Node(String JavaDoc qName, String JavaDoc localName, Attributes JavaDoc attrs,
183             Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs, Mark start,
184             Node parent) {
185         this.qName = qName;
186         this.localName = localName;
187         this.attrs = attrs;
188         this.nonTaglibXmlnsAttrs = nonTaglibXmlnsAttrs;
189         this.taglibAttrs = taglibAttrs;
190         this.startMark = start;
191         this.isDummy = (start == null);
192         addToParent(parent);
193     }
194
195     /*
196      * Constructor.
197      *
198      * @param qName The action's qualified name @param localName The action's
199      * local name @param text The text associated with this node @param start
200      * The location of the jsp page @param parent The enclosing node
201      */

202     public Node(String JavaDoc qName, String JavaDoc localName, String JavaDoc text, Mark start,
203             Node parent) {
204         this.qName = qName;
205         this.localName = localName;
206         this.text = text;
207         this.startMark = start;
208         this.isDummy = (start == null);
209         addToParent(parent);
210     }
211
212     public String JavaDoc getQName() {
213         return this.qName;
214     }
215
216     public String JavaDoc getLocalName() {
217         return this.localName;
218     }
219
220     /*
221      * Gets this Node's attributes.
222      *
223      * In the case of a Node parsed from standard syntax, this method returns
224      * all the Node's attributes.
225      *
226      * In the case of a Node parsed from XML syntax, this method returns only
227      * those attributes whose name does not start with xmlns.
228      */

229     public Attributes JavaDoc getAttributes() {
230         return this.attrs;
231     }
232
233     /*
234      * Gets this Node's xmlns attributes that represent tag libraries (only
235      * meaningful for Nodes parsed from XML syntax)
236      */

237     public Attributes JavaDoc getTaglibAttributes() {
238         return this.taglibAttrs;
239     }
240
241     /*
242      * Gets this Node's xmlns attributes that do not represent tag libraries
243      * (only meaningful for Nodes parsed from XML syntax)
244      */

245     public Attributes JavaDoc getNonTaglibXmlnsAttributes() {
246         return this.nonTaglibXmlnsAttrs;
247     }
248
249     public void setAttributes(Attributes JavaDoc attrs) {
250         this.attrs = attrs;
251     }
252
253     public String JavaDoc getAttributeValue(String JavaDoc name) {
254         return (attrs == null) ? null : attrs.getValue(name);
255     }
256
257     /**
258      * Get the attribute that is non request time expression, either from the
259      * attribute of the node, or from a jsp:attrbute
260      */

261     public String JavaDoc getTextAttribute(String JavaDoc name) {
262
263         String JavaDoc attr = getAttributeValue(name);
264         if (attr != null) {
265             return attr;
266         }
267
268         NamedAttribute namedAttribute = getNamedAttributeNode(name);
269         if (namedAttribute == null) {
270             return null;
271         }
272
273         return namedAttribute.getText();
274     }
275
276     /**
277      * Searches all subnodes of this node for jsp:attribute standard actions
278      * with the given name, and returns the NamedAttribute node of the matching
279      * named attribute, nor null if no such node is found.
280      * <p>
281      * This should always be called and only be called for nodes that accept
282      * dynamic runtime attribute expressions.
283      */

284     public NamedAttribute getNamedAttributeNode(String JavaDoc name) {
285         NamedAttribute result = null;
286
287         // Look for the attribute in NamedAttribute children
288
Nodes nodes = getNamedAttributeNodes();
289         int numChildNodes = nodes.size();
290         for (int i = 0; i < numChildNodes; i++) {
291             NamedAttribute na = (NamedAttribute) nodes.getNode(i);
292             boolean found = false;
293             int index = name.indexOf(':');
294             if (index != -1) {
295                 // qualified name
296
found = na.getName().equals(name);
297             } else {
298                 found = na.getLocalName().equals(name);
299             }
300             if (found) {
301                 result = na;
302                 break;
303             }
304         }
305
306         return result;
307     }
308
309     /**
310      * Searches all subnodes of this node for jsp:attribute standard actions,
311      * and returns that set of nodes as a Node.Nodes object.
312      *
313      * @return Possibly empty Node.Nodes object containing any jsp:attribute
314      * subnodes of this Node
315      */

316     public Node.Nodes getNamedAttributeNodes() {
317
318         if (namedAttributeNodes != null) {
319             return namedAttributeNodes;
320         }
321
322         Node.Nodes result = new Node.Nodes();
323
324         // Look for the attribute in NamedAttribute children
325
Nodes nodes = getBody();
326         if (nodes != null) {
327             int numChildNodes = nodes.size();
328             for (int i = 0; i < numChildNodes; i++) {
329                 Node n = nodes.getNode(i);
330                 if (n instanceof NamedAttribute) {
331                     result.add(n);
332                 } else if (!(n instanceof Comment)) {
333                     // Nothing can come before jsp:attribute, and only
334
// jsp:body can come after it.
335
break;
336                 }
337             }
338         }
339
340         namedAttributeNodes = result;
341         return result;
342     }
343
344     public Nodes getBody() {
345         return body;
346     }
347
348     public void setBody(Nodes body) {
349         this.body = body;
350     }
351
352     public String JavaDoc getText() {
353         return text;
354     }
355
356     public Mark getStart() {
357         return startMark;
358     }
359
360     public Node getParent() {
361         return parent;
362     }
363
364     public int getBeginJavaLine() {
365         return beginJavaLine;
366     }
367
368     public void setBeginJavaLine(int begin) {
369         beginJavaLine = begin;
370     }
371
372     public int getEndJavaLine() {
373         return endJavaLine;
374     }
375
376     public void setEndJavaLine(int end) {
377         endJavaLine = end;
378     }
379
380     public boolean isDummy() {
381         return isDummy;
382     }
383
384     public Node.Root getRoot() {
385         Node n = this;
386         while (!(n instanceof Node.Root)) {
387             n = n.getParent();
388         }
389         return (Node.Root) n;
390     }
391
392     public String JavaDoc getInnerClassName() {
393         return innerClassName;
394     }
395
396     public void setInnerClassName(String JavaDoc icn) {
397         innerClassName = icn;
398     }
399
400     /**
401      * Selects and invokes a method in the visitor class based on the node type.
402      * This is abstract and should be overrode by the extending classes.
403      *
404      * @param v
405      * The visitor class
406      */

407     abstract void accept(Visitor v) throws JasperException;
408
409     // *********************************************************************
410
// Private utility methods
411

412     /*
413      * Adds this Node to the body of the given parent.
414      */

415     private void addToParent(Node parent) {
416         if (parent != null) {
417             this.parent = parent;
418             Nodes parentBody = parent.getBody();
419             if (parentBody == null) {
420                 parentBody = new Nodes();
421                 parent.setBody(parentBody);
422             }
423             parentBody.add(this);
424         }
425     }
426
427     /***************************************************************************
428      * Child classes
429      */

430
431     /**
432      * Represents the root of a Jsp page or Jsp document
433      */

434     public static class Root extends Node {
435
436         private Root parentRoot;
437
438         private boolean isXmlSyntax;
439
440         // Source encoding of the page containing this Root
441
private String JavaDoc pageEnc;
442
443         // Page encoding specified in JSP config element
444
private String JavaDoc jspConfigPageEnc;
445
446         /*
447          * Flag indicating if the default page encoding is being used (only
448          * applicable with standard syntax).
449          *
450          * True if the page does not provide a page directive with a
451          * 'contentType' attribute (or the 'contentType' attribute doesn't have
452          * a CHARSET value), the page does not provide a page directive with a
453          * 'pageEncoding' attribute, and there is no JSP configuration element
454          * page-encoding whose URL pattern matches the page.
455          */

456         private boolean isDefaultPageEncoding;
457
458         /*
459          * Indicates whether an encoding has been explicitly specified in the
460          * page's XML prolog (only used for pages in XML syntax). This
461          * information is used to decide whether a translation error must be
462          * reported for encoding conflicts.
463          */

464         private boolean isEncodingSpecifiedInProlog;
465
466         /*
467          * Indicates whether an encoding has been explicitly specified in the
468          * page's bom.
469          */

470         private boolean isBomPresent;
471
472         /*
473          * Constructor.
474          */

475         Root(Mark start, Node parent, boolean isXmlSyntax) {
476             super(start, parent);
477             this.isXmlSyntax = isXmlSyntax;
478             this.qName = JSP_ROOT_ACTION;
479             this.localName = ROOT_ACTION;
480
481             // Figure out and set the parent root
482
Node r = parent;
483             while ((r != null) && !(r instanceof Node.Root))
484                 r = r.getParent();
485             parentRoot = (Node.Root) r;
486         }
487
488         public void accept(Visitor v) throws JasperException {
489             v.visit(this);
490         }
491
492         public boolean isXmlSyntax() {
493             return isXmlSyntax;
494         }
495
496         /*
497          * Sets the encoding specified in the JSP config element whose URL
498          * pattern matches the page containing this Root.
499          */

500         public void setJspConfigPageEncoding(String JavaDoc enc) {
501             jspConfigPageEnc = enc;
502         }
503
504         /*
505          * Gets the encoding specified in the JSP config element whose URL
506          * pattern matches the page containing this Root.
507          */

508         public String JavaDoc getJspConfigPageEncoding() {
509             return jspConfigPageEnc;
510         }
511
512         public void setPageEncoding(String JavaDoc enc) {
513             pageEnc = enc;
514         }
515
516         public String JavaDoc getPageEncoding() {
517             return pageEnc;
518         }
519
520         public void setIsDefaultPageEncoding(boolean isDefault) {
521             isDefaultPageEncoding = isDefault;
522         }
523
524         public boolean isDefaultPageEncoding() {
525             return isDefaultPageEncoding;
526         }
527
528         public void setIsEncodingSpecifiedInProlog(boolean isSpecified) {
529             isEncodingSpecifiedInProlog = isSpecified;
530         }
531
532         public boolean isEncodingSpecifiedInProlog() {
533             return isEncodingSpecifiedInProlog;
534         }
535
536         public void setIsBomPresent(boolean isBom) {
537             isBomPresent = isBom;
538         }
539
540         public boolean isBomPresent() {
541             return isBomPresent;
542         }
543
544         /**
545          * @return The enclosing root to this Root. Usually represents the page
546          * that includes this one.
547          */

548         public Root getParentRoot() {
549             return parentRoot;
550         }
551     }
552
553     /**
554      * Represents the root of a Jsp document (XML syntax)
555      */

556     public static class JspRoot extends Node {
557
558         public JspRoot(String JavaDoc qName, Attributes JavaDoc attrs,
559                 Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
560                 Mark start, Node parent) {
561             super(qName, ROOT_ACTION, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
562                     start, parent);
563         }
564
565         public void accept(Visitor v) throws JasperException {
566             v.visit(this);
567         }
568     }
569
570     /**
571      * Represents a page directive
572      */

573     public static class PageDirective extends Node {
574
575         private Vector JavaDoc imports;
576
577         public PageDirective(Attributes JavaDoc attrs, Mark start, Node parent) {
578             this(JSP_PAGE_DIRECTIVE_ACTION, attrs, null, null, start, parent);
579         }
580
581         public PageDirective(String JavaDoc qName, Attributes JavaDoc attrs,
582                 Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
583                 Mark start, Node parent) {
584             super(qName, PAGE_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
585                     taglibAttrs, start, parent);
586             imports = new Vector JavaDoc();
587         }
588
589         public void accept(Visitor v) throws JasperException {
590             v.visit(this);
591         }
592
593         /**
594          * Parses the comma-separated list of class or package names in the
595          * given attribute value and adds each component to this PageDirective's
596          * vector of imported classes and packages.
597          *
598          * @param value
599          * A comma-separated string of imports.
600          */

601         public void addImport(String JavaDoc value) {
602             int start = 0;
603             int index;
604             while ((index = value.indexOf(',', start)) != -1) {
605                 imports.add(value.substring(start, index).trim());
606                 start = index + 1;
607             }
608             if (start == 0) {
609                 // No comma found
610
imports.add(value.trim());
611             } else {
612                 imports.add(value.substring(start).trim());
613             }
614         }
615
616         public List JavaDoc getImports() {
617             return imports;
618         }
619     }
620
621     /**
622      * Represents an include directive
623      */

624     public static class IncludeDirective extends Node {
625
626         public IncludeDirective(Attributes JavaDoc attrs, Mark start, Node parent) {
627             this(JSP_INCLUDE_DIRECTIVE_ACTION, attrs, null, null, start, parent);
628         }
629
630         public IncludeDirective(String JavaDoc qName, Attributes JavaDoc attrs,
631                 Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
632                 Mark start, Node parent) {
633             super(qName, INCLUDE_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
634                     taglibAttrs, start, parent);
635         }
636
637         public void accept(Visitor v) throws JasperException {
638             v.visit(this);
639         }
640     }
641
642     /**
643      * Represents a custom taglib directive
644      */

645     public static class TaglibDirective extends Node {
646
647         public TaglibDirective(Attributes JavaDoc attrs, Mark start, Node parent) {
648             super(JSP_TAGLIB_DIRECTIVE_ACTION, TAGLIB_DIRECTIVE_ACTION, attrs,
649                     start, parent);
650         }
651
652         public void accept(Visitor v) throws JasperException {
653             v.visit(this);
654         }
655     }
656
657     /**
658      * Represents a tag directive
659      */

660     public static class TagDirective extends Node {
661         private Vector JavaDoc imports;
662
663         public TagDirective(Attributes JavaDoc attrs, Mark start, Node parent) {
664             this(JSP_TAG_DIRECTIVE_ACTION, attrs, null, null, start, parent);
665         }
666
667         public TagDirective(String JavaDoc qName, Attributes JavaDoc attrs,
668                 Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
669                 Mark start, Node parent) {
670             super(qName, TAG_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
671                     taglibAttrs, start, parent);
672             imports = new Vector JavaDoc();
673         }
674
675         public void accept(Visitor v) throws JasperException {
676             v.visit(this);
677         }
678
679         /**
680          * Parses the comma-separated list of class or package names in the
681          * given attribute value and adds each component to this PageDirective's
682          * vector of imported classes and packages.
683          *
684          * @param value
685          * A comma-separated string of imports.
686          */

687         public void addImport(String JavaDoc value) {
688             int start = 0;
689             int index;
690             while ((index = value.indexOf(',', start)) != -1) {
691                 imports.add(value.substring(start, index).trim());
692                 start = index + 1;
693             }
694             if (start == 0) {
695                 // No comma found
696
imports.add(value.trim());
697             } else {
698                 imports.add(value.substring(start).trim());
699             }
700         }
701
702         public List JavaDoc getImports() {
703             return imports;
704         }
705     }
706
707     /**
708      * Represents an attribute directive
709      */

710     public static class AttributeDirective extends Node {
711
712         public AttributeDirective(Attributes JavaDoc attrs, Mark start, Node parent) {
713             this(JSP_ATTRIBUTE_DIRECTIVE_ACTION, attrs, null, null, start,
714                     parent);
715         }
716
717         public AttributeDirective(String JavaDoc qName, Attributes JavaDoc attrs,
718                 Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
719                 Mark start, Node parent) {
720             super(qName, ATTRIBUTE_DIRECTIVE_ACTION, attrs,
721                     nonTaglibXmlnsAttrs, taglibAttrs, start, parent);
722         }
723
724         public void accept(Visitor v) throws JasperException {
725             v.visit(this);
726         }
727     }
728
729     /**
730      * Represents a variable directive
731      */

732     public static class VariableDirective extends Node {
733
734         public VariableDirective(Attributes JavaDoc attrs, Mark start, Node parent) {
735             this(JSP_VARIABLE_DIRECTIVE_ACTION, attrs, null, null, start,
736                     parent);
737         }
738
739         public VariableDirective(String JavaDoc qName, Attributes JavaDoc attrs,
740                 Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
741                 Mark start, Node parent) {
742             super(qName, VARIABLE_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
743                     taglibAttrs, start, parent);
744         }
745
746         public void accept(Visitor v) throws JasperException {
747             v.visit(this);
748         }
749     }
750
751     /**
752      * Represents a <jsp:invoke> tag file action
753      */

754     public static class InvokeAction extends Node {
755
756         public InvokeAction(Attributes JavaDoc attrs, Mark start, Node parent) {
757             this(JSP_INVOKE_ACTION, attrs, null, null, start, parent);
758         }
759
760         public InvokeAction(String JavaDoc qName, Attributes JavaDoc attrs,
761                 Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
762                 Mark start, Node parent) {
763             super(qName, INVOKE_ACTION, attrs, nonTaglibXmlnsAttrs,
764                     taglibAttrs, start, parent);
765         }
766
767         public void accept(Visitor v) throws JasperException {
768             v.visit(this);
769         }
770     }
771
772     /**
773      * Represents a <jsp:doBody> tag file action
774      */

775     public static class DoBodyAction extends Node {
776
777         public DoBodyAction(Attributes JavaDoc attrs, Mark start, Node parent) {
778             this(JSP_DOBODY_ACTION, attrs, null, null, start, parent);
779         }
780
781         public DoBodyAction(String JavaDoc qName, Attributes JavaDoc attrs,
782                 Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
783                 Mark start, Node parent) {
784             super(qName, DOBODY_ACTION, attrs, nonTaglibXmlnsAttrs,
785                     taglibAttrs, start, parent);
786         }
787
788         public void accept(Visitor v) throws JasperException {
789             v.visit(this);
790         }
791     }
792
793     /**
794      * Represents a Jsp comment Comments are kept for completeness.
795      */

796     public static class Comment extends Node {
797
798         public Comment(String JavaDoc text, Mark start, Node parent) {
799             super(null, null, text, start, parent);
800         }
801
802         public void accept(Visitor v) throws JasperException {
803             v.visit(this);
804         }
805     }
806
807     /**
808      * Represents an expression, declaration, or scriptlet
809      */

810     public static abstract class ScriptingElement extends Node {
811
812         public ScriptingElement(String JavaDoc qName, String JavaDoc localName, String JavaDoc text,
813                 Mark start, Node parent) {
814             super(qName, localName, text, start, parent);
815         }
816
817         public ScriptingElement(String JavaDoc qName, String JavaDoc localName,
818                 Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
819                 Mark start, Node parent) {
820             super(qName, localName, null, nonTaglibXmlnsAttrs, taglibAttrs,
821                     start, parent);
822         }
823
824         /**
825          * When this node was created from a JSP page in JSP syntax, its text
826          * was stored as a String in the "text" field, whereas when this node
827          * was created from a JSP document, its text was stored as one or more
828          * TemplateText nodes in its body. This method handles either case.
829          *
830          * @return The text string
831          */

832         public String JavaDoc getText() {
833             String JavaDoc ret = text;
834             if ((ret == null) && (body != null)) {
835                 StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
836                 for (int i = 0; i < body.size(); i++) {
837                     buf.append(body.getNode(i).getText());
838                 }
839                 ret = buf.toString();
840             }
841             return ret;
842         }
843
844         /**
845          * For the same reason as above, the source line information in the
846          * contained TemplateText node should be used.
847          */

848         public Mark getStart() {
849             if (text == null && body != null && body.size() > 0) {
850                 return body.getNode(0).getStart();
851             } else {
852                 return super.getStart();
853             }
854         }
855     }
856
857     /**
858      * Represents a declaration
859      */

860     public static class Declaration extends ScriptingElement {
861
862         public Declaration(String JavaDoc text, Mark start, Node parent) {
863             super(JSP_DECLARATION_ACTION, DECLARATION_ACTION, text, start,
864                     parent);
865         }
866
867         public Declaration(String JavaDoc qName, Attributes JavaDoc nonTaglibXmlnsAttrs,
868                 Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
869             super(qName, DECLARATION_ACTION, nonTaglibXmlnsAttrs, taglibAttrs,
870                     start, parent);
871         }
872
873         public void accept(Visitor v) throws JasperException {
874             v.visit(this);
875         }
876     }
877
878     /**
879      * Represents an expression. Expressions in attributes are embedded in the
880      * attribute string and not here.
881      */

882     public static class Expression extends ScriptingElement {
883
884         public Expression(String JavaDoc text, Mark start, Node parent) {
885             super(JSP_EXPRESSION_ACTION, EXPRESSION_ACTION, text, start, parent);
886         }
887
888         public Expression(String JavaDoc qName, Attributes JavaDoc nonTaglibXmlnsAttrs,
889                 Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
890             super(qName, EXPRESSION_ACTION, nonTaglibXmlnsAttrs, taglibAttrs,
891                     start, parent);
892         }
893
894         public void accept(Visitor v) throws JasperException {
895             v.visit(this);
896         }
897     }
898
899     /**
900      * Represents a scriptlet
901      */

902     public static class Scriptlet extends ScriptingElement {
903
904         public Scriptlet(String JavaDoc text, Mark start, Node parent) {
905             super(JSP_SCRIPTLET_ACTION, SCRIPTLET_ACTION, text, start, parent);
906         }
907
908         public Scriptlet(String JavaDoc qName, Attributes JavaDoc nonTaglibXmlnsAttrs,
909                 Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
910             super(qName, SCRIPTLET_ACTION, nonTaglibXmlnsAttrs, taglibAttrs,
911                     start, parent);
912         }
913
914         public void accept(Visitor v) throws JasperException {
915             v.visit(this);
916         }
917     }
918
919     /**
920      * Represents an EL expression. Expressions in attributes are embedded in
921      * the attribute string and not here.
922      */

923     public static class ELExpression extends Node {
924
925         private ELNode.Nodes el;
926
927         private final char type;
928
929         public ELExpression(char type, String JavaDoc text, Mark start, Node parent) {
930             super(null, null, text, start, parent);
931             this.type = type;
932         }
933
934         public void accept(Visitor v) throws JasperException {
935             v.visit(this);
936         }
937
938         public void setEL(ELNode.Nodes el) {
939             this.el = el;
940         }
941
942         public ELNode.Nodes getEL() {
943             return el;
944         }
945
946         public char getType() {
947             return this.type;
948         }
949     }
950
951     /**
952      * Represents a param action
953      */

954     public static class ParamAction extends Node {
955
956         JspAttribute value;
957
958         public ParamAction(Attributes JavaDoc attrs, Mark start, Node parent) {
959             this(JSP_PARAM_ACTION, attrs, null, null, start, parent);
960         }
961
962         public ParamAction(String JavaDoc qName, Attributes JavaDoc attrs,
963                 Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
964                 Mark start, Node parent) {
965             super(qName, PARAM_ACTION, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
966                     start, parent);
967         }
968
969         public void accept(Visitor v) throws JasperException {
970             v.visit(this);
971         }
972
973         public void setValue(JspAttribute value) {
974             this.value = value;
975         }
976
977         public JspAttribute getValue() {
978             return value;
979         }
980     }
981
982     /**
983      * Represents a params action
984      */

985     public static class ParamsAction extends Node {
986
987         public ParamsAction(Mark start, Node parent) {
988             this(JSP_PARAMS_ACTION, null, null, start, parent);
989         }
990
991         public ParamsAction(String JavaDoc qName, Attributes JavaDoc nonTaglibXmlnsAttrs,
992                 Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
993             super(qName, PARAMS_ACTION, null, nonTaglibXmlnsAttrs, taglibAttrs,
994                     start, parent);
995         }
996
997         public void accept(Visitor v) throws JasperException {
998             v.visit(this);
999         }
1000    }
1001
1002    /**
1003     * Represents a fallback action
1004     */

1005    public static class FallBackAction extends Node {
1006
1007        public FallBackAction(Mark start, Node parent) {
1008            this(JSP_FALLBACK_ACTION, null, null, start, parent);
1009        }
1010
1011        public FallBackAction(String JavaDoc qName, Attributes JavaDoc nonTaglibXmlnsAttrs,
1012                Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
1013            super(qName, FALLBACK_ACTION, null, nonTaglibXmlnsAttrs,
1014                    taglibAttrs, start, parent);
1015        }
1016
1017        public void accept(Visitor v) throws JasperException {
1018            v.visit(this);
1019        }
1020    }
1021
1022    /**
1023     * Represents an include action
1024     */

1025    public static class IncludeAction extends Node {
1026
1027        private JspAttribute page;
1028
1029        public IncludeAction(Attributes JavaDoc attrs, Mark start, Node parent) {
1030            this(JSP_INCLUDE_ACTION, attrs, null, null, start, parent);
1031        }
1032
1033        public IncludeAction(String JavaDoc qName, Attributes JavaDoc attrs,
1034                Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
1035                Mark start, Node parent) {
1036            super(qName, INCLUDE_ACTION, attrs, nonTaglibXmlnsAttrs,
1037                    taglibAttrs, start, parent);
1038        }
1039
1040        public void accept(Visitor v) throws JasperException {
1041            v.visit(this);
1042        }
1043
1044        public void setPage(JspAttribute page) {
1045            this.page = page;
1046        }
1047
1048        public JspAttribute getPage() {
1049            return page;
1050        }
1051    }
1052
1053    /**
1054     * Represents a forward action
1055     */

1056    public static class ForwardAction extends Node {
1057
1058        private JspAttribute page;
1059
1060        public ForwardAction(Attributes JavaDoc attrs, Mark start, Node parent) {
1061            this(JSP_FORWARD_ACTION, attrs, null, null, start, parent);
1062        }
1063
1064        public ForwardAction(String JavaDoc qName, Attributes JavaDoc attrs,
1065                Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
1066                Mark start, Node parent) {
1067            super(qName, FORWARD_ACTION, attrs, nonTaglibXmlnsAttrs,
1068                    taglibAttrs, start, parent);
1069        }
1070
1071        public void accept(Visitor v) throws JasperException {
1072            v.visit(this);
1073        }
1074
1075        public void setPage(JspAttribute page) {
1076            this.page = page;
1077        }
1078
1079        public JspAttribute getPage() {
1080            return page;
1081        }
1082    }
1083
1084    /**
1085     * Represents a getProperty action
1086     */

1087    public static class GetProperty extends Node {
1088
1089        public GetProperty(Attributes JavaDoc attrs, Mark start, Node parent) {
1090            this(JSP_GET_PROPERTY_ACTION, attrs, null, null, start, parent);
1091        }
1092
1093        public GetProperty(String JavaDoc qName, Attributes JavaDoc attrs,
1094                Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
1095                Mark start, Node parent) {
1096            super(qName, GET_PROPERTY_ACTION, attrs, nonTaglibXmlnsAttrs,
1097                    taglibAttrs, start, parent);
1098        }
1099
1100        public void accept(Visitor v) throws JasperException {
1101            v.visit(this);
1102        }
1103    }
1104
1105    /**
1106     * Represents a setProperty action
1107     */

1108    public static class SetProperty extends Node {
1109
1110        private JspAttribute value;
1111
1112        public SetProperty(Attributes JavaDoc attrs, Mark start, Node parent) {
1113            this(JSP_SET_PROPERTY_ACTION, attrs, null, null, start, parent);
1114        }
1115
1116        public SetProperty(String JavaDoc qName, Attributes JavaDoc attrs,
1117                Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
1118                Mark start, Node parent) {
1119            super(qName, SET_PROPERTY_ACTION, attrs, nonTaglibXmlnsAttrs,
1120                    taglibAttrs, start, parent);
1121        }
1122
1123        public void accept(Visitor v) throws JasperException {
1124            v.visit(this);
1125        }
1126
1127        public void setValue(JspAttribute value) {
1128            this.value = value;
1129        }
1130
1131        public JspAttribute getValue() {
1132            return value;
1133        }
1134    }
1135
1136    /**
1137     * Represents a useBean action
1138     */

1139    public static class UseBean extends Node {
1140
1141        JspAttribute beanName;
1142
1143        public UseBean(Attributes JavaDoc attrs, Mark start, Node parent) {
1144            this(JSP_USE_BEAN_ACTION, attrs, null, null, start, parent);
1145        }
1146
1147        public UseBean(String JavaDoc qName, Attributes JavaDoc attrs,
1148                Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
1149                Mark start, Node parent) {
1150            super(qName, USE_BEAN_ACTION, attrs, nonTaglibXmlnsAttrs,
1151                    taglibAttrs, start, parent);
1152        }
1153
1154        public void accept(Visitor v) throws JasperException {
1155            v.visit(this);
1156        }
1157
1158        public void setBeanName(JspAttribute beanName) {
1159            this.beanName = beanName;
1160        }
1161
1162        public JspAttribute getBeanName() {
1163            return beanName;
1164        }
1165    }
1166
1167    /**
1168     * Represents a plugin action
1169     */

1170    public static class PlugIn extends Node {
1171
1172        private JspAttribute width;
1173
1174        private JspAttribute height;
1175
1176        public PlugIn(Attributes JavaDoc attrs, Mark start, Node parent) {
1177            this(JSP_PLUGIN_ACTION, attrs, null, null, start, parent);
1178        }
1179
1180        public PlugIn(String JavaDoc qName, Attributes JavaDoc attrs,
1181                Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
1182                Mark start, Node parent) {
1183            super(qName, PLUGIN_ACTION, attrs, nonTaglibXmlnsAttrs,
1184                    taglibAttrs, start, parent);
1185        }
1186
1187        public void accept(Visitor v) throws JasperException {
1188            v.visit(this);
1189        }
1190
1191        public void setHeight(JspAttribute height) {
1192            this.height = height;
1193        }
1194
1195        public void setWidth(JspAttribute width) {
1196            this.width = width;
1197        }
1198
1199        public JspAttribute getHeight() {
1200            return height;
1201        }
1202
1203        public JspAttribute getWidth() {
1204            return width;
1205        }
1206    }
1207
1208    /**
1209     * Represents an uninterpreted tag, from a Jsp document
1210     */

1211    public static class UninterpretedTag extends Node {
1212
1213        private JspAttribute[] jspAttrs;
1214
1215        public UninterpretedTag(String JavaDoc qName, String JavaDoc localName,
1216                Attributes JavaDoc attrs, Attributes JavaDoc nonTaglibXmlnsAttrs,
1217                Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
1218            super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
1219                    start, parent);
1220        }
1221
1222        public void accept(Visitor v) throws JasperException {
1223            v.visit(this);
1224        }
1225
1226        public void setJspAttributes(JspAttribute[] jspAttrs) {
1227            this.jspAttrs = jspAttrs;
1228        }
1229
1230        public JspAttribute[] getJspAttributes() {
1231            return jspAttrs;
1232        }
1233    }
1234
1235    /**
1236     * Represents a <jsp:element>.
1237     */

1238    public static class JspElement extends Node {
1239
1240        private JspAttribute[] jspAttrs;
1241
1242        private JspAttribute nameAttr;
1243
1244        public JspElement(Attributes JavaDoc attrs, Mark start, Node parent) {
1245            this(JSP_ELEMENT_ACTION, attrs, null, null, start, parent);
1246        }
1247
1248        public JspElement(String JavaDoc qName, Attributes JavaDoc attrs,
1249                Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
1250                Mark start, Node parent) {
1251            super(qName, ELEMENT_ACTION, attrs, nonTaglibXmlnsAttrs,
1252                    taglibAttrs, start, parent);
1253        }
1254
1255        public void accept(Visitor v) throws JasperException {
1256            v.visit(this);
1257        }
1258
1259        public void setJspAttributes(JspAttribute[] jspAttrs) {
1260            this.jspAttrs = jspAttrs;
1261        }
1262
1263        public JspAttribute[] getJspAttributes() {
1264            return jspAttrs;
1265        }
1266
1267        /*
1268         * Sets the XML-style 'name' attribute
1269         */

1270        public void setNameAttribute(JspAttribute nameAttr) {
1271            this.nameAttr = nameAttr;
1272        }
1273
1274        /*
1275         * Gets the XML-style 'name' attribute
1276         */

1277        public JspAttribute getNameAttribute() {
1278            return this.nameAttr;
1279        }
1280    }
1281
1282    /**
1283     * Represents a <jsp:output>.
1284     */

1285    public static class JspOutput extends Node {
1286
1287        public JspOutput(String JavaDoc qName, Attributes JavaDoc attrs,
1288                Attributes JavaDoc nonTaglibXmlnsAttrs, Attributes JavaDoc taglibAttrs,
1289                Mark start, Node parent) {
1290            super(qName, OUTPUT_ACTION, attrs, nonTaglibXmlnsAttrs,
1291                    taglibAttrs, start, parent);
1292        }
1293
1294        public void accept(Visitor v) throws JasperException {
1295            v.visit(this);
1296        }
1297    }
1298
1299    /**
1300     * Collected information about child elements. Used by nodes like CustomTag,
1301     * JspBody, and NamedAttribute. The information is set in the Collector.
1302     */

1303    public static class ChildInfo {
1304        private boolean scriptless; // true if the tag and its body
1305

1306        // contain no scripting elements.
1307
private boolean hasUseBean;
1308
1309        private boolean hasIncludeAction;
1310
1311        private boolean hasParamAction;
1312
1313        private boolean hasSetProperty;
1314
1315        private boolean hasScriptingVars;
1316
1317        public void setScriptless(boolean s) {
1318            scriptless = s;
1319        }
1320
1321        public boolean isScriptless() {
1322            return scriptless;
1323        }
1324
1325        public void setHasUseBean(boolean u) {
1326            hasUseBean = u;
1327        }
1328
1329        public boolean hasUseBean() {
1330            return hasUseBean;
1331        }
1332
1333        public void setHasIncludeAction(boolean i) {
1334            hasIncludeAction = i;
1335        }
1336
1337        public boolean hasIncludeAction() {
1338            return hasIncludeAction;
1339        }
1340
1341        public void setHasParamAction(boolean i) {
1342            hasParamAction = i;
1343        }
1344
1345        public boolean hasParamAction() {
1346            return hasParamAction;
1347        }
1348
1349        public void setHasSetProperty(boolean s) {
1350            hasSetProperty = s;
1351        }
1352
1353        public boolean hasSetProperty() {
1354            return hasSetProperty;
1355        }
1356
1357        public void setHasScriptingVars(boolean s) {
1358            hasScriptingVars = s;
1359        }
1360
1361        public boolean hasScriptingVars() {
1362            return hasScriptingVars;
1363        }
1364    }
1365
1366    /**
1367     * Represents a custom tag
1368     */

1369    public static class CustomTag extends Node {
1370
1371        private String JavaDoc uri;
1372
1373        private String JavaDoc prefix;
1374
1375        private JspAttribute[] jspAttrs;
1376
1377        private TagData JavaDoc tagData;
1378
1379        private String JavaDoc tagHandlerPoolName;
1380
1381        private TagInfo JavaDoc tagInfo;
1382
1383        private TagFileInfo JavaDoc tagFileInfo;
1384
1385        private Class JavaDoc tagHandlerClass;
1386
1387        private VariableInfo JavaDoc[] varInfos;
1388
1389        private int customNestingLevel;
1390
1391        private ChildInfo childInfo;
1392
1393        private boolean implementsIterationTag;
1394
1395        private boolean implementsBodyTag;
1396
1397        private boolean implementsTryCatchFinally;
1398
1399        private boolean implementsJspIdConsumer;
1400
1401        private boolean implementsSimpleTag;
1402
1403        private boolean implementsDynamicAttributes;
1404
1405        private Vector JavaDoc atBeginScriptingVars;
1406
1407        private Vector JavaDoc atEndScriptingVars;
1408
1409        private Vector JavaDoc nestedScriptingVars;
1410
1411        private Node.CustomTag customTagParent;
1412
1413        private Integer JavaDoc numCount;
1414
1415        private boolean useTagPlugin;
1416
1417        private TagPluginContext tagPluginContext;
1418
1419        /**
1420         * The following two fields are used for holding the Java scriptlets
1421         * that the tag plugins may generate. Meaningful only if useTagPlugin is
1422         * true; Could move them into TagPluginContextImpl, but we'll need to
1423         * cast tagPluginContext to TagPluginContextImpl all the time...
1424         */

1425        private Nodes atSTag;
1426
1427        private Nodes atETag;
1428
1429        /*
1430         * Constructor for custom action implemented by tag handler.
1431         */

1432        public CustomTag(String JavaDoc qName, String JavaDoc prefix, String JavaDoc localName,
1433                String JavaDoc uri, Attributes JavaDoc attrs, Mark start, Node parent,
1434                TagInfo JavaDoc tagInfo, Class JavaDoc tagHandlerClass) {
1435            this(qName, prefix, localName, uri, attrs, null, null, start,
1436                    parent, tagInfo, tagHandlerClass);
1437        }
1438
1439        /*
1440         * Constructor for custom action implemented by tag handler.
1441         */

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

1473        public CustomTag(String JavaDoc qName, String JavaDoc prefix, String JavaDoc localName,
1474                String JavaDoc uri, Attributes JavaDoc attrs, Mark start, Node parent,
1475                TagFileInfo JavaDoc tagFileInfo) {
1476            this(qName, prefix, localName, uri, attrs, null, null, start,
1477                    parent, tagFileInfo);
1478        }
1479
1480        /*
1481         * Constructor for custom action implemented by tag file.
1482         */

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

1513        public String JavaDoc getURI() {
1514            return this.uri;
1515        }
1516
1517        /**
1518         * @return The tag prefix
1519         */

1520        public String JavaDoc getPrefix() {
1521            return prefix;
1522        }
1523
1524        public void setJspAttributes(JspAttribute[] jspAttrs) {
1525            this.jspAttrs = jspAttrs;
1526        }
1527
1528        public TagAttributeInfo JavaDoc getTagAttributeInfo(String JavaDoc name) {
1529            TagInfo JavaDoc info = this.getTagInfo();
1530            if (info == null)
1531                return null;
1532            TagAttributeInfo JavaDoc[] tai = info.getAttributes();
1533            for (int i = 0; i < tai.length; i++) {
1534                if (tai[i].getName().equals(name)) {
1535                    return tai[i];
1536                }
1537            }
1538            return null;
1539        }
1540
1541        public JspAttribute[] getJspAttributes() {
1542            return jspAttrs;
1543        }
1544
1545        public ChildInfo getChildInfo() {
1546            return childInfo;
1547        }
1548
1549        public void setTagData(TagData JavaDoc tagData) {
1550            this.tagData = tagData;
1551            this.varInfos = tagInfo.getVariableInfo(tagData);
1552            if (this.varInfos == null) {
1553                this.varInfos = ZERO_VARIABLE_INFO;
1554            }
1555        }
1556
1557        public TagData JavaDoc getTagData() {
1558            return tagData;
1559        }
1560
1561        public void setTagHandlerPoolName(String JavaDoc s) {
1562            tagHandlerPoolName = s;
1563        }
1564
1565        public String JavaDoc getTagHandlerPoolName() {
1566            return tagHandlerPoolName;
1567        }
1568
1569        public TagInfo JavaDoc getTagInfo() {
1570            return tagInfo;
1571        }
1572
1573        public TagFileInfo JavaDoc getTagFileInfo() {
1574            return tagFileInfo;
1575        }
1576
1577        /*
1578         * @return true if this custom action is supported by a tag file, false
1579         * otherwise
1580         */

1581        public boolean isTagFile() {
1582            return tagFileInfo != null;
1583        }
1584
1585        public Class JavaDoc getTagHandlerClass() {
1586            return tagHandlerClass;
1587        }
1588
1589        public void setTagHandlerClass(Class JavaDoc hc) {
1590            tagHandlerClass = hc;
1591        }
1592
1593        public boolean implementsIterationTag() {
1594            return implementsIterationTag;
1595        }
1596
1597        public boolean implementsBodyTag() {
1598            return implementsBodyTag;
1599        }
1600
1601        public boolean implementsTryCatchFinally() {
1602            return implementsTryCatchFinally;
1603        }
1604
1605        public boolean implementsJspIdConsumer() {
1606            return implementsJspIdConsumer;
1607        }
1608
1609        public boolean implementsSimpleTag() {
1610            return implementsSimpleTag;
1611        }
1612
1613        public boolean implementsDynamicAttributes() {
1614            return implementsDynamicAttributes;
1615        }
1616
1617        public TagVariableInfo JavaDoc[] getTagVariableInfos() {
1618            return tagInfo.getTagVariableInfos();
1619        }
1620
1621        public VariableInfo JavaDoc[] getVariableInfos() {
1622            return varInfos;
1623        }
1624
1625        public void setCustomTagParent(Node.CustomTag n) {
1626            this.customTagParent = n;
1627        }
1628
1629        public Node.CustomTag getCustomTagParent() {
1630            return this.customTagParent;
1631        }
1632
1633        public void setNumCount(Integer JavaDoc count) {
1634            this.numCount = count;
1635        }
1636
1637        public Integer JavaDoc getNumCount() {
1638            return this.numCount;
1639        }
1640
1641        public void setScriptingVars(Vector JavaDoc vec, int scope) {
1642            switch (scope) {
1643            case VariableInfo.AT_BEGIN:
1644                this.atBeginScriptingVars = vec;
1645                break;
1646            case VariableInfo.AT_END:
1647                this.atEndScriptingVars = vec;
1648                break;
1649            case VariableInfo.NESTED:
1650                this.nestedScriptingVars = vec;
1651                break;
1652            }
1653        }
1654
1655        /*
1656         * Gets the scripting variables for the given scope that need to be
1657         * declared.
1658         */

1659        public Vector JavaDoc getScriptingVars(int scope) {
1660            Vector JavaDoc vec = null;
1661
1662            switch (scope) {
1663            case VariableInfo.AT_BEGIN:
1664                vec = this.atBeginScriptingVars;
1665                break;
1666            case VariableInfo.AT_END:
1667                vec = this.atEndScriptingVars;
1668                break;
1669            case VariableInfo.NESTED:
1670                vec = this.nestedScriptingVars;
1671                break;
1672            }
1673
1674            return vec;
1675        }
1676
1677        /*
1678         * Gets this custom tag's custom nesting level, which is given as the
1679         * number of times this custom tag is nested inside itself.
1680         */

1681        public int getCustomNestingLevel() {
1682            return customNestingLevel;
1683        }
1684
1685        /**
1686         * Checks to see if the attribute of the given name is of type
1687         * JspFragment.
1688         */

1689        public boolean checkIfAttributeIsJspFragment(String JavaDoc name) {
1690            boolean result = false;
1691
1692            TagAttributeInfo JavaDoc[] attributes = tagInfo.getAttributes();
1693            for (int i = 0; i < attributes.length; i++) {
1694                if (attributes[i].getName().equals(name)
1695                        && attributes[i].isFragment()) {
1696                    result = true;
1697                    break;
1698                }
1699            }
1700
1701            return result;
1702        }
1703
1704        public void setUseTagPlugin(boolean use) {
1705            useTagPlugin = use;
1706        }
1707
1708        public boolean useTagPlugin() {
1709            return useTagPlugin;
1710        }
1711
1712        public void setTagPluginContext(TagPluginContext tagPluginContext) {
1713            this.tagPluginContext = tagPluginContext;
1714        }
1715
1716        public TagPluginContext getTagPluginContext() {
1717            return tagPluginContext;
1718        }
1719
1720        public void setAtSTag(Nodes sTag) {
1721            atSTag = sTag;
1722        }
1723
1724        public Nodes getAtSTag() {
1725            return atSTag;
1726        }
1727
1728        public void setAtETag(Nodes eTag) {
1729            atETag = eTag;
1730        }
1731
1732        public Nodes getAtETag() {
1733            return atETag;
1734        }
1735
1736        /*
1737         * Computes this custom tag's custom nesting level, which corresponds to
1738         * the number of times this custom tag is nested inside itself.
1739         *
1740         * Example:
1741         *
1742         * <g:h> <a:b> -- nesting level 0 <c:d> <e:f> <a:b> -- nesting level 1
1743         * <a:b> -- nesting level 2 </a:b> </a:b> <a:b> -- nesting level 1
1744         * </a:b> </e:f> </c:d> </a:b> </g:h>
1745         *
1746         * @return Custom tag's nesting level
1747         */

1748        private int makeCustomNestingLevel() {
1749            int n = 0;
1750            Node p = parent;
1751            while (p != null) {
1752                if ((p instanceof Node.CustomTag)
1753                        && qName.equals(((Node.CustomTag) p).qName)) {
1754                    n++;
1755                }
1756                p = p.parent;
1757            }
1758            return n;
1759        }
1760
1761        /**
1762         * Returns true if this custom action has an empty body, and false
1763         * otherwise.
1764         *
1765         * A custom action is considered to have an empty body if the following
1766         * holds true: - getBody() returns null, or - all immediate children are
1767         * jsp:attribute actions, or - the action's jsp:body is empty.
1768         */

1769        public boolean hasEmptyBody() {
1770            boolean hasEmptyBody = true;
1771            Nodes nodes = getBody();
1772            if (nodes != null) {
1773                int numChildNodes = nodes.size();
1774                for (int i = 0; i < numChildNodes; i++) {
1775                    Node n = nodes.getNode(i);
1776                    if (!(n instanceof NamedAttribute)) {
1777                        if (n instanceof JspBody) {
1778                            hasEmptyBody = (n.getBody() == null);
1779                        } else {
1780                            hasEmptyBody = false;
1781                        }
1782                        break;
1783                    }
1784                }
1785            }
1786
1787            return hasEmptyBody;
1788        }
1789    }
1790
1791    /**
1792     * Used as a placeholder for the evaluation code of a custom action
1793     * attribute (used by the tag plugin machinery only).
1794     */

1795    public static class AttributeGenerator extends Node {
1796        String JavaDoc name; // name of the attribute
1797

1798        CustomTag tag; // The tag this attribute belongs to
1799

1800        public AttributeGenerator(Mark start, String JavaDoc name, CustomTag tag) {
1801            super(start, null);
1802            this.name = name;
1803            this.tag = tag;
1804        }
1805
1806        public void accept(Visitor v) throws JasperException {
1807            v.visit(this);
1808        }
1809
1810        public String JavaDoc getName() {
1811            return name;
1812        }
1813
1814        public CustomTag getTag() {
1815            return tag;
1816        }
1817    }
1818
1819    /**
1820     * Represents the body of a &lt;jsp:text&gt; element
1821     */

1822    public static class JspText extends Node {
1823
1824        public JspText(String JavaDoc qName, Attributes JavaDoc nonTaglibXmlnsAttrs,
1825                Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
1826            super(qName, TEXT_ACTION, null, nonTaglibXmlnsAttrs, taglibAttrs,
1827                    start, parent);
1828        }
1829
1830        public void accept(Visitor v) throws JasperException {
1831            v.visit(this);
1832        }
1833    }
1834
1835    /**
1836     * Represents a Named Attribute (&lt;jsp:attribute&gt;)
1837     */

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

1910        public String JavaDoc getTemporaryVariableName() {
1911            return temporaryVariableName;
1912        }
1913
1914        /*
1915         * Get the attribute value from this named attribute (<jsp:attribute>).
1916         * Since this method is only for attributes that are not rtexpr, we can
1917         * assume the body of the jsp:attribute is a template text.
1918         */

1919        public String JavaDoc getText() {
1920
1921            class AttributeVisitor extends Visitor {
1922                String JavaDoc attrValue = null;
1923
1924                public void visit(TemplateText txt) {
1925                    attrValue = new String JavaDoc(txt.getText());
1926                }
1927
1928                public String JavaDoc getAttrValue() {
1929                    return attrValue;
1930                }
1931            }
1932
1933            // According to JSP 2.0, if the body of the <jsp:attribute>
1934
// action is empty, it is equivalent of specifying "" as the value
1935
// of the attribute.
1936
String JavaDoc text = "";
1937            if (getBody() != null) {
1938                AttributeVisitor attributeVisitor = new AttributeVisitor();
1939                try {
1940                    getBody().visit(attributeVisitor);
1941                } catch (JasperException e) {
1942                }
1943                text = attributeVisitor.getAttrValue();
1944            }
1945
1946            return text;
1947        }
1948    }
1949
1950    /**
1951     * Represents a JspBody node (&lt;jsp:body&gt;)
1952     */

1953    public static class JspBody extends Node {
1954
1955        private ChildInfo childInfo;
1956
1957        public JspBody(Mark start, Node parent) {
1958            this(JSP_BODY_ACTION, null, null, start, parent);
1959        }
1960
1961        public JspBody(String JavaDoc qName, Attributes JavaDoc nonTaglibXmlnsAttrs,
1962                Attributes JavaDoc taglibAttrs, Mark start, Node parent) {
1963            super(qName, BODY_ACTION, null, nonTaglibXmlnsAttrs, taglibAttrs,
1964                    start, parent);
1965            this.childInfo = new ChildInfo();
1966        }
1967
1968        public void accept(Visitor v) throws JasperException {
1969            v.visit(this);
1970        }
1971
1972        public ChildInfo getChildInfo() {
1973            return childInfo;
1974        }
1975    }
1976
1977    /**
1978     * Represents a template text string
1979     */

1980    public static class TemplateText extends Node {
1981
1982        private ArrayList JavaDoc extraSmap = null;
1983
1984        public TemplateText(String JavaDoc text, Mark start, Node parent) {
1985            super(null, null, text, start, parent);
1986        }
1987
1988        public void accept(Visitor v) throws JasperException {
1989            v.visit(this);
1990        }
1991
1992        /**
1993         * Trim all whitespace from the left of the template text
1994         */

1995        public void ltrim() {
1996            int index = 0;
1997            while ((index < text.length()) && (text.charAt(index) <= ' ')) {
1998                index++;
1999            }
2000            text = text.substring(index);
2001        }
2002
2003        public void setText(String JavaDoc text) {
2004            this.text = text;
2005        }
2006
2007        /**
2008         * Trim all whitespace from the right of the template text
2009         */

2010        public void rtrim() {
2011            int index = text.length();
2012            while ((index > 0) && (text.charAt(index - 1) <= ' ')) {
2013                index--;
2014            }
2015            text = text.substring(0, index);
2016        }
2017
2018        /**
2019         * Returns true if this template text contains whitespace only.
2020         */

2021        public boolean isAllSpace() {
2022            boolean isAllSpace = true;
2023            for (int i = 0; i < text.length(); i++) {
2024                if (!Character.isWhitespace(text.charAt(i))) {
2025                    isAllSpace = false;
2026                    break;
2027                }
2028            }
2029            return isAllSpace;
2030        }
2031
2032        /**
2033         * Add a source to Java line mapping
2034         *
2035         * @param srcLine
2036         * The postion of the source line, relative to the line at
2037         * the start of this node. The corresponding java line is
2038         * assumed to be consecutive, i.e. one more than the last.
2039         */

2040        public void addSmap(int srcLine) {
2041            if (extraSmap == null) {
2042                extraSmap = new ArrayList JavaDoc();
2043            }
2044            extraSmap.add(new Integer JavaDoc(srcLine));
2045        }
2046
2047        public ArrayList JavaDoc getExtraSmap() {
2048            return extraSmap;
2049        }
2050    }
2051
2052    /***************************************************************************
2053     * Auxillary classes used in Node
2054     */

2055
2056    /**
2057     * Represents attributes that can be request time expressions.
2058     *
2059     * Can either be a plain attribute, an attribute that represents a request
2060     * time expression value, or a named attribute (specified using the
2061     * jsp:attribute standard action).
2062     */

2063
2064    public static class JspAttribute {
2065
2066        private String JavaDoc qName;
2067
2068        private String JavaDoc uri;
2069
2070        private String JavaDoc localName;
2071
2072        private String JavaDoc value;
2073
2074        private boolean expression;
2075
2076        private boolean dynamic;
2077
2078        private final ELNode.Nodes el;
2079
2080        private final TagAttributeInfo JavaDoc tai;
2081
2082        // If true, this JspAttribute represents a <jsp:attribute>
2083
private boolean namedAttribute;
2084
2085        // The node in the parse tree for the NamedAttribute
2086
private NamedAttribute namedAttributeNode;
2087
2088        JspAttribute(TagAttributeInfo JavaDoc tai, String JavaDoc qName, String JavaDoc uri,
2089                String JavaDoc localName, String JavaDoc value, boolean expr, ELNode.Nodes el,
2090                boolean dyn) {
2091            this.qName = qName;
2092            this.uri = uri;
2093            this.localName = localName;
2094            this.value = value;
2095            this.namedAttributeNode = null;
2096            this.expression = expr;
2097            this.el = el;
2098            this.dynamic = dyn;
2099            this.namedAttribute = false;
2100            this.tai = tai;
2101        }
2102
2103        /**
2104         * Allow node to validate itself
2105         *
2106         * @param ef
2107         * @param ctx
2108         * @throws ELException
2109         */

2110        public void validateEL(ExpressionFactory ef, ELContext ctx)
2111                throws ELException {
2112            if (this.el != null) {
2113                // determine exact type
2114
ValueExpression ve = ef.createValueExpression(ctx, this.value,
2115                        String JavaDoc.class);
2116            }
2117        }
2118
2119        /**
2120         * Use this constructor if the JspAttribute represents a named
2121         * attribute. In this case, we have to store the nodes of the body of
2122         * the attribute.
2123         */

2124        JspAttribute(NamedAttribute na, TagAttributeInfo JavaDoc tai, boolean dyn) {
2125            this.qName = na.getName();
2126            this.localName = na.getLocalName();
2127            this.value = null;
2128            this.namedAttributeNode = na;
2129            this.expression = false;
2130            this.el = null;
2131            this.dynamic = dyn;
2132            this.namedAttribute = true;
2133            this.tai = null;
2134        }
2135
2136        /**
2137         * @return The name of the attribute
2138         */

2139        public String JavaDoc getName() {
2140            return qName;
2141        }
2142
2143        /**
2144         * @return The local name of the attribute
2145         */

2146        public String JavaDoc getLocalName() {
2147            return localName;
2148        }
2149
2150        /**
2151         * @return The namespace of the attribute, or null if in the default
2152         * namespace
2153         */

2154        public String JavaDoc getURI() {
2155            return uri;
2156        }
2157
2158        public TagAttributeInfo JavaDoc getTagAttributeInfo() {
2159            return this.tai;
2160        }
2161
2162        /**
2163         *
2164         * @return return true if there's TagAttributeInfo meaning we need to
2165         * assign a ValueExpression
2166         */

2167        public boolean isDeferredInput() {
2168            return (this.tai != null) ? this.tai.isDeferredValue() : false;
2169        }
2170
2171        /**
2172         *
2173         * @return return true if there's TagAttributeInfo meaning we need to
2174         * assign a MethodExpression
2175         */

2176        public boolean isDeferredMethodInput() {
2177            return (this.tai != null) ? this.tai.isDeferredMethod() : false;
2178        }
2179
2180        public String JavaDoc getExpectedTypeName() {
2181            if (this.tai != null) {
2182                if (this.isDeferredInput()) {
2183                    return this.tai.getExpectedTypeName();
2184                } else if (this.isDeferredMethodInput()) {
2185                    String JavaDoc m = this.tai.getMethodSignature();
2186                    if (m != null) {
2187                        int rti = m.trim().indexOf(' ');
2188                        if (rti > 0) {
2189                            return m.substring(0, rti).trim();
2190                        }
2191                    }
2192                }
2193            }
2194            return "java.lang.Object";
2195        }
2196        
2197        public String JavaDoc[] getParameterTypeNames() {
2198            if (this.tai != null) {
2199                if (this.isDeferredMethodInput()) {
2200                    String JavaDoc m = this.tai.getMethodSignature();
2201                    if (m != null) {
2202                        m = m.trim();
2203                        m = m.substring(m.indexOf('(') + 1);
2204                        m = m.substring(0, m.length() - 1);
2205                        if (m.trim().length() > 0) {
2206                            String JavaDoc[] p = m.split(",");
2207                            for (int i = 0; i < p.length; i++) {
2208                                p[i] = p[i].trim();
2209                            }
2210                            return p;
2211                        }
2212                    }
2213                }
2214            }
2215            return new String JavaDoc[0];
2216        }
2217
2218        /**
2219         * Only makes sense if namedAttribute is false.
2220         *
2221         * @return the value for the attribute, or the expression string
2222         * (stripped of "<%=", "%>", "%=", or "%" but containing "${"
2223         * and "}" for EL expressions)
2224         */

2225        public String JavaDoc getValue() {
2226            return value;
2227        }
2228
2229        /**
2230         * Only makes sense if namedAttribute is true.
2231         *
2232         * @return the nodes that evaluate to the body of this attribute.
2233         */

2234        public NamedAttribute getNamedAttributeNode() {
2235            return namedAttributeNode;
2236        }
2237
2238        /**
2239         * @return true if the value represents a traditional rtexprvalue
2240         */

2241        public boolean isExpression() {
2242            return expression;
2243        }
2244
2245        /**
2246         * @return true if the value represents a NamedAttribute value.
2247         */

2248        public boolean isNamedAttribute() {
2249            return namedAttribute;
2250        }
2251
2252        /**
2253         * @return true if the value represents an expression that should be fed
2254         * to the expression interpreter
2255         * @return false for string literals or rtexprvalues that should not be
2256         * interpreted or reevaluated
2257         */

2258        public boolean isELInterpreterInput() {
2259            return el != null || this.isDeferredInput()
2260                    || this.isDeferredMethodInput();
2261        }
2262
2263        /**
2264         * @return true if the value is a string literal known at translation
2265         * time.
2266         */

2267        public boolean isLiteral() {
2268            return !expression && (el != null) && !namedAttribute;
2269        }
2270
2271        /**
2272         * XXX
2273         */

2274        public boolean isDynamic() {
2275            return dynamic;
2276        }
2277
2278        public ELNode.Nodes getEL() {
2279            return el;
2280        }
2281    }
2282
2283    /**
2284     * An ordered list of Node, used to represent the body of an element, or a
2285     * jsp page of jsp document.
2286     */

2287    public static class Nodes {
2288
2289        private List JavaDoc list;
2290
2291        private Node.Root root; // null if this is not a page
2292

2293        private boolean generatedInBuffer;
2294
2295        public Nodes() {
2296            list = new Vector JavaDoc();
2297        }
2298
2299        public Nodes(Node.Root root) {
2300            this.root = root;
2301            list = new Vector JavaDoc();
2302            list.add(root);
2303        }
2304
2305        /**
2306         * Appends a node to the list
2307         *
2308         * @param n
2309         * The node to add
2310         */

2311        public void add(Node n) {
2312            list.add(n);
2313            root = null;
2314        }
2315
2316        /**
2317         * Removes the given node from the list.
2318         *
2319         * @param n
2320         * The node to be removed
2321         */

2322        public void remove(Node n) {
2323            list.remove(n);
2324        }
2325
2326        /**
2327         * Visit the nodes in the list with the supplied visitor
2328         *
2329         * @param v
2330         * The visitor used
2331         */

2332        public void visit(Visitor v) throws JasperException {
2333            Iterator JavaDoc iter = list.iterator();
2334            while (iter.hasNext()) {
2335                Node n = (Node) iter.next();
2336                n.accept(v);
2337            }
2338        }
2339
2340        public int size() {
2341            return list.size();
2342        }
2343
2344        public Node getNode(int index) {
2345            Node n = null;
2346            try {
2347                n = (Node) list.get(index);
2348            } catch (ArrayIndexOutOfBoundsException JavaDoc e) {
2349            }
2350            return n;
2351        }
2352
2353        public Node.Root getRoot() {
2354            return root;
2355        }
2356
2357        public boolean isGeneratedInBuffer() {
2358            return generatedInBuffer;
2359        }
2360
2361        public void setGeneratedInBuffer(boolean g) {
2362            generatedInBuffer = g;
2363        }
2364    }
2365
2366    /**
2367     * A visitor class for visiting the node. This class also provides the
2368     * default action (i.e. nop) for each of the child class of the Node. An
2369     * actual visitor should extend this class and supply the visit method for
2370     * the nodes that it cares.
2371     */

2372    public static class Visitor {
2373
2374        /**
2375         * This method provides a place to put actions that are common to all
2376         * nodes. Override this in the child visitor class if need to.
2377         */

2378        protected void doVisit(Node n) throws JasperException {
2379        }
2380
2381        /**
2382         * Visit the body of a node, using the current visitor
2383         */

2384        protected void visitBody(Node n) throws JasperException {
2385            if (n.getBody() != null) {
2386                n.getBody().visit(this);
2387            }
2388        }
2389
2390        public void visit(Root n) throws JasperException {
2391            doVisit(n);
2392            visitBody(n);
2393        }
2394
2395        public void visit(JspRoot n) throws JasperException {
2396            doVisit(n);
2397            visitBody(n);
2398        }
2399
2400        public void visit(PageDirective n) throws JasperException {
2401            doVisit(n);
2402        }
2403
2404        public void visit(TagDirective n) throws JasperException {
2405            doVisit(n);
2406        }
2407
2408        public void visit(IncludeDirective n) throws JasperException {
2409            doVisit(n);
2410            visitBody(n);
2411        }
2412
2413        public void visit(TaglibDirective n) throws JasperException {
2414            doVisit(n);
2415        }
2416
2417        public void visit(AttributeDirective n) throws JasperException {
2418            doVisit(n);
2419        }
2420
2421        public void visit(VariableDirective n) throws JasperException {
2422            doVisit(n);
2423        }
2424
2425        public void visit(Comment n) throws JasperException {
2426            doVisit(n);
2427        }
2428
2429        public void visit(Declaration n) throws JasperException {
2430            doVisit(n);
2431        }
2432
2433        public void visit(Expression n) throws JasperException {
2434            doVisit(n);
2435        }
2436
2437        public void visit(Scriptlet n) throws JasperException {
2438            doVisit(n);
2439        }
2440
2441        public void visit(ELExpression n) throws JasperException {
2442            doVisit(n);
2443        }
2444
2445        public void visit(IncludeAction n) throws JasperException {
2446            doVisit(n);
2447            visitBody(n);
2448        }
2449
2450        public void visit(ForwardAction n) throws JasperException {
2451            doVisit(n);
2452            visitBody(n);
2453        }
2454
2455        public void visit(GetProperty n) throws JasperException {
2456            doVisit(n);
2457            visitBody(n);
2458        }
2459
2460        public void visit(SetProperty n) throws JasperException {
2461            doVisit(n);
2462            visitBody(n);
2463        }
2464
2465        public void visit(ParamAction n) throws JasperException {
2466            doVisit(n);
2467            visitBody(n);
2468        }
2469
2470        public void visit(ParamsAction n) throws JasperException {
2471            doVisit(n);
2472            visitBody(n);
2473        }
2474
2475        public void visit(FallBackAction n) throws JasperException {
2476            doVisit(n);
2477            visitBody(n);
2478        }
2479
2480        public void visit(UseBean n) throws JasperException {
2481            doVisit(n);
2482            visitBody(n);
2483        }
2484
2485        public void visit(PlugIn n) throws JasperException {
2486            doVisit(n);
2487            visitBody(n);
2488        }
2489
2490        public void visit(CustomTag n) throws JasperException {
2491            doVisit(n);
2492            visitBody(n);
2493        }
2494
2495        public void visit(UninterpretedTag n) throws JasperException {
2496            doVisit(n);
2497            visitBody(n);
2498        }
2499
2500        public void visit(JspElement n) throws JasperException {
2501            doVisit(n);
2502            visitBody(n);
2503        }
2504
2505        public void visit(JspText n) throws JasperException {
2506            doVisit(n);
2507            visitBody(n);
2508        }
2509
2510        public void visit(NamedAttribute n) throws JasperException {
2511            doVisit(n);
2512            visitBody(n);
2513        }
2514
2515        public void visit(JspBody n) throws JasperException {
2516            doVisit(n);
2517            visitBody(n);
2518        }
2519
2520        public void visit(InvokeAction n) throws JasperException {
2521            doVisit(n);
2522            visitBody(n);
2523        }
2524
2525        public void visit(DoBodyAction n) throws JasperException {
2526            doVisit(n);
2527            visitBody(n);
2528        }
2529
2530        public void visit(TemplateText n) throws JasperException {
2531            doVisit(n);
2532        }
2533
2534        public void visit(JspOutput n) throws JasperException {
2535            doVisit(n);
2536        }
2537
2538        public void visit(AttributeGenerator n) throws JasperException {
2539            doVisit(n);
2540        }
2541    }
2542}
2543
Popular Tags