一、前言
关于jasper源码中org.apache.jasper.compiler.JspUtil的服务端脚本页工具类,进行页面对象及脚本常见的元素转换处理,详情源码说明。
二、源码说明
1.JspUtil工具类
package org.apache.jasper.compiler;@b@@b@import java.io.CharArrayWriter;@b@import java.io.IOException;@b@import java.io.InputStream;@b@import java.io.InputStreamReader;@b@import java.io.UnsupportedEncodingException;@b@import java.lang.reflect.Array;@b@import java.util.Vector;@b@import java.util.jar.JarFile;@b@import java.util.zip.ZipEntry;@b@import javax.servlet.jsp.el.ELException;@b@import javax.servlet.jsp.el.ELParseException;@b@import javax.servlet.jsp.el.FunctionMapper;@b@import org.apache.commons.el.ExpressionEvaluatorImpl;@b@import org.apache.jasper.JasperException;@b@import org.apache.jasper.JspCompilationContext;@b@import org.xml.sax.Attributes;@b@@b@public class JspUtil@b@{@b@ private static final String WEB_INF_TAGS = "/WEB-INF/tags/";@b@ private static final String META_INF_TAGS = "/META-INF/tags/";@b@ private static final String OPEN_EXPR = "<%=";@b@ private static final String CLOSE_EXPR = "%>";@b@ private static final String OPEN_EXPR_XML = "%=";@b@ private static final String CLOSE_EXPR_XML = "%";@b@ private static int tempSequenceNumber = 0;@b@ private static ExpressionEvaluatorImpl expressionEvaluator = new ExpressionEvaluatorImpl();@b@ private static final String[] javaKeywords = { "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "default", "do", "double", "else", "enum", "extends", "final", "finally", "float", "for", "goto", "if", "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "package", "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch", "synchronized", "this", "throws", "transient", "try", "void", "volatile", "while" };@b@ public static final int CHUNKSIZE = 1024;@b@@b@ public static char[] removeQuotes(char[] chars)@b@ {@b@ CharArrayWriter caw = new CharArrayWriter();@b@ for (int i = 0; i < chars.length; ++i)@b@ if ((chars[i] == '%') && (chars[(i + 1)] == '\\') && (chars[(i + 2)] == '>'))@b@ {@b@ caw.write(37);@b@ caw.write(62);@b@ i += 2;@b@ } else {@b@ caw.write(chars[i]);@b@ }@b@@b@ return caw.toCharArray();@b@ }@b@@b@ public static char[] escapeQuotes(char[] chars)@b@ {@b@ String s = new String(chars);@b@ while (true) {@b@ int n = s.indexOf("%\\>");@b@ if (n < 0)@b@ break;@b@ StringBuffer sb = new StringBuffer(s.substring(0, n));@b@ sb.append("%>");@b@ sb.append(s.substring(n + 3));@b@ s = sb.toString();@b@ }@b@ chars = s.toCharArray();@b@ return chars;@b@ }@b@@b@ public static boolean isExpression(String token, boolean isXml)@b@ {@b@ String openExpr;@b@ String closeExpr;@b@ if (isXml) {@b@ openExpr = "%=";@b@ closeExpr = "%";@b@ } else {@b@ openExpr = "<%=";@b@ closeExpr = "%>";@b@ }@b@@b@ return ((token.startsWith(openExpr)) && (token.endsWith(closeExpr)));@b@ }@b@@b@ public static String getExpr(String expression, boolean isXml)@b@ {@b@ String returnString;@b@ String openExpr;@b@ String closeExpr;@b@ if (isXml) {@b@ openExpr = "%=";@b@ closeExpr = "%";@b@ } else {@b@ openExpr = "<%=";@b@ closeExpr = "%>";@b@ }@b@ int length = expression.length();@b@ if ((expression.startsWith(openExpr)) && (expression.endsWith(closeExpr)))@b@ {@b@ returnString = expression.substring(openExpr.length(), length - closeExpr.length());@b@ }@b@ else@b@ returnString = "";@b@@b@ return returnString;@b@ }@b@@b@ public static String getExprInXml(String expression)@b@ {@b@ String returnString;@b@ int length = expression.length();@b@@b@ if ((expression.startsWith("<%=")) && (expression.endsWith("%>")))@b@ {@b@ returnString = expression.substring(1, length - 1);@b@ }@b@ else { returnString = expression;@b@ }@b@@b@ return escapeXml(returnString.replace('\27', '$'));@b@ }@b@@b@ public static void checkScope(String scope, Node n, ErrorDispatcher err)@b@ throws JasperException@b@ {@b@ if ((scope != null) && (!(scope.equals("page"))) && (!(scope.equals("request"))) && (!(scope.equals("session"))) && (!(scope.equals("application"))))@b@ {@b@ err.jspError(n, "jsp.error.invalid.scope", scope);@b@ }@b@ }@b@@b@ public static void checkAttributes(String typeOfTag, Node n, ValidAttribute[] validAttributes, ErrorDispatcher err)@b@ throws JasperException@b@ {@b@ Attributes attrs = n.getAttributes();@b@ Mark start = n.getStart();@b@ boolean valid = true;@b@@b@ int tempLength = (attrs == null) ? 0 : attrs.getLength();@b@ Vector temp = new Vector(tempLength, 1);@b@ for (int i = 0; i < tempLength; ++i) {@b@ String qName = attrs.getQName(i);@b@ if ((!(qName.equals("xmlns"))) && (!(qName.startsWith("xmlns:"))))@b@ temp.addElement(qName);@b@@b@ }@b@@b@ Node.Nodes tagBody = n.getBody();@b@ if (tagBody != null) {@b@ int numSubElements = tagBody.size();@b@ for (i = 0; i < numSubElements; ++i) {@b@ Node node = tagBody.getNode(i);@b@ if (!(node instanceof Node.NamedAttribute)) break;@b@ String attrName = node.getAttributeValue("name");@b@ temp.addElement(attrName);@b@@b@ if (n.getAttributeValue(attrName) != null) {@b@ err.jspError(n, "jsp.error.duplicate.name.jspattribute", attrName);@b@ }@b@@b@ }@b@@b@ }@b@@b@ String missingAttribute = null;@b@@b@ for (int i = 0; i < validAttributes.length; ++i)@b@ {@b@ if (validAttributes[i].mandatory) {@b@ int attrPos = temp.indexOf(validAttributes[i].name);@b@ if (attrPos != -1) {@b@ temp.remove(attrPos);@b@ valid = true;@b@ } else {@b@ valid = false;@b@ missingAttribute = validAttributes[i].name;@b@ break;@b@ }@b@ }@b@@b@ }@b@@b@ if (!(valid)) {@b@ err.jspError(start, "jsp.error.mandatory.attribute", typeOfTag, missingAttribute);@b@ }@b@@b@ int attrLeftLength = temp.size();@b@ if (attrLeftLength == 0) {@b@ return;@b@ }@b@@b@ String attribute = null;@b@@b@ for (int j = 0; j < attrLeftLength; ++j) {@b@ valid = false;@b@ attribute = (String)temp.elementAt(j);@b@ for (int i = 0; i < validAttributes.length; ++i)@b@ if (attribute.equals(validAttributes[i].name)) {@b@ valid = true;@b@ break;@b@ }@b@@b@ if (!(valid))@b@ err.jspError(start, "jsp.error.invalid.attribute", typeOfTag, attribute);@b@ }@b@ }@b@@b@ public static String escapeQueryString(String unescString)@b@ {@b@ if (unescString == null)@b@ return null;@b@@b@ String escString = "";@b@ String shellSpChars = "\\\"";@b@@b@ for (int index = 0; index < unescString.length(); ++index) {@b@ char nextChar = unescString.charAt(index);@b@@b@ if (shellSpChars.indexOf(nextChar) != -1)@b@ escString = escString + "\\";@b@@b@ escString = escString + nextChar;@b@ }@b@ return escString;@b@ }@b@@b@ public static String escapeXml(String s)@b@ {@b@ if (s == null) return null;@b@ StringBuffer sb = new StringBuffer();@b@ for (int i = 0; i < s.length(); ++i) {@b@ char c = s.charAt(i);@b@ if (c == '<')@b@ sb.append("<");@b@ else if (c == '>')@b@ sb.append(">");@b@ else if (c == '\'')@b@ sb.append("'");@b@ else if (c == '&')@b@ sb.append("&");@b@ else if (c == '"')@b@ sb.append(""");@b@ else@b@ sb.append(c);@b@ }@b@@b@ return sb.toString();@b@ }@b@@b@ public static String replace(String name, char replace, String with)@b@ {@b@ StringBuffer buf = new StringBuffer();@b@ int begin = 0;@b@@b@ int last = name.length();@b@ while (true)@b@ {@b@ int end = name.indexOf(replace, begin);@b@ if (end < 0)@b@ end = last;@b@@b@ buf.append(name.substring(begin, end));@b@ if (end == last)@b@ break;@b@@b@ buf.append(with);@b@ begin = end + 1;@b@ }@b@@b@ return buf.toString();@b@ }@b@@b@ public static boolean booleanValue(String s)@b@ {@b@ boolean b = false;@b@ if (s != null)@b@ if (s.equalsIgnoreCase("yes"))@b@ b = true;@b@ else@b@ b = Boolean.valueOf(s).booleanValue();@b@@b@@b@ return b;@b@ }@b@@b@ public static Class toClass(String type, ClassLoader loader)@b@ throws ClassNotFoundException@b@ {@b@ Class c = null;@b@ int i0 = type.indexOf(91);@b@ int dims = 0;@b@ if (i0 > 0)@b@ {@b@ for (int i = 0; i < type.length(); ++i)@b@ if (type.charAt(i) == '[')@b@ ++dims;@b@@b@ type = type.substring(0, i0);@b@ }@b@@b@ if ("boolean".equals(type))@b@ c = Boolean.TYPE;@b@ else if ("char".equals(type))@b@ c = Character.TYPE;@b@ else if ("byte".equals(type))@b@ c = Byte.TYPE;@b@ else if ("short".equals(type))@b@ c = Short.TYPE;@b@ else if ("int".equals(type))@b@ c = Integer.TYPE;@b@ else if ("long".equals(type))@b@ c = Long.TYPE;@b@ else if ("float".equals(type))@b@ c = Float.TYPE;@b@ else if ("double".equals(type))@b@ c = Double.TYPE;@b@ else if (type.indexOf(91) < 0)@b@ c = loader.loadClass(type);@b@@b@ if (dims == 0)@b@ return c;@b@@b@ if (dims == 1) {@b@ return Array.newInstance(c, 1).getClass();@b@ }@b@@b@ return Array.newInstance(c, new int[dims]).getClass();@b@ }@b@@b@ public static String interpreterCall(boolean isTagFile, String expression, Class expectedType, String fnmapvar, boolean XmlEscape)@b@ {@b@ String jspCtxt = null;@b@ if (isTagFile)@b@ jspCtxt = "this.getJspContext()";@b@ else {@b@ jspCtxt = "_jspx_page_context";@b@ }@b@@b@ String targetType = expectedType.getName();@b@ String primitiveConverterMethod = null;@b@ if (expectedType.isPrimitive())@b@ if (expectedType.equals(Boolean.TYPE)) {@b@ targetType = Boolean.class.getName();@b@ primitiveConverterMethod = "booleanValue";@b@ } else if (expectedType.equals(Byte.TYPE)) {@b@ targetType = Byte.class.getName();@b@ primitiveConverterMethod = "byteValue";@b@ } else if (expectedType.equals(Character.TYPE)) {@b@ targetType = Character.class.getName();@b@ primitiveConverterMethod = "charValue";@b@ } else if (expectedType.equals(Short.TYPE)) {@b@ targetType = Short.class.getName();@b@ primitiveConverterMethod = "shortValue";@b@ } else if (expectedType.equals(Integer.TYPE)) {@b@ targetType = Integer.class.getName();@b@ primitiveConverterMethod = "intValue";@b@ } else if (expectedType.equals(Long.TYPE)) {@b@ targetType = Long.class.getName();@b@ primitiveConverterMethod = "longValue";@b@ } else if (expectedType.equals(Float.TYPE)) {@b@ targetType = Float.class.getName();@b@ primitiveConverterMethod = "floatValue";@b@ } else if (expectedType.equals(Double.TYPE)) {@b@ targetType = Double.class.getName();@b@ primitiveConverterMethod = "doubleValue";@b@ }@b@@b@@b@ if (primitiveConverterMethod != null) {@b@ XmlEscape = false;@b@ }@b@@b@ targetType = toJavaSourceType(targetType);@b@ StringBuffer call = new StringBuffer("(" + targetType + ") " + "org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate" + "(" + Generator.quote(expression) + ", " + targetType + ".class, " + "(PageContext)" + jspCtxt + ", " + fnmapvar + ", " + XmlEscape + ")");@b@@b@ if (primitiveConverterMethod != null) {@b@ call.insert(0, "(");@b@ call.append(")." + primitiveConverterMethod + "()");@b@ }@b@@b@ return call.toString();@b@ }@b@@b@ public static void validateExpressions(Mark where, String expressions, Class expectedType, FunctionMapper functionMapper, ErrorDispatcher err)@b@ throws JasperException@b@ {@b@ try@b@ {@b@ expressionEvaluator.parseExpression(expressions, expectedType, null);@b@ }@b@ catch (ELParseException e)@b@ {@b@ err.jspError(where, "jsp.error.invalid.expression", expressions, e.toString());@b@ }@b@ catch (ELException e)@b@ {@b@ err.jspError(where, "jsp.error.invalid.expression", expressions, e.toString());@b@ }@b@ }@b@@b@ public static void resetTemporaryVariableName()@b@ {@b@ tempSequenceNumber = 0;@b@ }@b@@b@ public static String nextTemporaryVariableName()@b@ {@b@ return "_jspx_temp" + (tempSequenceNumber++);@b@ }@b@@b@ public static String coerceToPrimitiveBoolean(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToBoolean(" + s + ")";@b@@b@ if ((s == null) || (s.length() == 0))@b@ return "false";@b@@b@ return Boolean.valueOf(s).toString();@b@ }@b@@b@ public static String coerceToBoolean(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "(Boolean) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Boolean.class)";@b@@b@ if ((s == null) || (s.length() == 0)) {@b@ return "new Boolean(false)";@b@ }@b@@b@ return "new Boolean(" + Boolean.valueOf(s).toString() + ")";@b@ }@b@@b@ public static String coerceToPrimitiveByte(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToByte(" + s + ")";@b@@b@ if ((s == null) || (s.length() == 0))@b@ return "(byte) 0";@b@@b@ return "((byte)" + Byte.valueOf(s).toString() + ")";@b@ }@b@@b@ public static String coerceToByte(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "(Byte) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Byte.class)";@b@@b@ if ((s == null) || (s.length() == 0)) {@b@ return "new Byte((byte) 0)";@b@ }@b@@b@ return "new Byte((byte)" + Byte.valueOf(s).toString() + ")";@b@ }@b@@b@ public static String coerceToChar(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToChar(" + s + ")";@b@@b@ if ((s == null) || (s.length() == 0))@b@ return "(char) 0";@b@@b@ char ch = s.charAt(0);@b@@b@ return "((char) " + ch + ")";@b@ }@b@@b@ public static String coerceToCharacter(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "(Character) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Character.class)";@b@@b@ if ((s == null) || (s.length() == 0))@b@ return "new Character((char) 0)";@b@@b@ char ch = s.charAt(0);@b@@b@ return "new Character((char) " + ch + ")";@b@ }@b@@b@ public static String coerceToPrimitiveDouble(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToDouble(" + s + ")";@b@@b@ if ((s == null) || (s.length() == 0))@b@ return "(double) 0";@b@@b@ return Double.valueOf(s).toString();@b@ }@b@@b@ public static String coerceToDouble(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "(Double) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Double.class)";@b@@b@ if ((s == null) || (s.length() == 0)) {@b@ return "new Double(0)";@b@ }@b@@b@ return "new Double(" + Double.valueOf(s).toString() + ")";@b@ }@b@@b@ public static String coerceToPrimitiveFloat(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToFloat(" + s + ")";@b@@b@ if ((s == null) || (s.length() == 0))@b@ return "(float) 0";@b@@b@ return Float.valueOf(s).toString() + "f";@b@ }@b@@b@ public static String coerceToFloat(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "(Float) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Float.class)";@b@@b@ if ((s == null) || (s.length() == 0)) {@b@ return "new Float(0)";@b@ }@b@@b@ return "new Float(" + Float.valueOf(s).toString() + "f)";@b@ }@b@@b@ public static String coerceToInt(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToInt(" + s + ")";@b@@b@ if ((s == null) || (s.length() == 0))@b@ return "0";@b@@b@ return Integer.valueOf(s).toString();@b@ }@b@@b@ public static String coerceToInteger(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "(Integer) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Integer.class)";@b@@b@ if ((s == null) || (s.length() == 0)) {@b@ return "new Integer(0)";@b@ }@b@@b@ return "new Integer(" + Integer.valueOf(s).toString() + ")";@b@ }@b@@b@ public static String coerceToPrimitiveShort(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToShort(" + s + ")";@b@@b@ if ((s == null) || (s.length() == 0))@b@ return "(short) 0";@b@@b@ return "((short) " + Short.valueOf(s).toString() + ")";@b@ }@b@@b@ public static String coerceToShort(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "(Short) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Short.class)";@b@@b@ if ((s == null) || (s.length() == 0)) {@b@ return "new Short((short) 0)";@b@ }@b@@b@ return "new Short(\"" + Short.valueOf(s).toString() + "\")";@b@ }@b@@b@ public static String coerceToPrimitiveLong(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToLong(" + s + ")";@b@@b@ if ((s == null) || (s.length() == 0))@b@ return "(long) 0";@b@@b@ return Long.valueOf(s).toString() + "l";@b@ }@b@@b@ public static String coerceToLong(String s, boolean isNamedAttribute)@b@ {@b@ if (isNamedAttribute)@b@ return "(Long) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Long.class)";@b@@b@ if ((s == null) || (s.length() == 0)) {@b@ return "new Long(0)";@b@ }@b@@b@ return "new Long(" + Long.valueOf(s).toString() + "l)";@b@ }@b@@b@ public static InputStream getInputStream(String fname, JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err)@b@ throws JasperException, IOException@b@ {@b@ InputStream in = null;@b@@b@ if (jarFile != null) {@b@ String jarEntryName = fname.substring(1, fname.length());@b@ ZipEntry jarEntry = jarFile.getEntry(jarEntryName);@b@ if (jarEntry == null)@b@ err.jspError("jsp.error.file.not.found", fname);@b@@b@ in = jarFile.getInputStream(jarEntry);@b@ } else {@b@ in = ctxt.getResourceAsStream(fname);@b@ }@b@@b@ if (in == null) {@b@ err.jspError("jsp.error.file.not.found", fname);@b@ }@b@@b@ return in;@b@ }@b@@b@ public static String getTagHandlerClassName(String path, ErrorDispatcher err)@b@ throws JasperException@b@ {@b@ String className = null;@b@ int begin = 0;@b@@b@ int index = path.lastIndexOf(".tag");@b@ if (index == -1) {@b@ err.jspError("jsp.error.tagfile.badSuffix", path);@b@ }@b@@b@ index = path.indexOf("/WEB-INF/tags/");@b@ if (index != -1) {@b@ className = "org.apache.jsp.tag.web.";@b@ begin = index + "/WEB-INF/tags/".length();@b@ } else {@b@ index = path.indexOf("/META-INF/tags/");@b@ if (index != -1) {@b@ className = "org.apache.jsp.tag.meta.";@b@ begin = index + "/META-INF/tags/".length();@b@ } else {@b@ err.jspError("jsp.error.tagfile.illegalPath", path);@b@ }@b@ }@b@@b@ className = className + makeJavaPackage(path.substring(begin));@b@@b@ return className;@b@ }@b@@b@ public static final String makeJavaPackage(String path)@b@ {@b@ String[] classNameComponents = split(path, "/");@b@ StringBuffer legalClassNames = new StringBuffer();@b@ for (int i = 0; i < classNameComponents.length; ++i) {@b@ legalClassNames.append(makeJavaIdentifier(classNameComponents[i]));@b@ if (i < classNameComponents.length - 1)@b@ legalClassNames.append('.');@b@ }@b@@b@ return legalClassNames.toString();@b@ }@b@@b@ private static final String[] split(String path, String pat)@b@ {@b@ Vector comps = new Vector();@b@ int pos = path.indexOf(pat);@b@ int start = 0;@b@ while (pos >= 0) {@b@ if (pos > start) {@b@ String comp = path.substring(start, pos);@b@ comps.add(comp);@b@ }@b@ start = pos + pat.length();@b@ pos = path.indexOf(pat, start);@b@ }@b@ if (start < path.length())@b@ comps.add(path.substring(start));@b@@b@ String[] result = new String[comps.size()];@b@ for (int i = 0; i < comps.size(); ++i)@b@ result[i] = ((String)comps.elementAt(i));@b@@b@ return result;@b@ }@b@@b@ public static final String makeJavaIdentifier(String identifier)@b@ {@b@ StringBuffer modifiedIdentifier = new StringBuffer(identifier.length());@b@@b@ if (!(Character.isJavaIdentifierStart(identifier.charAt(0))))@b@ modifiedIdentifier.append('_');@b@@b@ for (int i = 0; i < identifier.length(); ++i) {@b@ char ch = identifier.charAt(i);@b@ if ((Character.isJavaIdentifierPart(ch)) && (ch != '_'))@b@ modifiedIdentifier.append(ch);@b@ else if (ch == '.')@b@ modifiedIdentifier.append('_');@b@ else@b@ modifiedIdentifier.append(mangleChar(ch));@b@ }@b@@b@ if (isJavaKeyword(modifiedIdentifier.toString()))@b@ modifiedIdentifier.append('_');@b@@b@ return modifiedIdentifier.toString();@b@ }@b@@b@ public static final String mangleChar(char ch)@b@ {@b@ char[] result = new char[5];@b@ result[0] = '_';@b@ result[1] = Character.forDigit(ch >> '\f' & 0xF, 16);@b@ result[2] = Character.forDigit(ch >> '\b' & 0xF, 16);@b@ result[3] = Character.forDigit(ch >> '\4' & 0xF, 16);@b@ result[4] = Character.forDigit(ch & 0xF, 16);@b@ return new String(result);@b@ }@b@@b@ public static boolean isJavaKeyword(String key)@b@ {@b@ int i = 0;@b@ int j = javaKeywords.length;@b@ while (i < j) {@b@ int k = (i + j) / 2;@b@ int result = javaKeywords[k].compareTo(key);@b@ if (result == 0)@b@ return true;@b@@b@ if (result < 0)@b@ i = k + 1;@b@ else@b@ j = k;@b@ }@b@@b@ return false;@b@ }@b@@b@ public static final String makeXmlJavaIdentifier(String name)@b@ {@b@ if (name.indexOf(45) >= 0)@b@ name = replace(name, '-', "$1");@b@ if (name.indexOf(46) >= 0)@b@ name = replace(name, '.', "$2");@b@ if (name.indexOf(58) >= 0)@b@ name = replace(name, ':', "$3");@b@ return name;@b@ }@b@@b@ static InputStreamReader getReader(String fname, String encoding, JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err)@b@ throws JasperException, IOException@b@ {@b@ InputStreamReader reader = null;@b@ InputStream in = getInputStream(fname, jarFile, ctxt, err);@b@ try@b@ {@b@ reader = new InputStreamReader(in, encoding);@b@ } catch (UnsupportedEncodingException ex) {@b@ err.jspError("jsp.error.unsupported.encoding", encoding);@b@ }@b@@b@ return reader;@b@ }@b@@b@ public static String toJavaSourceType(String type)@b@ {@b@ if (type.charAt(0) != '[') {@b@ return type;@b@ }@b@@b@ int dims = 1;@b@ String t = null;@b@ for (int i = 1; i < type.length(); ++i)@b@ if (type.charAt(i) == '[') {@b@ ++dims;@b@ } else {@b@ switch (type.charAt(i)) { case 'Z':@b@ t = "boolean"; break;@b@ case 'B':@b@ t = "byte"; break;@b@ case 'C':@b@ t = "char"; break;@b@ case 'D':@b@ t = "double"; break;@b@ case 'F':@b@ t = "float"; break;@b@ case 'I':@b@ t = "int"; break;@b@ case 'J':@b@ t = "long"; break;@b@ case 'S':@b@ t = "short"; break;@b@ case 'L':@b@ t = type.substring(i + 1, type.indexOf(59));@b@ case 'E':@b@ case 'G':@b@ case 'H':@b@ case 'K':@b@ case 'M':@b@ case 'N':@b@ case 'O':@b@ case 'P':@b@ case 'Q':@b@ case 'R':@b@ case 'T':@b@ case 'U':@b@ case 'V':@b@ case 'W':@b@ case 'X':@b@ case 'Y': } break;@b@ }@b@@b@ StringBuffer resultType = new StringBuffer(t);@b@ for (; dims > 0; --dims)@b@ resultType.append("[]");@b@@b@ return resultType.toString();@b@ }@b@@b@ public static String getCanonicalName(Class c)@b@ {@b@ String binaryName = c.getName();@b@ c = c.getDeclaringClass();@b@@b@ if (c == null) {@b@ return binaryName;@b@ }@b@@b@ StringBuffer buf = new StringBuffer(binaryName);@b@ do {@b@ buf.setCharAt(c.getName().length(), '.');@b@ c = c.getDeclaringClass(); }@b@ while (c != null);@b@@b@ return buf.toString();@b@ }@b@@b@ public static class ValidAttribute@b@ {@b@ String name;@b@ boolean mandatory;@b@ boolean rtexprvalue;@b@@b@ public ValidAttribute(String name, boolean mandatory, boolean rtexprvalue)@b@ {@b@ this.name = name;@b@ this.mandatory = mandatory;@b@ this.rtexprvalue = rtexprvalue;@b@ }@b@@b@ public ValidAttribute(String name, boolean mandatory) {@b@ this(name, mandatory, false);@b@ }@b@@b@ public ValidAttribute(String name) {@b@ this(name, false);@b@ }@b@ }@b@}
2.依赖类Node
package org.apache.jasper.compiler;@b@@b@import java.util.ArrayList;@b@import java.util.Iterator;@b@import java.util.List;@b@import javax.servlet.jsp.tagext.TagAttributeInfo;@b@import javax.servlet.jsp.tagext.TagData;@b@import javax.servlet.jsp.tagext.TagFileInfo;@b@import javax.servlet.jsp.tagext.TagInfo;@b@import javax.servlet.jsp.tagext.TagVariableInfo;@b@import javax.servlet.jsp.tagext.VariableInfo;@b@import org.apache.jasper.JasperException;@b@import org.apache.jasper.compiler.tagplugin.TagPluginContext;@b@import org.xml.sax.Attributes;@b@@b@abstract class Node@b@ implements TagConstants@b@{@b@ private static final VariableInfo[] ZERO_VARIABLE_INFO = new VariableInfo[0];@b@ protected Attributes attrs;@b@ protected Attributes taglibAttrs;@b@ protected Attributes nonTaglibXmlnsAttrs;@b@ protected Nodes body;@b@ protected String text;@b@ protected Mark startMark;@b@ protected int beginJavaLine;@b@ protected int endJavaLine;@b@ protected Node parent;@b@ protected Nodes namedAttributeNodes;@b@ protected String qName;@b@ protected String localName;@b@ protected String innerClassName;@b@ private boolean isDummy;@b@ static Class class$javax$servlet$jsp$tagext$IterationTag;@b@ static Class class$javax$servlet$jsp$tagext$BodyTag;@b@ static Class class$javax$servlet$jsp$tagext$TryCatchFinally;@b@ static Class class$javax$servlet$jsp$tagext$SimpleTag;@b@ static Class class$javax$servlet$jsp$tagext$DynamicAttributes;@b@@b@ public Node()@b@ {@b@ this.isDummy = true;@b@ }@b@@b@ public Node(Mark start, Node parent)@b@ {@b@ this.startMark = start;@b@ this.isDummy = (start == null);@b@ addToParent(parent);@b@ }@b@@b@ public Node(String qName, String localName, Mark start, Node parent)@b@ {@b@ this.qName = qName;@b@ this.localName = localName;@b@ this.startMark = start;@b@ this.isDummy = (start == null);@b@ addToParent(parent);@b@ }@b@@b@ public Node(String qName, String localName, Attributes attrs, Mark start, Node parent)@b@ {@b@ this.qName = qName;@b@ this.localName = localName;@b@ this.attrs = attrs;@b@ this.startMark = start;@b@ this.isDummy = (start == null);@b@ addToParent(parent);@b@ }@b@@b@ public Node(String qName, String localName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ this.qName = qName;@b@ this.localName = localName;@b@ this.attrs = attrs;@b@ this.nonTaglibXmlnsAttrs = nonTaglibXmlnsAttrs;@b@ this.taglibAttrs = taglibAttrs;@b@ this.startMark = start;@b@ this.isDummy = (start == null);@b@ addToParent(parent);@b@ }@b@@b@ public Node(String qName, String localName, String text, Mark start, Node parent)@b@ {@b@ this.qName = qName;@b@ this.localName = localName;@b@ this.text = text;@b@ this.startMark = start;@b@ this.isDummy = (start == null);@b@ addToParent(parent);@b@ }@b@@b@ public String getQName() {@b@ return this.qName;@b@ }@b@@b@ public String getLocalName() {@b@ return this.localName;@b@ }@b@@b@ public Attributes getAttributes()@b@ {@b@ return this.attrs;@b@ }@b@@b@ public Attributes getTaglibAttributes()@b@ {@b@ return this.taglibAttrs;@b@ }@b@@b@ public Attributes getNonTaglibXmlnsAttributes()@b@ {@b@ return this.nonTaglibXmlnsAttrs;@b@ }@b@@b@ public void setAttributes(Attributes attrs) {@b@ this.attrs = attrs;@b@ }@b@@b@ public String getAttributeValue(String name) {@b@ return ((this.attrs == null) ? null : this.attrs.getValue(name));@b@ }@b@@b@ public String getTextAttribute(String name)@b@ {@b@ String attr = getAttributeValue(name);@b@ if (attr != null) {@b@ return attr;@b@ }@b@@b@ NamedAttribute namedAttribute = getNamedAttributeNode(name);@b@ if (namedAttribute == null) {@b@ return null;@b@ }@b@@b@ return namedAttribute.getText();@b@ }@b@@b@ public NamedAttribute getNamedAttributeNode(String name)@b@ {@b@ NamedAttribute result = null;@b@@b@ Nodes nodes = getNamedAttributeNodes();@b@ int numChildNodes = nodes.size();@b@ for (int i = 0; i < numChildNodes; ++i) {@b@ NamedAttribute na = (NamedAttribute)nodes.getNode(i);@b@ boolean found = false;@b@ int index = name.indexOf(58);@b@ if (index != -1)@b@ {@b@ found = na.getName().equals(name);@b@ }@b@ else found = na.getLocalName().equals(name);@b@@b@ if (found) {@b@ result = na;@b@ break;@b@ }@b@ }@b@@b@ return result;@b@ }@b@@b@ public Nodes getNamedAttributeNodes()@b@ {@b@ int i;@b@ if (this.namedAttributeNodes != null) {@b@ return this.namedAttributeNodes;@b@ }@b@@b@ Nodes result = new Nodes();@b@@b@ Nodes nodes = getBody();@b@ if (nodes != null) {@b@ int numChildNodes = nodes.size();@b@ for (i = 0; i < numChildNodes; ++i) {@b@ Node n = nodes.getNode(i);@b@ if (n instanceof NamedAttribute) {@b@ result.add(n);@b@ }@b@ else if (!(n instanceof Comment))@b@ {@b@ break;@b@ }@b@ }@b@ }@b@@b@ this.namedAttributeNodes = result;@b@ return result;@b@ }@b@@b@ public Nodes getBody() {@b@ return this.body;@b@ }@b@@b@ public void setBody(Nodes body) {@b@ this.body = body;@b@ }@b@@b@ public String getText() {@b@ return this.text;@b@ }@b@@b@ public Mark getStart() {@b@ return this.startMark;@b@ }@b@@b@ public Node getParent() {@b@ return this.parent;@b@ }@b@@b@ public int getBeginJavaLine() {@b@ return this.beginJavaLine;@b@ }@b@@b@ public void setBeginJavaLine(int begin) {@b@ this.beginJavaLine = begin;@b@ }@b@@b@ public int getEndJavaLine() {@b@ return this.endJavaLine;@b@ }@b@@b@ public void setEndJavaLine(int end) {@b@ this.endJavaLine = end;@b@ }@b@@b@ public boolean isDummy() {@b@ return this.isDummy;@b@ }@b@@b@ public Root getRoot() {@b@ Node n = this;@b@ while (!(n instanceof Root))@b@ n = n.getParent();@b@@b@ return ((Root)n);@b@ }@b@@b@ public String getInnerClassName() {@b@ return this.innerClassName;@b@ }@b@@b@ public void setInnerClassName(String icn) {@b@ this.innerClassName = icn;@b@ }@b@@b@ abstract void accept(Visitor paramVisitor)@b@ throws JasperException;@b@@b@ private void addToParent(Node parent)@b@ {@b@ if (parent != null) {@b@ this.parent = parent;@b@ Nodes parentBody = parent.getBody();@b@ if (parentBody == null) {@b@ parentBody = new Nodes();@b@ parent.setBody(parentBody);@b@ }@b@ parentBody.add(this);@b@ }@b@ }@b@@b@ static Class class$(String x0)@b@ {@b@ try@b@ {@b@ return Class.forName(x0); } catch (ClassNotFoundException x1) { throw new NoClassDefFoundError().initCause(x1);@b@ }@b@ }@b@@b@ static VariableInfo[] access$000()@b@ {@b@ return ZERO_VARIABLE_INFO;@b@ }@b@@b@ public static class Visitor@b@ {@b@ protected void doVisit(Node n)@b@ throws JasperException@b@ {@b@ }@b@@b@ protected void visitBody(Node n)@b@ throws JasperException@b@ {@b@ if (n.getBody() != null)@b@ n.getBody().visit(this);@b@ }@b@@b@ public void visit(Node.Root n) throws JasperException@b@ {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.JspRoot n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.PageDirective n) throws JasperException {@b@ doVisit(n);@b@ }@b@@b@ public void visit(Node.TagDirective n) throws JasperException {@b@ doVisit(n);@b@ }@b@@b@ public void visit(Node.IncludeDirective n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.TaglibDirective n) throws JasperException {@b@ doVisit(n);@b@ }@b@@b@ public void visit(Node.AttributeDirective n) throws JasperException {@b@ doVisit(n);@b@ }@b@@b@ public void visit(Node.VariableDirective n) throws JasperException {@b@ doVisit(n);@b@ }@b@@b@ public void visit(Node.Comment n) throws JasperException {@b@ doVisit(n);@b@ }@b@@b@ public void visit(Node.Declaration n) throws JasperException {@b@ doVisit(n);@b@ }@b@@b@ public void visit(Node.Expression n) throws JasperException {@b@ doVisit(n);@b@ }@b@@b@ public void visit(Node.Scriptlet n) throws JasperException {@b@ doVisit(n);@b@ }@b@@b@ public void visit(Node.ELExpression n) throws JasperException {@b@ doVisit(n);@b@ }@b@@b@ public void visit(Node.IncludeAction n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.ForwardAction n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.GetProperty n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.SetProperty n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.ParamAction n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.ParamsAction n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.FallBackAction n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.UseBean n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.PlugIn n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.CustomTag n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.UninterpretedTag n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.JspElement n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.JspText n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.NamedAttribute n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.JspBody n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.InvokeAction n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.DoBodyAction n) throws JasperException {@b@ doVisit(n);@b@ visitBody(n);@b@ }@b@@b@ public void visit(Node.TemplateText n) throws JasperException {@b@ doVisit(n);@b@ }@b@@b@ public void visit(Node.JspOutput n) throws JasperException {@b@ doVisit(n);@b@ }@b@@b@ public void visit(Node.AttributeGenerator n) throws JasperException {@b@ doVisit(n);@b@ }@b@ }@b@@b@ public static class Nodes@b@ {@b@ private List list;@b@ private Node.Root root;@b@ private boolean generatedInBuffer;@b@@b@ public Nodes()@b@ {@b@ this.list = new java.util.Vector();@b@ }@b@@b@ public Nodes(Node.Root root) {@b@ this.root = root;@b@ this.list = new java.util.Vector();@b@ this.list.add(root);@b@ }@b@@b@ public void add(Node n)@b@ {@b@ this.list.add(n);@b@ this.root = null;@b@ }@b@@b@ public void remove(Node n)@b@ {@b@ this.list.remove(n);@b@ }@b@@b@ public void visit(Node.Visitor v)@b@ throws JasperException@b@ {@b@ Iterator iter = this.list.iterator();@b@ while (iter.hasNext()) {@b@ Node n = (Node)iter.next();@b@ n.accept(v);@b@ }@b@ }@b@@b@ public int size() {@b@ return this.list.size();@b@ }@b@@b@ public Node getNode(int index) {@b@ Node n = null;@b@ try {@b@ n = (Node)this.list.get(index);@b@ } catch (ArrayIndexOutOfBoundsException e) {@b@ }@b@ return n;@b@ }@b@@b@ public Node.Root getRoot() {@b@ return this.root;@b@ }@b@@b@ public boolean isGeneratedInBuffer() {@b@ return this.generatedInBuffer;@b@ }@b@@b@ public void setGeneratedInBuffer(boolean g) {@b@ this.generatedInBuffer = g;@b@ }@b@ }@b@@b@ public static class JspAttribute@b@ {@b@ private String qName;@b@ private String uri;@b@ private String localName;@b@ private String value;@b@ private boolean expression;@b@ private boolean dynamic;@b@ private ELNode.Nodes el;@b@ private boolean namedAttribute;@b@ private Node.NamedAttribute namedAttributeNode;@b@@b@ JspAttribute(String qName, String uri, String localName, String value, boolean expr, ELNode.Nodes el, boolean dyn)@b@ {@b@ this.qName = qName;@b@ this.uri = uri;@b@ this.localName = localName;@b@ this.value = value;@b@ this.namedAttributeNode = null;@b@ this.expression = expr;@b@ this.el = el;@b@ this.dynamic = dyn;@b@ this.namedAttribute = false;@b@ }@b@@b@ JspAttribute(Node.NamedAttribute na, boolean dyn)@b@ {@b@ this.qName = na.getName();@b@ this.localName = na.getLocalName();@b@ this.value = null;@b@ this.namedAttributeNode = na;@b@ this.expression = false;@b@ this.el = null;@b@ this.dynamic = dyn;@b@ this.namedAttribute = true;@b@ }@b@@b@ public String getName()@b@ {@b@ return this.qName;@b@ }@b@@b@ public String getLocalName()@b@ {@b@ return this.localName;@b@ }@b@@b@ public String getURI()@b@ {@b@ return this.uri;@b@ }@b@@b@ public String getValue()@b@ {@b@ return this.value;@b@ }@b@@b@ public Node.NamedAttribute getNamedAttributeNode()@b@ {@b@ return this.namedAttributeNode;@b@ }@b@@b@ public boolean isExpression()@b@ {@b@ return this.expression;@b@ }@b@@b@ public boolean isNamedAttribute()@b@ {@b@ return this.namedAttribute;@b@ }@b@@b@ public boolean isELInterpreterInput()@b@ {@b@ return (this.el != null);@b@ }@b@@b@ public boolean isLiteral()@b@ {@b@ return ((!(this.expression)) && (this.el != null) && (!(this.namedAttribute)));@b@ }@b@@b@ public boolean isDynamic()@b@ {@b@ return this.dynamic;@b@ }@b@@b@ public ELNode.Nodes getEL() {@b@ return this.el;@b@ }@b@ }@b@@b@ public static class TemplateText extends Node@b@ {@b@ private ArrayList extraSmap = null;@b@@b@ public TemplateText(String text, Mark start, Node parent)@b@ {@b@ super(null, null, text, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException {@b@ v.visit(this);@b@ }@b@@b@ public void ltrim()@b@ {@b@ int index = 0;@b@ while ((index < this.text.length()) && (this.text.charAt(index) <= ' '))@b@ ++index;@b@@b@ this.text = this.text.substring(index);@b@ }@b@@b@ public void setText(String text) {@b@ this.text = text;@b@ }@b@@b@ public void rtrim()@b@ {@b@ int index = this.text.length();@b@ while ((index > 0) && (this.text.charAt(index - 1) <= ' '))@b@ --index;@b@@b@ this.text = this.text.substring(0, index);@b@ }@b@@b@ public boolean isAllSpace()@b@ {@b@ boolean isAllSpace = true;@b@ for (int i = 0; i < this.text.length(); ++i)@b@ if (!(Character.isWhitespace(this.text.charAt(i)))) {@b@ isAllSpace = false;@b@ break;@b@ }@b@@b@ return isAllSpace;@b@ }@b@@b@ public void addSmap(int srcLine)@b@ {@b@ if (this.extraSmap == null)@b@ this.extraSmap = new ArrayList();@b@@b@ this.extraSmap.add(new Integer(srcLine));@b@ }@b@@b@ public ArrayList getExtraSmap() {@b@ return this.extraSmap;@b@ }@b@ }@b@@b@ public static class JspBody extends Node@b@ {@b@ private Node.ChildInfo childInfo;@b@@b@ public JspBody(Mark start, Node parent)@b@ {@b@ this("jsp:body", null, null, start, parent);@b@ }@b@@b@ public JspBody(String qName, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "body", null, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@@b@ this.childInfo = new Node.ChildInfo();@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException {@b@ v.visit(this);@b@ }@b@@b@ public Node.ChildInfo getChildInfo() {@b@ return this.childInfo;@b@ }@b@ }@b@@b@ public static class NamedAttribute extends Node@b@ {@b@ private String temporaryVariableName;@b@ private boolean trim;@b@ private Node.ChildInfo childInfo;@b@ private String name;@b@ private String localName;@b@ private String prefix;@b@@b@ public NamedAttribute(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:attribute", attrs, null, null, start, parent);@b@ }@b@@b@ public NamedAttribute(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "attribute", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@@b@ this.trim = true;@b@@b@ this.temporaryVariableName = JspUtil.nextTemporaryVariableName();@b@ if ("false".equals(getAttributeValue("trim")))@b@ {@b@ this.trim = false;@b@ }@b@ this.childInfo = new Node.ChildInfo();@b@ this.name = getAttributeValue("name");@b@ if (this.name != null)@b@ {@b@ this.localName = this.name;@b@ int index = this.name.indexOf(58);@b@ if (index != -1) {@b@ this.prefix = this.name.substring(0, index);@b@ this.localName = this.name.substring(index + 1);@b@ }@b@ }@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException {@b@ v.visit(this);@b@ }@b@@b@ public String getName() {@b@ return this.name;@b@ }@b@@b@ public String getLocalName() {@b@ return this.localName;@b@ }@b@@b@ public String getPrefix() {@b@ return this.prefix;@b@ }@b@@b@ public Node.ChildInfo getChildInfo() {@b@ return this.childInfo;@b@ }@b@@b@ public boolean isTrim() {@b@ return this.trim;@b@ }@b@@b@ public String getTemporaryVariableName()@b@ {@b@ return this.temporaryVariableName;@b@ }@b@@b@ public String getText()@b@ {@b@ String text = "";@b@ if (getBody() != null) {@b@ Node.1AttributeVisitor attributeVisitor = new Node.1AttributeVisitor(this);@b@ try {@b@ getBody().visit(attributeVisitor);@b@ } catch (JasperException e) {@b@ }@b@ text = attributeVisitor.getAttrValue();@b@ }@b@@b@ return text;@b@ }@b@ }@b@@b@ public static class JspText extends Node@b@ {@b@ public JspText(String qName, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "text", null, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class AttributeGenerator extends Node@b@ {@b@ String name;@b@ Node.CustomTag tag;@b@@b@ public AttributeGenerator(Mark start, String name, Node.CustomTag tag)@b@ {@b@ super(start, null);@b@ this.name = name;@b@ this.tag = tag;@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException {@b@ v.visit(this);@b@ }@b@@b@ public String getName() {@b@ return this.name;@b@ }@b@@b@ public Node.CustomTag getTag() {@b@ return this.tag;@b@ }@b@ }@b@@b@ public static class CustomTag extends Node@b@ {@b@ private String uri;@b@ private String prefix;@b@ private Node.JspAttribute[] jspAttrs;@b@ private TagData tagData;@b@ private String tagHandlerPoolName;@b@ private TagInfo tagInfo;@b@ private TagFileInfo tagFileInfo;@b@ private Class tagHandlerClass;@b@ private VariableInfo[] varInfos;@b@ private int customNestingLevel;@b@ private Node.ChildInfo childInfo;@b@ private boolean implementsIterationTag;@b@ private boolean implementsBodyTag;@b@ private boolean implementsTryCatchFinally;@b@ private boolean implementsSimpleTag;@b@ private boolean implementsDynamicAttributes;@b@ private java.util.Vector atBeginScriptingVars;@b@ private java.util.Vector atEndScriptingVars;@b@ private java.util.Vector nestedScriptingVars;@b@ private CustomTag customTagParent;@b@ private Integer numCount;@b@ private boolean useTagPlugin;@b@ private TagPluginContext tagPluginContext;@b@ private Node.Nodes atSTag;@b@ private Node.Nodes atETag;@b@@b@ public CustomTag(String qName, String prefix, String localName, String uri, Attributes attrs, Mark start, Node parent, TagInfo tagInfo, Class tagHandlerClass)@b@ {@b@ this(qName, prefix, localName, uri, attrs, null, null, start, parent, tagInfo, tagHandlerClass);@b@ }@b@@b@ public CustomTag(String qName, String prefix, String localName, String uri, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent, TagInfo tagInfo, Class tagHandlerClass)@b@ {@b@ super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@@b@ this.uri = uri;@b@ this.prefix = prefix;@b@ this.tagInfo = tagInfo;@b@ this.tagHandlerClass = tagHandlerClass;@b@ this.customNestingLevel = makeCustomNestingLevel();@b@ this.childInfo = new Node.ChildInfo();@b@@b@ this.implementsIterationTag = ((Node.class$javax$servlet$jsp$tagext$IterationTag == null) ? (Node.class$javax$servlet$jsp$tagext$IterationTag = Node.class$("javax.servlet.jsp.tagext.IterationTag")) : Node.class$javax$servlet$jsp$tagext$IterationTag).isAssignableFrom(tagHandlerClass);@b@@b@ this.implementsBodyTag = ((Node.class$javax$servlet$jsp$tagext$BodyTag == null) ? (Node.class$javax$servlet$jsp$tagext$BodyTag = Node.class$("javax.servlet.jsp.tagext.BodyTag")) : Node.class$javax$servlet$jsp$tagext$BodyTag).isAssignableFrom(tagHandlerClass);@b@@b@ this.implementsTryCatchFinally = ((Node.class$javax$servlet$jsp$tagext$TryCatchFinally == null) ? (Node.class$javax$servlet$jsp$tagext$TryCatchFinally = Node.class$("javax.servlet.jsp.tagext.TryCatchFinally")) : Node.class$javax$servlet$jsp$tagext$TryCatchFinally).isAssignableFrom(tagHandlerClass);@b@@b@ this.implementsSimpleTag = ((Node.class$javax$servlet$jsp$tagext$SimpleTag == null) ? (Node.class$javax$servlet$jsp$tagext$SimpleTag = Node.class$("javax.servlet.jsp.tagext.SimpleTag")) : Node.class$javax$servlet$jsp$tagext$SimpleTag).isAssignableFrom(tagHandlerClass);@b@@b@ this.implementsDynamicAttributes = ((Node.class$javax$servlet$jsp$tagext$DynamicAttributes == null) ? (Node.class$javax$servlet$jsp$tagext$DynamicAttributes = Node.class$("javax.servlet.jsp.tagext.DynamicAttributes")) : Node.class$javax$servlet$jsp$tagext$DynamicAttributes).isAssignableFrom(tagHandlerClass);@b@ }@b@@b@ public CustomTag(String qName, String prefix, String localName, String uri, Attributes attrs, Mark start, Node parent, TagFileInfo tagFileInfo)@b@ {@b@ this(qName, prefix, localName, uri, attrs, null, null, start, parent, tagFileInfo);@b@ }@b@@b@ public CustomTag(String qName, String prefix, String localName, String uri, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent, TagFileInfo tagFileInfo)@b@ {@b@ super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@@b@ this.uri = uri;@b@ this.prefix = prefix;@b@ this.tagFileInfo = tagFileInfo;@b@ this.tagInfo = tagFileInfo.getTagInfo();@b@ this.customNestingLevel = makeCustomNestingLevel();@b@ this.childInfo = new Node.ChildInfo();@b@@b@ this.implementsIterationTag = false;@b@ this.implementsBodyTag = false;@b@ this.implementsTryCatchFinally = false;@b@ this.implementsSimpleTag = true;@b@ this.implementsDynamicAttributes = this.tagInfo.hasDynamicAttributes();@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException {@b@ v.visit(this);@b@ }@b@@b@ public String getURI()@b@ {@b@ return this.uri;@b@ }@b@@b@ public String getPrefix()@b@ {@b@ return this.prefix;@b@ }@b@@b@ public void setJspAttributes(Node.JspAttribute[] jspAttrs) {@b@ this.jspAttrs = jspAttrs;@b@ }@b@@b@ public Node.JspAttribute[] getJspAttributes() {@b@ return this.jspAttrs;@b@ }@b@@b@ public Node.ChildInfo getChildInfo() {@b@ return this.childInfo;@b@ }@b@@b@ public void setTagData(TagData tagData) {@b@ this.tagData = tagData;@b@ this.varInfos = this.tagInfo.getVariableInfo(tagData);@b@ if (this.varInfos == null)@b@ this.varInfos = Node.access$000();@b@ }@b@@b@ public TagData getTagData()@b@ {@b@ return this.tagData;@b@ }@b@@b@ public void setTagHandlerPoolName(String s) {@b@ this.tagHandlerPoolName = s;@b@ }@b@@b@ public String getTagHandlerPoolName() {@b@ return this.tagHandlerPoolName;@b@ }@b@@b@ public TagInfo getTagInfo() {@b@ return this.tagInfo;@b@ }@b@@b@ public TagFileInfo getTagFileInfo() {@b@ return this.tagFileInfo;@b@ }@b@@b@ public boolean isTagFile()@b@ {@b@ return (this.tagFileInfo != null);@b@ }@b@@b@ public Class getTagHandlerClass() {@b@ return this.tagHandlerClass;@b@ }@b@@b@ public void setTagHandlerClass(Class hc) {@b@ this.tagHandlerClass = hc;@b@ }@b@@b@ public boolean implementsIterationTag() {@b@ return this.implementsIterationTag;@b@ }@b@@b@ public boolean implementsBodyTag() {@b@ return this.implementsBodyTag;@b@ }@b@@b@ public boolean implementsTryCatchFinally() {@b@ return this.implementsTryCatchFinally;@b@ }@b@@b@ public boolean implementsSimpleTag() {@b@ return this.implementsSimpleTag;@b@ }@b@@b@ public boolean implementsDynamicAttributes() {@b@ return this.implementsDynamicAttributes;@b@ }@b@@b@ public TagVariableInfo[] getTagVariableInfos() {@b@ return this.tagInfo.getTagVariableInfos();@b@ }@b@@b@ public VariableInfo[] getVariableInfos() {@b@ return this.varInfos;@b@ }@b@@b@ public void setCustomTagParent(CustomTag n) {@b@ this.customTagParent = n;@b@ }@b@@b@ public CustomTag getCustomTagParent() {@b@ return this.customTagParent;@b@ }@b@@b@ public void setNumCount(Integer count) {@b@ this.numCount = count;@b@ }@b@@b@ public Integer getNumCount() {@b@ return this.numCount;@b@ }@b@@b@ public void setScriptingVars(java.util.Vector vec, int scope) {@b@ switch (scope)@b@ {@b@ case 1:@b@ this.atBeginScriptingVars = vec;@b@ break;@b@ case 2:@b@ this.atEndScriptingVars = vec;@b@ break;@b@ case 0:@b@ this.nestedScriptingVars = vec;@b@ }@b@ }@b@@b@ public java.util.Vector getScriptingVars(int scope)@b@ {@b@ java.util.Vector vec = null;@b@@b@ switch (scope)@b@ {@b@ case 1:@b@ vec = this.atBeginScriptingVars;@b@ break;@b@ case 2:@b@ vec = this.atEndScriptingVars;@b@ break;@b@ case 0:@b@ vec = this.nestedScriptingVars;@b@ }@b@@b@ return vec;@b@ }@b@@b@ public int getCustomNestingLevel()@b@ {@b@ return this.customNestingLevel;@b@ }@b@@b@ public boolean checkIfAttributeIsJspFragment(String name)@b@ {@b@ boolean result = false;@b@@b@ TagAttributeInfo[] attributes = this.tagInfo.getAttributes();@b@ for (int i = 0; i < attributes.length; ++i)@b@ if ((attributes[i].getName().equals(name)) && (attributes[i].isFragment()))@b@ {@b@ result = true;@b@ break;@b@ }@b@@b@@b@ return result;@b@ }@b@@b@ public void setUseTagPlugin(boolean use) {@b@ this.useTagPlugin = use;@b@ }@b@@b@ public boolean useTagPlugin() {@b@ return this.useTagPlugin;@b@ }@b@@b@ public void setTagPluginContext(TagPluginContext tagPluginContext) {@b@ this.tagPluginContext = tagPluginContext;@b@ }@b@@b@ public TagPluginContext getTagPluginContext() {@b@ return this.tagPluginContext;@b@ }@b@@b@ public void setAtSTag(Node.Nodes sTag) {@b@ this.atSTag = sTag;@b@ }@b@@b@ public Node.Nodes getAtSTag() {@b@ return this.atSTag;@b@ }@b@@b@ public void setAtETag(Node.Nodes eTag) {@b@ this.atETag = eTag;@b@ }@b@@b@ public Node.Nodes getAtETag() {@b@ return this.atETag;@b@ }@b@@b@ private int makeCustomNestingLevel()@b@ {@b@ int n = 0;@b@ Node p = this.parent;@b@ while (p != null) {@b@ if ((p instanceof CustomTag) && (this.qName.equals(((CustomTag)p).qName)))@b@ {@b@ ++n;@b@ }@b@ p = p.parent;@b@ }@b@ return n;@b@ }@b@@b@ public boolean hasEmptyBody()@b@ {@b@ int i;@b@ boolean hasEmptyBody = true;@b@ Node.Nodes nodes = getBody();@b@ if (nodes != null) {@b@ int numChildNodes = nodes.size();@b@ for (i = 0; i < numChildNodes; ++i) {@b@ Node n = nodes.getNode(i);@b@ if (!(n instanceof Node.NamedAttribute)) {@b@ if (n instanceof Node.JspBody) {@b@ hasEmptyBody = n.getBody() == null; break;@b@ }@b@ hasEmptyBody = false;@b@@b@ break;@b@ }@b@ }@b@ }@b@@b@ return hasEmptyBody;@b@ }@b@ }@b@@b@ public static class ChildInfo@b@ {@b@ private boolean scriptless;@b@ private boolean hasUseBean;@b@ private boolean hasIncludeAction;@b@ private boolean hasParamAction;@b@ private boolean hasSetProperty;@b@ private boolean hasScriptingVars;@b@@b@ public void setScriptless(boolean s)@b@ {@b@ this.scriptless = s;@b@ }@b@@b@ public boolean isScriptless() {@b@ return this.scriptless;@b@ }@b@@b@ public void setHasUseBean(boolean u) {@b@ this.hasUseBean = u;@b@ }@b@@b@ public boolean hasUseBean() {@b@ return this.hasUseBean;@b@ }@b@@b@ public void setHasIncludeAction(boolean i) {@b@ this.hasIncludeAction = i;@b@ }@b@@b@ public boolean hasIncludeAction() {@b@ return this.hasIncludeAction;@b@ }@b@@b@ public void setHasParamAction(boolean i) {@b@ this.hasParamAction = i;@b@ }@b@@b@ public boolean hasParamAction() {@b@ return this.hasParamAction;@b@ }@b@@b@ public void setHasSetProperty(boolean s) {@b@ this.hasSetProperty = s;@b@ }@b@@b@ public boolean hasSetProperty() {@b@ return this.hasSetProperty;@b@ }@b@@b@ public void setHasScriptingVars(boolean s) {@b@ this.hasScriptingVars = s;@b@ }@b@@b@ public boolean hasScriptingVars() {@b@ return this.hasScriptingVars;@b@ }@b@ }@b@@b@ public static class JspOutput extends Node@b@ {@b@ public JspOutput(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "output", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class JspElement extends Node@b@ {@b@ private Node.JspAttribute[] jspAttrs;@b@ private Node.JspAttribute nameAttr;@b@@b@ public JspElement(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:element", attrs, null, null, start, parent);@b@ }@b@@b@ public JspElement(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "element", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@@b@ public void setJspAttributes(Node.JspAttribute[] jspAttrs) {@b@ this.jspAttrs = jspAttrs;@b@ }@b@@b@ public Node.JspAttribute[] getJspAttributes() {@b@ return this.jspAttrs;@b@ }@b@@b@ public void setNameAttribute(Node.JspAttribute nameAttr)@b@ {@b@ this.nameAttr = nameAttr;@b@ }@b@@b@ public Node.JspAttribute getNameAttribute()@b@ {@b@ return this.nameAttr;@b@ }@b@ }@b@@b@ public static class UninterpretedTag extends Node@b@ {@b@ private Node.JspAttribute[] jspAttrs;@b@@b@ public UninterpretedTag(String qName, String localName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@@b@ public void setJspAttributes(Node.JspAttribute[] jspAttrs) {@b@ this.jspAttrs = jspAttrs;@b@ }@b@@b@ public Node.JspAttribute[] getJspAttributes() {@b@ return this.jspAttrs;@b@ }@b@ }@b@@b@ public static class PlugIn extends Node@b@ {@b@ private Node.JspAttribute width;@b@ private Node.JspAttribute height;@b@@b@ public PlugIn(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:plugin", attrs, null, null, start, parent);@b@ }@b@@b@ public PlugIn(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "plugin", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@@b@ public void setHeight(Node.JspAttribute height) {@b@ this.height = height;@b@ }@b@@b@ public void setWidth(Node.JspAttribute width) {@b@ this.width = width;@b@ }@b@@b@ public Node.JspAttribute getHeight() {@b@ return this.height;@b@ }@b@@b@ public Node.JspAttribute getWidth() {@b@ return this.width;@b@ }@b@ }@b@@b@ public static class UseBean extends Node@b@ {@b@ Node.JspAttribute beanName;@b@@b@ public UseBean(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:useBean", attrs, null, null, start, parent);@b@ }@b@@b@ public UseBean(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "useBean", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@@b@ public void setBeanName(Node.JspAttribute beanName) {@b@ this.beanName = beanName;@b@ }@b@@b@ public Node.JspAttribute getBeanName() {@b@ return this.beanName;@b@ }@b@ }@b@@b@ public static class SetProperty extends Node@b@ {@b@ private Node.JspAttribute value;@b@@b@ public SetProperty(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:setProperty", attrs, null, null, start, parent);@b@ }@b@@b@ public SetProperty(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "setProperty", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@@b@ public void setValue(Node.JspAttribute value) {@b@ this.value = value;@b@ }@b@@b@ public Node.JspAttribute getValue() {@b@ return this.value;@b@ }@b@ }@b@@b@ public static class GetProperty extends Node@b@ {@b@ public GetProperty(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:getProperty", attrs, null, null, start, parent);@b@ }@b@@b@ public GetProperty(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "getProperty", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class ForwardAction extends Node@b@ {@b@ private Node.JspAttribute page;@b@@b@ public ForwardAction(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:forward", attrs, null, null, start, parent);@b@ }@b@@b@ public ForwardAction(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "forward", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@@b@ public void setPage(Node.JspAttribute page) {@b@ this.page = page;@b@ }@b@@b@ public Node.JspAttribute getPage() {@b@ return this.page;@b@ }@b@ }@b@@b@ public static class IncludeAction extends Node@b@ {@b@ private Node.JspAttribute page;@b@@b@ public IncludeAction(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:include", attrs, null, null, start, parent);@b@ }@b@@b@ public IncludeAction(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "include", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@@b@ public void setPage(Node.JspAttribute page) {@b@ this.page = page;@b@ }@b@@b@ public Node.JspAttribute getPage() {@b@ return this.page;@b@ }@b@ }@b@@b@ public static class FallBackAction extends Node@b@ {@b@ public FallBackAction(Mark start, Node parent)@b@ {@b@ this("jsp:fallback", null, null, start, parent);@b@ }@b@@b@ public FallBackAction(String qName, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "fallback", null, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class ParamsAction extends Node@b@ {@b@ public ParamsAction(Mark start, Node parent)@b@ {@b@ this("jsp:params", null, null, start, parent);@b@ }@b@@b@ public ParamsAction(String qName, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "params", null, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class ParamAction extends Node@b@ {@b@ Node.JspAttribute value;@b@@b@ public ParamAction(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:param", attrs, null, null, start, parent);@b@ }@b@@b@ public ParamAction(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "param", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@@b@ public void setValue(Node.JspAttribute value) {@b@ this.value = value;@b@ }@b@@b@ public Node.JspAttribute getValue() {@b@ return this.value;@b@ }@b@ }@b@@b@ public static class ELExpression extends Node@b@ {@b@ private ELNode.Nodes el;@b@@b@ public ELExpression(String text, Mark start, Node parent)@b@ {@b@ super(null, null, text, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException {@b@ v.visit(this);@b@ }@b@@b@ public void setEL(ELNode.Nodes el) {@b@ this.el = el;@b@ }@b@@b@ public ELNode.Nodes getEL() {@b@ return this.el;@b@ }@b@ }@b@@b@ public static class Scriptlet extends Node.ScriptingElement@b@ {@b@ public Scriptlet(String text, Mark start, Node parent)@b@ {@b@ super("jsp:scriptlet", "scriptlet", text, start, parent);@b@ }@b@@b@ public Scriptlet(String qName, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "scriptlet", nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class Expression extends Node.ScriptingElement@b@ {@b@ public Expression(String text, Mark start, Node parent)@b@ {@b@ super("jsp:expression", "expression", text, start, parent);@b@ }@b@@b@ public Expression(String qName, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "expression", nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class Declaration extends Node.ScriptingElement@b@ {@b@ public Declaration(String text, Mark start, Node parent)@b@ {@b@ super("jsp:declaration", "declaration", text, start, parent);@b@ }@b@@b@ public Declaration(String qName, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "declaration", nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static abstract class ScriptingElement extends Node@b@ {@b@ public ScriptingElement(String qName, String localName, String text, Mark start, Node parent)@b@ {@b@ super(qName, localName, text, start, parent);@b@ }@b@@b@ public ScriptingElement(String qName, String localName, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, localName, null, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public String getText()@b@ {@b@ String ret = this.text;@b@ if ((ret == null) && (this.body != null)) {@b@ StringBuffer buf = new StringBuffer();@b@ for (int i = 0; i < this.body.size(); ++i)@b@ buf.append(this.body.getNode(i).getText());@b@@b@ ret = buf.toString();@b@ }@b@ return ret;@b@ }@b@@b@ public Mark getStart()@b@ {@b@ if ((this.text == null) && (this.body != null) && (this.body.size() > 0))@b@ return this.body.getNode(0).getStart();@b@@b@ return super.getStart();@b@ }@b@ }@b@@b@ public static class Comment extends Node@b@ {@b@ public Comment(String text, Mark start, Node parent)@b@ {@b@ super(null, null, text, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class DoBodyAction extends Node@b@ {@b@ public DoBodyAction(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:doBody", attrs, null, null, start, parent);@b@ }@b@@b@ public DoBodyAction(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "doBody", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class InvokeAction extends Node@b@ {@b@ public InvokeAction(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:invoke", attrs, null, null, start, parent);@b@ }@b@@b@ public InvokeAction(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "invoke", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class VariableDirective extends Node@b@ {@b@ public VariableDirective(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:directive.variable", attrs, null, null, start, parent);@b@ }@b@@b@ public VariableDirective(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "directive.variable", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class AttributeDirective extends Node@b@ {@b@ public AttributeDirective(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:directive.attribute", attrs, null, null, start, parent);@b@ }@b@@b@ public AttributeDirective(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "directive.attribute", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class TagDirective extends Node@b@ {@b@ private java.util.Vector imports;@b@@b@ public TagDirective(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:directive.tag", attrs, null, null, start, parent);@b@ }@b@@b@ public TagDirective(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "directive.tag", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@@b@ this.imports = new java.util.Vector();@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException {@b@ v.visit(this);@b@ }@b@@b@ public void addImport(String value)@b@ {@b@ int start = 0;@b@@b@ while ((index = value.indexOf(44, start)) != -1) {@b@ int index;@b@ this.imports.add(value.substring(start, index).trim());@b@ start = index + 1;@b@ }@b@ if (start == 0)@b@ {@b@ this.imports.add(value.trim());@b@ }@b@ else this.imports.add(value.substring(start).trim());@b@ }@b@@b@ public List getImports()@b@ {@b@ return this.imports;@b@ }@b@ }@b@@b@ public static class TaglibDirective extends Node@b@ {@b@ public TaglibDirective(Attributes attrs, Mark start, Node parent)@b@ {@b@ super("jsp:taglib", "taglib", attrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class IncludeDirective extends Node@b@ {@b@ public IncludeDirective(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:directive.include", attrs, null, null, start, parent);@b@ }@b@@b@ public IncludeDirective(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "directive.include", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class PageDirective extends Node@b@ {@b@ private java.util.Vector imports;@b@@b@ public PageDirective(Attributes attrs, Mark start, Node parent)@b@ {@b@ this("jsp:directive.page", attrs, null, null, start, parent);@b@ }@b@@b@ public PageDirective(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "directive.page", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@@b@ this.imports = new java.util.Vector();@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException {@b@ v.visit(this);@b@ }@b@@b@ public void addImport(String value)@b@ {@b@ int start = 0;@b@@b@ while ((index = value.indexOf(44, start)) != -1) {@b@ int index;@b@ this.imports.add(value.substring(start, index).trim());@b@ start = index + 1;@b@ }@b@ if (start == 0)@b@ {@b@ this.imports.add(value.trim());@b@ }@b@ else this.imports.add(value.substring(start).trim());@b@ }@b@@b@ public List getImports()@b@ {@b@ return this.imports;@b@ }@b@ }@b@@b@ public static class JspRoot extends Node@b@ {@b@ public JspRoot(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent)@b@ {@b@ super(qName, "root", attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException@b@ {@b@ v.visit(this);@b@ }@b@ }@b@@b@ public static class Root extends Node@b@ {@b@ private Root parentRoot;@b@ private boolean isXmlSyntax;@b@ private String pageEnc;@b@ private String jspConfigPageEnc;@b@ private boolean isDefaultPageEncoding;@b@ private boolean isEncodingSpecifiedInProlog;@b@@b@ Root(Mark start, Node parent, boolean isXmlSyntax)@b@ {@b@ super(start, parent);@b@ this.isXmlSyntax = isXmlSyntax;@b@ this.qName = "jsp:root";@b@ this.localName = "root";@b@@b@ Node r = parent;@b@ while ((r != null) && (!(r instanceof Root)))@b@ r = r.getParent();@b@ this.parentRoot = ((Root)r);@b@ }@b@@b@ public void accept(Node.Visitor v) throws JasperException {@b@ v.visit(this);@b@ }@b@@b@ public boolean isXmlSyntax() {@b@ return this.isXmlSyntax;@b@ }@b@@b@ public void setJspConfigPageEncoding(String enc)@b@ {@b@ this.jspConfigPageEnc = enc;@b@ }@b@@b@ public String getJspConfigPageEncoding()@b@ {@b@ return this.jspConfigPageEnc;@b@ }@b@@b@ public void setPageEncoding(String enc) {@b@ this.pageEnc = enc;@b@ }@b@@b@ public String getPageEncoding() {@b@ return this.pageEnc;@b@ }@b@@b@ public void setIsDefaultPageEncoding(boolean isDefault) {@b@ this.isDefaultPageEncoding = isDefault;@b@ }@b@@b@ public boolean isDefaultPageEncoding() {@b@ return this.isDefaultPageEncoding;@b@ }@b@@b@ public void setIsEncodingSpecifiedInProlog(boolean isSpecified) {@b@ this.isEncodingSpecifiedInProlog = isSpecified;@b@ }@b@@b@ public boolean isEncodingSpecifiedInProlog() {@b@ return this.isEncodingSpecifiedInProlog;@b@ }@b@@b@ public Root getParentRoot()@b@ {@b@ return this.parentRoot;@b@ }@b@ }@b@}
package org.apache.jasper.compiler;@b@@b@public abstract interface TagConstants@b@{@b@ public static final String JSP_URI = "http://java.sun.com/JSP/Page";@b@ public static final String DIRECTIVE_ACTION = "directive.";@b@ public static final String ROOT_ACTION = "root";@b@ public static final String JSP_ROOT_ACTION = "jsp:root";@b@ public static final String PAGE_DIRECTIVE_ACTION = "directive.page";@b@ public static final String JSP_PAGE_DIRECTIVE_ACTION = "jsp:directive.page";@b@ public static final String INCLUDE_DIRECTIVE_ACTION = "directive.include";@b@ public static final String JSP_INCLUDE_DIRECTIVE_ACTION = "jsp:directive.include";@b@ public static final String DECLARATION_ACTION = "declaration";@b@ public static final String JSP_DECLARATION_ACTION = "jsp:declaration";@b@ public static final String SCRIPTLET_ACTION = "scriptlet";@b@ public static final String JSP_SCRIPTLET_ACTION = "jsp:scriptlet";@b@ public static final String EXPRESSION_ACTION = "expression";@b@ public static final String JSP_EXPRESSION_ACTION = "jsp:expression";@b@ public static final String USE_BEAN_ACTION = "useBean";@b@ public static final String JSP_USE_BEAN_ACTION = "jsp:useBean";@b@ public static final String SET_PROPERTY_ACTION = "setProperty";@b@ public static final String JSP_SET_PROPERTY_ACTION = "jsp:setProperty";@b@ public static final String GET_PROPERTY_ACTION = "getProperty";@b@ public static final String JSP_GET_PROPERTY_ACTION = "jsp:getProperty";@b@ public static final String INCLUDE_ACTION = "include";@b@ public static final String JSP_INCLUDE_ACTION = "jsp:include";@b@ public static final String FORWARD_ACTION = "forward";@b@ public static final String JSP_FORWARD_ACTION = "jsp:forward";@b@ public static final String PARAM_ACTION = "param";@b@ public static final String JSP_PARAM_ACTION = "jsp:param";@b@ public static final String PARAMS_ACTION = "params";@b@ public static final String JSP_PARAMS_ACTION = "jsp:params";@b@ public static final String PLUGIN_ACTION = "plugin";@b@ public static final String JSP_PLUGIN_ACTION = "jsp:plugin";@b@ public static final String FALLBACK_ACTION = "fallback";@b@ public static final String JSP_FALLBACK_ACTION = "jsp:fallback";@b@ public static final String TEXT_ACTION = "text";@b@ public static final String JSP_TEXT_ACTION = "jsp:text";@b@ public static final String JSP_TEXT_ACTION_END = "</jsp:text>";@b@ public static final String ATTRIBUTE_ACTION = "attribute";@b@ public static final String JSP_ATTRIBUTE_ACTION = "jsp:attribute";@b@ public static final String BODY_ACTION = "body";@b@ public static final String JSP_BODY_ACTION = "jsp:body";@b@ public static final String ELEMENT_ACTION = "element";@b@ public static final String JSP_ELEMENT_ACTION = "jsp:element";@b@ public static final String OUTPUT_ACTION = "output";@b@ public static final String JSP_OUTPUT_ACTION = "jsp:output";@b@ public static final String TAGLIB_DIRECTIVE_ACTION = "taglib";@b@ public static final String JSP_TAGLIB_DIRECTIVE_ACTION = "jsp:taglib";@b@ public static final String INVOKE_ACTION = "invoke";@b@ public static final String JSP_INVOKE_ACTION = "jsp:invoke";@b@ public static final String DOBODY_ACTION = "doBody";@b@ public static final String JSP_DOBODY_ACTION = "jsp:doBody";@b@ public static final String TAG_DIRECTIVE_ACTION = "directive.tag";@b@ public static final String JSP_TAG_DIRECTIVE_ACTION = "jsp:directive.tag";@b@ public static final String ATTRIBUTE_DIRECTIVE_ACTION = "directive.attribute";@b@ public static final String JSP_ATTRIBUTE_DIRECTIVE_ACTION = "jsp:directive.attribute";@b@ public static final String VARIABLE_DIRECTIVE_ACTION = "directive.variable";@b@ public static final String JSP_VARIABLE_DIRECTIVE_ACTION = "jsp:directive.variable";@b@ public static final String URN_JSPTAGDIR = "urn:jsptagdir:";@b@ public static final String URN_JSPTLD = "urn:jsptld:";@b@}