org.apache.jasper.compiler
public class JspUtil extends Object
Nested Class Summary | |
---|---|
static class | JspUtil.ValidAttribute |
Field Summary | |
---|---|
static int | CHUNKSIZE |
Method Summary | |
---|---|
static boolean | booleanValue(String s)
Convert a String value to 'boolean'.
|
static void | checkAttributes(String typeOfTag, Node n, JspUtil.ValidAttribute[] validAttributes, ErrorDispatcher err)
Checks if all mandatory attributes are present and if all attributes
present have valid names. |
static void | checkScope(String scope, Node n, ErrorDispatcher err)
Checks to see if the given scope is valid.
|
static String | coerceToBoolean(String s, boolean isNamedAttribute) |
static String | coerceToByte(String s, boolean isNamedAttribute) |
static String | coerceToChar(String s, boolean isNamedAttribute) |
static String | coerceToCharacter(String s, boolean isNamedAttribute) |
static String | coerceToDouble(String s, boolean isNamedAttribute) |
static String | coerceToFloat(String s, boolean isNamedAttribute) |
static String | coerceToInt(String s, boolean isNamedAttribute) |
static String | coerceToInteger(String s, boolean isNamedAttribute) |
static String | coerceToLong(String s, boolean isNamedAttribute) |
static String | coerceToPrimitiveBoolean(String s, boolean isNamedAttribute) |
static String | coerceToPrimitiveByte(String s, boolean isNamedAttribute) |
static String | coerceToPrimitiveDouble(String s, boolean isNamedAttribute) |
static String | coerceToPrimitiveFloat(String s, boolean isNamedAttribute) |
static String | coerceToPrimitiveLong(String s, boolean isNamedAttribute) |
static String | coerceToPrimitiveShort(String s, boolean isNamedAttribute) |
static String | coerceToShort(String s, boolean isNamedAttribute) |
static String | escapeQueryString(String unescString) |
static char[] | escapeQuotes(char[] chars) |
static String | escapeXml(String s)
Escape the 5 entities defined by XML. |
static String | getCanonicalName(Class c)
Compute the canonical name from a Class instance. |
static String | getExpr(String expression, boolean isXml) |
static String | getExprInXml(String expression)
Takes a potential expression and converts it into XML form |
static InputStream | getInputStream(String fname, JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err) |
static String | getTagHandlerClassName(String path, ErrorDispatcher err)
Gets the fully-qualified class name of the tag handler corresponding to
the given tag file path.
|
static String | getTagHandlerClassName(String path, String urn, ErrorDispatcher err)
Gets the fully-qualified class name of the tag handler corresponding to
the given tag file path.
|
static String | interpreterCall(boolean isTagFile, String expression, Class expectedType, String fnmapvar, boolean XmlEscape)
Produces a String representing a call to the EL interpreter. |
static boolean | isExpression(String token, boolean isXml)
Checks if the token is a runtime expression.
|
static boolean | isJavaKeyword(String key)
Test whether the argument is a Java keyword |
static String | makeJavaIdentifier(String identifier)
Converts the given identifier to a legal Java identifier
|
static String | makeJavaPackage(String path)
Converts the given path to a Java package or fully-qualified class name
|
static String | makeXmlJavaIdentifier(String name)
Converts the given Xml name to a legal Java identifier. |
static String | mangleChar(char ch)
Mangle the specified character to create a legal Java class name. |
static String | nextTemporaryVariableName()
Generates a new temporary variable name.
(not thread-safe) |
static char[] | removeQuotes(char[] chars) |
static String | replace(String name, char replace, String with)
Replaces any occurrences of the character replace with the
string with. |
static void | resetTemporaryVariableName()
Resets the temporary variable name.
(not thread-safe) |
static Class | toClass(String type, ClassLoader loader)
Returns the Class object associated with the class or
interface with the given string name.
|
static String | toJavaSourceType(String type)
Class.getName() return arrays in the form "[[[ |
static String | toJavaSourceTypeFromTld(String type)
Handles taking input from TLDs
'java.lang.Object' -> 'java.lang.Object.class'
'int' -> 'int.class'
'void' -> 'Void.TYPE'
'int[]' -> 'int[].class'
|
static void | validateExpressions(Mark where, String expressions, Class expectedType, FunctionMapper functionMapper, ErrorDispatcher err)
Validates the syntax of all ${} expressions within the given string. |
Parameters: s the string to be converted
Returns: the boolean value associated with the string s
Parameters: scope The scope to be checked n The Node containing the 'scope' attribute whose value is to be checked err error dispatcher
Throws: JasperException if scope is not null and different from "page", "request", "session", and "application"
Parameters: c A instance of java.lang.Class
Returns: The canonical name of c.
Returns: the "expression" part of a runtime expression, taking the delimiters out.
Deprecated: Use JspUtil See https://issues.apache.org/bugzilla/show_bug.cgi?id=46471
Gets the fully-qualified class name of the tag handler corresponding to the given tag file path.Parameters: path Tag file path err Error dispatcher
Returns: Fully-qualified class name of the tag handler corresponding to the given tag file path
Parameters: path Tag file path err Error dispatcher
Returns: Fully-qualified class name of the tag handler corresponding to the given tag file path
Parameters: expression a String containing zero or more "${}" expressions expectedType the expected type of the interpreted result fnmapvar Variable pointing to a function map. XmlEscape True if the result should do XML escaping
Returns: a String representing a call to the EL interpreter.
Parameters: token The token to be checked return whether the token is a runtime expression or not.
Parameters: identifier Identifier to convert
Returns: Legal Java identifier corresponding to the given identifier
Parameters: path Path to convert
Returns: Java package corresponding to the given path
Parameters: name Identifier to convert
Returns: Legal Java identifier corresponding to the given identifier
Deprecated:
Generates a new temporary variable name. (not thread-safe)Deprecated:
Resets the temporary variable name. (not thread-safe)The Class object is determined by passing the given string name to the Class.forName() method, unless the given string name represents a primitive type, in which case it is converted to a Class object by appending ".class" to it (e.g., "int.class").
Parameters: type
Returns:
Deprecated: now delegated to the org.apache.el Package
Validates the syntax of all ${} expressions within the given string.Parameters: where the approximate location of the expressions in the JSP page expressions a string containing zero or more "${}" expressions err an error dispatcher to use