funkman 2004/09/09 07:26:53
Modified: jasper2/src/share/org/apache/jasper/compiler Collector.java
Generator.java PageInfo.java
Log:
- Remove maxTagNesting and curTagNesting since they are unused.
- Formatting.
- Fix the java.util.* import
Revision Changes Path
1.15 +116 -126
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Collector.java
Index: Collector.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Collector.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Collector.java 17 Mar 2004 19:23:03 -0000 1.14
+++ Collector.java 9 Sep 2004 14:26:52 -0000 1.15
@@ -1,12 +1,12 @@
/*
* Copyright 1999,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,97 +34,87 @@
*/
static class CollectVisitor extends Node.Visitor {
- private int maxTagNesting = 0;
- private int curTagNesting = 0;
- private boolean scriptingElementSeen = false;
- private boolean usebeanSeen = false;
- private boolean includeActionSeen = false;
- private boolean paramActionSeen = false;
- private boolean setPropertySeen = false;
- private boolean hasScriptingVars = false;
-
- public void visit(Node.ParamAction n) throws JasperException {
- if (n.getValue().isExpression()) {
- scriptingElementSeen = true;
- }
- paramActionSeen = true;
- }
-
- public void visit(Node.IncludeAction n) throws JasperException {
- if (n.getPage().isExpression()) {
- scriptingElementSeen = true;
- }
- includeActionSeen = true;
- visitBody(n);
- }
+ private boolean scriptingElementSeen = false;
+ private boolean usebeanSeen = false;
+ private boolean includeActionSeen = false;
+ private boolean paramActionSeen = false;
+ private boolean setPropertySeen = false;
+ private boolean hasScriptingVars = false;
+
+ public void visit(Node.ParamAction n) throws JasperException {
+ if (n.getValue().isExpression()) {
+ scriptingElementSeen = true;
+ }
+ paramActionSeen = true;
+ }
- public void visit(Node.ForwardAction n) throws JasperException {
- if (n.getPage().isExpression()) {
- scriptingElementSeen = true;
- }
+ public void visit(Node.IncludeAction n) throws JasperException {
+ if (n.getPage().isExpression()) {
+ scriptingElementSeen = true;
+ }
+ includeActionSeen = true;
visitBody(n);
- }
+ }
- public void visit(Node.SetProperty n) throws JasperException {
- if (n.getValue() != null && n.getValue().isExpression()) {
- scriptingElementSeen = true;
- }
- setPropertySeen = true;
- }
-
- public void visit(Node.UseBean n) throws JasperException {
- if (n.getBeanName() != null && n.getBeanName().isExpression()) {
- scriptingElementSeen = true;
- }
- usebeanSeen = true;
+ public void visit(Node.ForwardAction n) throws JasperException {
+ if (n.getPage().isExpression()) {
+ scriptingElementSeen = true;
+ }
visitBody(n);
- }
+ }
- public void visit(Node.PlugIn n) throws JasperException {
- if (n.getHeight() != null && n.getHeight().isExpression()) {
- scriptingElementSeen = true;
- }
- if (n.getWidth() != null && n.getWidth().isExpression()) {
- scriptingElementSeen = true;
- }
- visitBody(n);
- }
+ public void visit(Node.SetProperty n) throws JasperException {
+ if (n.getValue() != null && n.getValue().isExpression()) {
+ scriptingElementSeen = true;
+ }
+ setPropertySeen = true;
+ }
- public void visit(Node.CustomTag n) throws JasperException {
+ public void visit(Node.UseBean n) throws JasperException {
+ if (n.getBeanName() != null && n.getBeanName().isExpression()) {
+ scriptingElementSeen = true;
+ }
+ usebeanSeen = true;
+ visitBody(n);
+ }
- curTagNesting++;
- if (curTagNesting > maxTagNesting) {
- maxTagNesting = curTagNesting;
+ public void visit(Node.PlugIn n) throws JasperException {
+ if (n.getHeight() != null && n.getHeight().isExpression()) {
+ scriptingElementSeen = true;
+ }
+ if (n.getWidth() != null && n.getWidth().isExpression()) {
+ scriptingElementSeen = true;
}
-
+ visitBody(n);
+ }
+
+ public void visit(Node.CustomTag n) throws JasperException {
// Check to see what kinds of element we see as child elements
checkSeen( n.getChildInfo(), n );
-
- curTagNesting--;
}
/**
* Check all child nodes for various elements and update the given
* ChildInfo object accordingly. Visits body in the process.
*/
- private void checkSeen( Node.ChildInfo ci, Node n )
+ private void checkSeen( Node.ChildInfo ci, Node n )
throws JasperException
{
- // save values collected so far
- boolean scriptingElementSeenSave = scriptingElementSeen;
- scriptingElementSeen = false;
- boolean usebeanSeenSave = usebeanSeen;
- usebeanSeen = false;
- boolean includeActionSeenSave = includeActionSeen;
- includeActionSeen = false;
- boolean paramActionSeenSave = paramActionSeen;
- paramActionSeen = false;
- boolean setPropertySeenSave = setPropertySeen;
- setPropertySeen = false;
- boolean hasScriptingVarsSave = hasScriptingVars;
- hasScriptingVars = false;
+ // save values collected so far
+ boolean scriptingElementSeenSave = scriptingElementSeen;
+ scriptingElementSeen = false;
+ boolean usebeanSeenSave = usebeanSeen;
+ usebeanSeen = false;
+ boolean includeActionSeenSave = includeActionSeen;
+ includeActionSeen = false;
+ boolean paramActionSeenSave = paramActionSeen;
+ paramActionSeen = false;
+ boolean setPropertySeenSave = setPropertySeen;
+ setPropertySeen = false;
+ boolean hasScriptingVarsSave = hasScriptingVars;
+ hasScriptingVars = false;
- // Scan attribute list for expressions
+ // Scan attribute list for expressions
if( n instanceof Node.CustomTag ) {
Node.CustomTag ct = (Node.CustomTag)n;
Node.JspAttribute[] attrs = ct.getJspAttributes();
@@ -140,71 +130,71 @@
if( (n instanceof Node.CustomTag) && !hasScriptingVars) {
Node.CustomTag ct = (Node.CustomTag)n;
- hasScriptingVars = ct.getVariableInfos().length > 0 ||
- ct.getTagVariableInfos().length > 0;
- }
-
- // Record if the tag element and its body contains any scriptlet.
- ci.setScriptless(! scriptingElementSeen);
- ci.setHasUseBean(usebeanSeen);
- ci.setHasIncludeAction(includeActionSeen);
- ci.setHasParamAction(paramActionSeen);
- ci.setHasSetProperty(setPropertySeen);
- ci.setHasScriptingVars(hasScriptingVars);
-
- // Propagate value of scriptingElementSeen up.
- scriptingElementSeen = scriptingElementSeen || scriptingElementSeenSave;
- usebeanSeen = usebeanSeen || usebeanSeenSave;
- setPropertySeen = setPropertySeen || setPropertySeenSave;
- includeActionSeen = includeActionSeen || includeActionSeenSave;
- paramActionSeen = paramActionSeen || paramActionSeenSave;
- hasScriptingVars = hasScriptingVars || hasScriptingVarsSave;
- }
-
- public void visit(Node.JspElement n) throws JasperException {
- if (n.getNameAttribute().isExpression())
- scriptingElementSeen = true;
-
- Node.JspAttribute[] attrs = n.getJspAttributes();
- for (int i = 0; i < attrs.length; i++) {
- if (attrs[i].isExpression()) {
- scriptingElementSeen = true;
- break;
- }
- }
- visitBody(n);
- }
+ hasScriptingVars = ct.getVariableInfos().length > 0 ||
+ ct.getTagVariableInfos().length > 0;
+ }
+
+ // Record if the tag element and its body contains any scriptlet.
+ ci.setScriptless(! scriptingElementSeen);
+ ci.setHasUseBean(usebeanSeen);
+ ci.setHasIncludeAction(includeActionSeen);
+ ci.setHasParamAction(paramActionSeen);
+ ci.setHasSetProperty(setPropertySeen);
+ ci.setHasScriptingVars(hasScriptingVars);
+
+ // Propagate value of scriptingElementSeen up.
+ scriptingElementSeen = scriptingElementSeen || scriptingElementSeenSave;
+ usebeanSeen = usebeanSeen || usebeanSeenSave;
+ setPropertySeen = setPropertySeen || setPropertySeenSave;
+ includeActionSeen = includeActionSeen || includeActionSeenSave;
+ paramActionSeen = paramActionSeen || paramActionSeenSave;
+ hasScriptingVars = hasScriptingVars || hasScriptingVarsSave;
+ }
+
+ public void visit(Node.JspElement n) throws JasperException {
+ if (n.getNameAttribute().isExpression())
+ scriptingElementSeen = true;
+
+ Node.JspAttribute[] attrs = n.getJspAttributes();
+ for (int i = 0; i < attrs.length; i++) {
+ if (attrs[i].isExpression()) {
+ scriptingElementSeen = true;
+ break;
+ }
+ }
+ visitBody(n);
+ }
public void visit(Node.JspBody n) throws JasperException {
checkSeen( n.getChildInfo(), n );
}
-
+
public void visit(Node.NamedAttribute n) throws JasperException {
checkSeen( n.getChildInfo(), n );
}
-
- public void visit(Node.Declaration n) throws JasperException {
- scriptingElementSeen = true;
- }
-
- public void visit(Node.Expression n) throws JasperException {
- scriptingElementSeen = true;
- }
-
- public void visit(Node.Scriptlet n) throws JasperException {
- scriptingElementSeen = true;
- }
+
+ public void visit(Node.Declaration n) throws JasperException {
+ scriptingElementSeen = true;
+ }
+
+ public void visit(Node.Expression n) throws JasperException {
+ scriptingElementSeen = true;
+ }
+
+ public void visit(Node.Scriptlet n) throws JasperException {
+ scriptingElementSeen = true;
+ }
public void updatePageInfo(PageInfo pageInfo) {
- pageInfo.setMaxTagNesting(maxTagNesting);
- pageInfo.setScriptless(! scriptingElementSeen);
+ pageInfo.setScriptless(! scriptingElementSeen);
}
}
+
public static void collect(Compiler compiler, Node.Nodes page)
- throws JasperException {
+ throws JasperException {
- CollectVisitor collectVisitor = new CollectVisitor();
+ CollectVisitor collectVisitor = new CollectVisitor();
page.visit(collectVisitor);
collectVisitor.updatePageInfo(compiler.getPageInfo());
1.237 +21 -29
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
Index: Generator.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
retrieving revision 1.236
retrieving revision 1.237
diff -u -r1.236 -r1.237
--- Generator.java 26 Jul 2004 20:50:35 -0000 1.236
+++ Generator.java 9 Sep 2004 14:26:53 -0000 1.237
@@ -1,12 +1,12 @@
/*
* Copyright 1999,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -72,7 +72,6 @@
private boolean isPoolingEnabled;
private boolean breakAtLF;
private PageInfo pageInfo;
- private int maxTagNesting;
private Vector tagHandlerPoolNames;
private GenBuffer charArrayBuffer;
@@ -526,7 +525,7 @@
genPreambleClassVariableDeclarations(servletClassName);
// Constructor
- // generateConstructor(className);
+ // generateConstructor(className);
// Methods here
genPreambleMethods();
@@ -563,9 +562,6 @@
out.printil("JspWriter out = null;");
out.printil("Object page = this;");
- // Number of tag object that need to be popped
- // XXX TODO: use a better criteria
- maxTagNesting = pageInfo.getMaxTagNesting();
out.printil("JspWriter _jspx_out = null;");
out.printil("PageContext _jspx_page_context = null;");
out.println();
@@ -679,7 +675,7 @@
* <key>: tag prefix
* <value>: hashtable containing introspection on tag handlers:
* <key>: tag short name
- * <value>: introspection info of tag handler for
+ * <value>: introspection info of tag handler for
* <prefix:shortName> tag
*/
private Hashtable handlerInfos;
@@ -907,7 +903,7 @@
/**
* Scans through all child nodes of the given parent for
* <param> subelements. For each <param> element, if its value
- * is specified via a Named Attribute (<jsp:attribute>),
+ * is specified via a Named Attribute (<jsp:attribute>),
* generate the code to evaluate those bodies first.
* <p>
* If parent is null, simply returns.
@@ -1146,7 +1142,7 @@
String type = n.getTextAttribute("type");
Node.JspAttribute beanName = n.getBeanName();
- if (type == null) // if unspecified, use class as type of bean
+ if (type == null) // if unspecified, use class as type of bean
type = klass;
String scopename = "PageContext.PAGE_SCOPE"; // Default to page
@@ -1344,7 +1340,7 @@
// Double check that this is now the correct behavior.
if (ie) {
// We want something of the form
- // out.println( "<PARAM name=\"blah\"
+ // out.println( "<PARAM name=\"blah\"
// value=\"" + ... + "\">" );
out.printil(
"out.write( \"<PARAM name=\\\""
@@ -1434,12 +1430,12 @@
}
}
- // XXX - Fixed a bug here - width and height can be set
+ // XXX - Fixed a bug here - width and height can be set
// dynamically. Double-check if this generation is correct.
// IE style plugin
// <OBJECT ...>
- // First compose the runtime output string
+ // First compose the runtime output string
String s0 = "<OBJECT"
+ makeAttr("classid", ctxt.getOptions().getIeClassId())
+ makeAttr("name", name);
@@ -1920,7 +1916,7 @@
StringBuffer sb = new StringBuffer("out.write(\"");
int initLength = sb.length();
int count = JspUtil.CHUNKSIZE;
- int srcLine = 0; // relative to starting srouce line
+ int srcLine = 0; // relative to starting srouce line
for (int i = 0; i < text.length(); i++) {
char ch = text.charAt(i);
--count;
@@ -2447,7 +2443,7 @@
* This method is called as part of the custom tag's start element.
*
* If the given custom tag has a custom nesting level greater than 0,
- * save the current values of its scripting variables to
+ * save the current values of its scripting variables to
* temporary variables, so those values may be restored in the tag's
* end element. This way, the scripting variables may be synchronized
* by the given tag without affecting their original values.
@@ -2773,7 +2769,7 @@
// Set context
if (simpleTag) {
- // Generate alias map
+ // Generate alias map
String aliasMapVar = null;
if (n.isTagFile()) {
aliasMapVar = generateAliasMap(n, tagHandlerVar);
@@ -2967,7 +2963,7 @@
throws JasperException {
// XXX - A possible optimization here would be to check to see
// if the only child of the parent node is TemplateText. If so,
- // we know there won't be any parameters, etc, so we can
+ // we know there won't be any parameters, etc, so we can
// generate a low-overhead JspFragment that just echoes its
// body. The implementation of this fragment can come from
// the org.apache.jasper.runtime package as a support class.
@@ -3075,7 +3071,7 @@
* @param n The parent node of the named attribute
* @param tagHandlerVar The variable the tag handler is stored in,
* so the fragment knows its parent tag.
- * @return The name of the temporary variable the fragment
+ * @return The name of the temporary variable the fragment
* is stored in.
*/
public String generateNamedAttributeJspFragment(
@@ -3106,7 +3102,7 @@
// Cannot access err since this method is static, but at
// least flag an error.
throw new JasperException("Unexpected Node Type");
- //err.getString(
+ //err.getString(
// "jsp.error.internal.unexpected_node_type" ) );
}
@@ -3361,11 +3357,11 @@
* According to the spec, 'pageContext' must not be made available as
* an implicit object in tag files.
* Declare _jspx_page_context, so we can share the code generator with
- * JSPs.
+ * JSPs.
*/
out.printil("PageContext _jspx_page_context = (PageContext)jspContext;");
- // Declare implicit objects.
+ // Declare implicit objects.
out.printil(
"HttpServletRequest request = "
+ "(HttpServletRequest) _jspx_page_context.getRequest();");
@@ -3382,10 +3378,6 @@
}
generatePageScopedVariables(tagInfo);
- // Number of tag object that need to be popped
- // XXX TODO: use a better criteria
- maxTagNesting = pageInfo.getMaxTagNesting();
-
declareTemporaryScriptingVars(tag);
out.println();
@@ -3504,7 +3496,7 @@
/*
* Generate setter for JspContext so we can create a wrapper and
* store both the original and the wrapper. We need the wrapper
- * to mask the page context from the tag file and simulate a
+ * to mask the page context from the tag file and simulate a
* fresh page context. We need the original to do things like
* sync AT_BEGIN and AT_END scripting variables.
*/
@@ -3598,7 +3590,7 @@
out.printil(
"public void setDynamicAttribute(String uri, String localName, Object
value) throws JspException {");
out.pushIndent();
- /*
+ /*
* According to the spec, only dynamic attributes with no uri are to
* be present in the Map; all other dynamic attributes are ignored.
*/
@@ -3738,7 +3730,7 @@
* For a CustomTag, the codes that are generated at the beginning of
* the tag may not be in the same buffer as those for the body of the
* tag. Two fields are used here to keep this straight. For codes
- * that do not corresponds to any JSP lines, they should be null.
+ * that do not corresponds to any JSP lines, they should be null.
*/
private Node node;
private Node.Nodes body;
1.43 +184 -188
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageInfo.java
Index: PageInfo.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageInfo.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- PageInfo.java 13 Jul 2004 22:47:23 -0000 1.42
+++ PageInfo.java 9 Sep 2004 14:26:53 -0000 1.43
@@ -1,12 +1,12 @@
/*
* Copyright 1999,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,12 @@
*/
package org.apache.jasper.compiler;
-import java.util.*;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Vector;
import org.apache.jasper.Constants;
import org.apache.jasper.JasperException;
@@ -46,7 +51,7 @@
private String session;
private boolean isSession = true;
private String bufferValue;
- private int buffer = 8*1024; // XXX confirm
+ private int buffer = 8*1024; // XXX confirm
private String autoFlush;
private boolean isAutoFlush = true;
private String isThreadSafeValue;
@@ -56,7 +61,6 @@
private String errorPage = null;
private String info;
- private int maxTagNesting = 0;
private boolean scriptless = false;
private boolean scriptingInvalid = false;
private String isELIgnoredValue;
@@ -74,27 +78,27 @@
private boolean hasJspRoot = false;
private Vector includePrelude;
private Vector includeCoda;
- private Vector pluginDcls; // Id's for tagplugin declarations
+ private Vector pluginDcls; // Id's for tagplugin declarations
PageInfo(BeanRepository beanRepository, String jspFile) {
this.jspFile = jspFile;
- this.beanRepository = beanRepository;
- this.taglibsMap = new HashMap();
- this.jspPrefixMapper = new HashMap();
- this.xmlPrefixMapper = new HashMap();
+ this.beanRepository = beanRepository;
+ this.taglibsMap = new HashMap();
+ this.jspPrefixMapper = new HashMap();
+ this.xmlPrefixMapper = new HashMap();
this.nonCustomTagPrefixMap = new HashMap();
- this.imports = new Vector();
+ this.imports = new Vector();
this.dependants = new Vector();
- this.includePrelude = new Vector();
- this.includeCoda = new Vector();
- this.pluginDcls = new Vector();
- this.prefixes = new HashSet();
-
- // Enter standard imports
- for(int i = 0; i < Constants.STANDARD_IMPORTS.length; i++)
- imports.add(Constants.STANDARD_IMPORTS[i]);
+ this.includePrelude = new Vector();
+ this.includeCoda = new Vector();
+ this.pluginDcls = new Vector();
+ this.prefixes = new HashSet();
+
+ // Enter standard imports
+ for(int i = 0; i < Constants.STANDARD_IMPORTS.length; i++)
+ imports.add(Constants.STANDARD_IMPORTS[i]);
}
/**
@@ -103,22 +107,22 @@
* @return true if Id has been declared.
*/
public boolean isPluginDeclared(String id) {
- if (pluginDcls.contains(id))
- return true;
- pluginDcls.add(id);
- return false;
+ if (pluginDcls.contains(id))
+ return true;
+ pluginDcls.add(id);
+ return false;
}
public void addImports(List imports) {
- this.imports.addAll(imports);
+ this.imports.addAll(imports);
}
public void addImport(String imp) {
- this.imports.add(imp);
+ this.imports.add(imp);
}
public List getImports() {
- return imports;
+ return imports;
}
public String getJspFile() {
@@ -126,115 +130,107 @@
}
public void addDependant(String d) {
- if (!dependants.contains(d) && !jspFile.equals(d))
- dependants.add(d);
+ if (!dependants.contains(d) && !jspFile.equals(d))
+ dependants.add(d);
}
-
+
public List getDependants() {
return dependants;
}
public BeanRepository getBeanRepository() {
- return beanRepository;
- }
-
- public int getMaxTagNesting() {
- return maxTagNesting;
- }
-
- public void setMaxTagNesting(int maxTagNesting) {
- this.maxTagNesting = maxTagNesting;
+ return beanRepository;
}
public void setScriptless(boolean s) {
- scriptless = s;
+ scriptless = s;
}
public boolean isScriptless() {
- return scriptless;
+ return scriptless;
}
public void setScriptingInvalid(boolean s) {
- scriptingInvalid = s;
+ scriptingInvalid = s;
}
public boolean isScriptingInvalid() {
- return scriptingInvalid;
+ return scriptingInvalid;
}
public List getIncludePrelude() {
- return includePrelude;
+ return includePrelude;
}
public void setIncludePrelude(Vector prelude) {
- includePrelude = prelude;
+ includePrelude = prelude;
}
public List getIncludeCoda() {
- return includeCoda;
+ return includeCoda;
}
public void setIncludeCoda(Vector coda) {
- includeCoda = coda;
+ includeCoda = coda;
}
public void setHasJspRoot(boolean s) {
- hasJspRoot = s;
+ hasJspRoot = s;
}
public boolean hasJspRoot() {
- return hasJspRoot;
+ return hasJspRoot;
}
public String getOmitXmlDecl() {
- return omitXmlDecl;
+ return omitXmlDecl;
}
public void setOmitXmlDecl(String omit) {
- omitXmlDecl = omit;
+ omitXmlDecl = omit;
}
public String getDoctypeName() {
- return doctypeName;
+ return doctypeName;
}
public void setDoctypeName(String doctypeName) {
- this.doctypeName = doctypeName;
+ this.doctypeName = doctypeName;
}
public String getDoctypeSystem() {
- return doctypeSystem;
+ return doctypeSystem;
}
public void setDoctypeSystem(String doctypeSystem) {
- this.doctypeSystem = doctypeSystem;
+ this.doctypeSystem = doctypeSystem;
}
public String getDoctypePublic() {
- return doctypePublic;
+ return doctypePublic;
}
public void setDoctypePublic(String doctypePublic) {
- this.doctypePublic = doctypePublic;
+ this.doctypePublic = doctypePublic;
}
/* Tag library and XML namespace management methods */
public void setIsJspPrefixHijacked(boolean isHijacked) {
- isJspPrefixHijacked = isHijacked;
+ isJspPrefixHijacked = isHijacked;
}
public boolean isJspPrefixHijacked() {
- return isJspPrefixHijacked;
+ return isJspPrefixHijacked;
}
/*
* Adds the given prefix to the set of prefixes of this translation unit.
- *
+ *
* @param prefix The prefix to add
*/
public void addPrefix(String prefix) {
- prefixes.add(prefix);
+ prefixes.add(prefix);
}
/*
@@ -246,7 +242,7 @@
* otherwise
*/
public boolean containsPrefix(String prefix) {
- return prefixes.contains(prefix);
+ return prefixes.contains(prefix);
}
/*
@@ -256,7 +252,7 @@
* @param info The tag library to be associated with the given URI
*/
public void addTaglib(String uri, TagLibraryInfo info) {
- taglibsMap.put(uri, info);
+ taglibsMap.put(uri, info);
}
/*
@@ -265,7 +261,7 @@
* @return Tag library corresponding to the given URI
*/
public TagLibraryInfo getTaglib(String uri) {
- return (TagLibraryInfo) taglibsMap.get(uri);
+ return (TagLibraryInfo) taglibsMap.get(uri);
}
/*
@@ -274,7 +270,7 @@
* @return Collection of tag libraries that are associated with a URI
*/
public Collection getTaglibs() {
- return taglibsMap.values();
+ return taglibsMap.values();
}
/*
@@ -286,7 +282,7 @@
* otherwise
*/
public boolean hasTaglib(String uri) {
- return taglibsMap.containsKey(uri);
+ return taglibsMap.containsKey(uri);
}
/*
@@ -296,7 +292,7 @@
* @param uri The URI to be associated with the given prefix
*/
public void addPrefixMapping(String prefix, String uri) {
- jspPrefixMapper.put(prefix, uri);
+ jspPrefixMapper.put(prefix, uri);
}
/*
@@ -307,26 +303,26 @@
* @param uri The URI to be pushed onto the stack
*/
public void pushPrefixMapping(String prefix, String uri) {
- LinkedList stack = (LinkedList) xmlPrefixMapper.get(prefix);
- if (stack == null) {
- stack = new LinkedList();
- xmlPrefixMapper.put(prefix, stack);
- }
- stack.addFirst(uri);
+ LinkedList stack = (LinkedList) xmlPrefixMapper.get(prefix);
+ if (stack == null) {
+ stack = new LinkedList();
+ xmlPrefixMapper.put(prefix, stack);
+ }
+ stack.addFirst(uri);
}
/*
- * Removes the URI at the top of the stack of URIs to which the given
- * prefix is mapped.
+ * Removes the URI at the top of the stack of URIs to which the given
+ * prefix is mapped.
*
* @param prefix The prefix whose stack of URIs is to be popped
*/
public void popPrefixMapping(String prefix) {
- LinkedList stack = (LinkedList) xmlPrefixMapper.get(prefix);
- if (stack == null || stack.size() == 0) {
- // XXX throw new Exception("XXX");
- }
- stack.removeFirst();
+ LinkedList stack = (LinkedList) xmlPrefixMapper.get(prefix);
+ if (stack == null || stack.size() == 0) {
+ // XXX throw new Exception("XXX");
+ }
+ stack.removeFirst();
}
/*
@@ -338,16 +334,16 @@
*/
public String getURI(String prefix) {
- String uri = null;
+ String uri = null;
- LinkedList stack = (LinkedList) xmlPrefixMapper.get(prefix);
- if (stack == null || stack.size() == 0) {
- uri = (String) jspPrefixMapper.get(prefix);
- } else {
- uri = (String) stack.getFirst();
- }
+ LinkedList stack = (LinkedList) xmlPrefixMapper.get(prefix);
+ if (stack == null || stack.size() == 0) {
+ uri = (String) jspPrefixMapper.get(prefix);
+ } else {
+ uri = (String) stack.getFirst();
+ }
- return uri;
+ return uri;
}
@@ -357,25 +353,25 @@
* language
*/
public void setLanguage(String value, Node n, ErrorDispatcher err,
- boolean pagedir)
- throws JasperException {
+ boolean pagedir)
+ throws JasperException {
- if (!"java".equalsIgnoreCase(value)) {
- if (pagedir)
- err.jspError(n, "jsp.error.page.language.nonjava");
- else
- err.jspError(n, "jsp.error.tag.language.nonjava");
- }
+ if (!"java".equalsIgnoreCase(value)) {
+ if (pagedir)
+ err.jspError(n, "jsp.error.page.language.nonjava");
+ else
+ err.jspError(n, "jsp.error.tag.language.nonjava");
+ }
- language = value;
+ language = value;
}
public String getLanguage(boolean useDefault) {
- return (language == null && useDefault ? defaultLanguage : language);
+ return (language == null && useDefault ? defaultLanguage : language);
}
public String getLanguage() {
- return getLanguage(true);
+ return getLanguage(true);
}
@@ -384,15 +380,15 @@
*/
public void setExtends(String value, Node.PageDirective n) {
- xtends = value;
+ xtends = value;
- /*
- * If page superclass is top level class (i.e. not in a package)
- * explicitly import it. If this is not done, the compiler will assume
- * the extended class is in the same pkg as the generated servlet.
- */
- if (value.indexOf('.') < 0)
- n.addImport(value);
+ /*
+ * If page superclass is top level class (i.e. not in a package)
+ * explicitly import it. If this is not done, the compiler will assume
+ * the extended class is in the same pkg as the generated servlet.
+ */
+ if (value.indexOf('.') < 0)
+ n.addImport(value);
}
/**
@@ -407,7 +403,7 @@
* not been set and useDefault is TRUE
*/
public String getExtends(boolean useDefault) {
- return (xtends == null && useDefault ? defaultExtends : xtends);
+ return (xtends == null && useDefault ? defaultExtends : xtends);
}
/**
@@ -418,7 +414,7 @@
* not been set
*/
public String getExtends() {
- return getExtends(true);
+ return getExtends(true);
}
@@ -426,11 +422,11 @@
* contentType
*/
public void setContentType(String value) {
- contentType = value;
+ contentType = value;
}
public String getContentType() {
- return contentType;
+ return contentType;
}
@@ -438,30 +434,30 @@
* buffer
*/
public void setBufferValue(String value, Node n, ErrorDispatcher err)
- throws JasperException {
+ throws JasperException {
- if ("none".equalsIgnoreCase(value))
- buffer = 0;
- else {
- if (value == null || !value.endsWith("kb"))
- err.jspError(n, "jsp.error.page.invalid.buffer");
- try {
- Integer k = new Integer(value.substring(0, value.length()-2));
- buffer = k.intValue() * 1024;
- } catch (NumberFormatException e) {
- err.jspError(n, "jsp.error.page.invalid.buffer");
- }
- }
+ if ("none".equalsIgnoreCase(value))
+ buffer = 0;
+ else {
+ if (value == null || !value.endsWith("kb"))
+ err.jspError(n, "jsp.error.page.invalid.buffer");
+ try {
+ Integer k = new Integer(value.substring(0, value.length()-2));
+ buffer = k.intValue() * 1024;
+ } catch (NumberFormatException e) {
+ err.jspError(n, "jsp.error.page.invalid.buffer");
+ }
+ }
- bufferValue = value;
+ bufferValue = value;
}
public String getBufferValue() {
- return bufferValue;
+ return bufferValue;
}
public int getBuffer() {
- return buffer;
+ return buffer;
}
@@ -469,24 +465,24 @@
* session
*/
public void setSession(String value, Node n, ErrorDispatcher err)
- throws JasperException {
+ throws JasperException {
- if ("true".equalsIgnoreCase(value))
- isSession = true;
- else if ("false".equalsIgnoreCase(value))
- isSession = false;
- else
- err.jspError(n, "jsp.error.page.invalid.session");
+ if ("true".equalsIgnoreCase(value))
+ isSession = true;
+ else if ("false".equalsIgnoreCase(value))
+ isSession = false;
+ else
+ err.jspError(n, "jsp.error.page.invalid.session");
- session = value;
+ session = value;
}
public String getSession() {
- return session;
+ return session;
}
public boolean isSession() {
- return isSession;
+ return isSession;
}
@@ -494,24 +490,24 @@
* autoFlush
*/
public void setAutoFlush(String value, Node n, ErrorDispatcher err)
- throws JasperException {
+ throws JasperException {
- if ("true".equalsIgnoreCase(value))
- isAutoFlush = true;
- else if ("false".equalsIgnoreCase(value))
- isAutoFlush = false;
- else
- err.jspError(n, "jsp.error.autoFlush.invalid");
+ if ("true".equalsIgnoreCase(value))
+ isAutoFlush = true;
+ else if ("false".equalsIgnoreCase(value))
+ isAutoFlush = false;
+ else
+ err.jspError(n, "jsp.error.autoFlush.invalid");
- autoFlush = value;
+ autoFlush = value;
}
public String getAutoFlush() {
- return autoFlush;
+ return autoFlush;
}
public boolean isAutoFlush() {
- return isAutoFlush;
+ return isAutoFlush;
}
@@ -519,24 +515,24 @@
* isThreadSafe
*/
public void setIsThreadSafe(String value, Node n, ErrorDispatcher err)
- throws JasperException {
+ throws JasperException {
- if ("true".equalsIgnoreCase(value))
- isThreadSafe = true;
- else if ("false".equalsIgnoreCase(value))
- isThreadSafe = false;
- else
- err.jspError(n, "jsp.error.page.invalid.isthreadsafe");
+ if ("true".equalsIgnoreCase(value))
+ isThreadSafe = true;
+ else if ("false".equalsIgnoreCase(value))
+ isThreadSafe = false;
+ else
+ err.jspError(n, "jsp.error.page.invalid.isthreadsafe");
- isThreadSafeValue = value;
+ isThreadSafeValue = value;
}
public String getIsThreadSafe() {
- return isThreadSafeValue;
+ return isThreadSafeValue;
}
public boolean isThreadSafe() {
- return isThreadSafe;
+ return isThreadSafe;
}
@@ -544,23 +540,23 @@
* info
*/
public void setInfo(String value) {
- info = value;
+ info = value;
}
public String getInfo() {
- return info;
+ return info;
}
-
+
/*
* errorPage
*/
public void setErrorPage(String value) {
- errorPage = value;
+ errorPage = value;
}
public String getErrorPage() {
- return errorPage;
+ return errorPage;
}
@@ -568,24 +564,24 @@
* isErrorPage
*/
public void setIsErrorPage(String value, Node n, ErrorDispatcher err)
- throws JasperException {
+ throws JasperException {
- if ("true".equalsIgnoreCase(value))
- isErrorPage = true;
- else if ("false".equalsIgnoreCase(value))
- isErrorPage = false;
- else
- err.jspError(n, "jsp.error.page.invalid.iserrorpage");
+ if ("true".equalsIgnoreCase(value))
+ isErrorPage = true;
+ else if ("false".equalsIgnoreCase(value))
+ isErrorPage = false;
+ else
+ err.jspError(n, "jsp.error.page.invalid.iserrorpage");
- isErrorPageValue = value;
+ isErrorPageValue = value;
}
public String getIsErrorPage() {
- return isErrorPageValue;
+ return isErrorPageValue;
}
public boolean isErrorPage() {
- return isErrorPage;
+ return isErrorPage;
}
@@ -593,33 +589,33 @@
* isELIgnored
*/
public void setIsELIgnored(String value, Node n, ErrorDispatcher err,
- boolean pagedir)
- throws JasperException {
+ boolean pagedir)
+ throws JasperException {
- if ("true".equalsIgnoreCase(value))
- isELIgnored = true;
- else if ("false".equalsIgnoreCase(value))
- isELIgnored = false;
- else {
- if (pagedir)
- err.jspError(n, "jsp.error.page.invalid.iselignored");
- else
- err.jspError(n, "jsp.error.tag.invalid.iselignored");
- }
+ if ("true".equalsIgnoreCase(value))
+ isELIgnored = true;
+ else if ("false".equalsIgnoreCase(value))
+ isELIgnored = false;
+ else {
+ if (pagedir)
+ err.jspError(n, "jsp.error.page.invalid.iselignored");
+ else
+ err.jspError(n, "jsp.error.tag.invalid.iselignored");
+ }
- isELIgnoredValue = value;
+ isELIgnoredValue = value;
}
public void setELIgnored(boolean s) {
- isELIgnored = s;
+ isELIgnored = s;
}
public String getIsELIgnored() {
- return isELIgnoredValue;
+ return isELIgnoredValue;
}
public boolean isELIgnored() {
- return isELIgnored;
+ return isELIgnored;
}
public void putNonCustomTagPrefix(String prefix, Mark where) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]