MCPcopy Create free account
hub / github.com/apache/tomcat / CollectVisitor

Class CollectVisitor

java/org/apache/jasper/compiler/Collector.java:29–183  ·  view source on GitHub ↗

A visitor for collecting information on the page and the body of the custom tags.

Source from the content-addressed store, hash-verified

27 * A visitor for collecting information on the page and the body of the custom tags.
28 */
29 private static class CollectVisitor extends Node.Visitor {
30
31 private boolean scriptingElementSeen = false;
32 private boolean usebeanSeen = false;
33 private boolean includeActionSeen = false;
34 private boolean paramActionSeen = false;
35 private boolean setPropertySeen = false;
36 private boolean hasScriptingVars = false;
37
38 @Override
39 public void visit(Node.ParamAction n) throws JasperException {
40 if (n.getValue().isExpression()) {
41 scriptingElementSeen = true;
42 }
43 paramActionSeen = true;
44 }
45
46 @Override
47 public void visit(Node.IncludeAction n) throws JasperException {
48 if (n.getPage().isExpression()) {
49 scriptingElementSeen = true;
50 }
51 includeActionSeen = true;
52 visitBody(n);
53 }
54
55 @Override
56 public void visit(Node.ForwardAction n) throws JasperException {
57 if (n.getPage().isExpression()) {
58 scriptingElementSeen = true;
59 }
60 visitBody(n);
61 }
62
63 @Override
64 public void visit(Node.SetProperty n) throws JasperException {
65 if (n.getValue() != null && n.getValue().isExpression()) {
66 scriptingElementSeen = true;
67 }
68 setPropertySeen = true;
69 }
70
71 @Override
72 public void visit(Node.UseBean n) throws JasperException {
73 if (n.getBeanName() != null && n.getBeanName().isExpression()) {
74 scriptingElementSeen = true;
75 }
76 usebeanSeen = true;
77 visitBody(n);
78 }
79
80 @Override
81 public void visit(Node.CustomTag n) throws JasperException {
82 // Check to see what kinds of element we see as child elements
83 checkSeen(n.getChildInfo(), n);
84 }
85
86 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected