Home » apache-tomcat-6.0.26-src » org.apache » jasper » compiler » [javadoc | source]
org.apache.jasper.compiler
public class: JspUtil [javadoc | source]
java.lang.Object
   org.apache.jasper.compiler.JspUtil
This class has all the utility method(s). Ideally should move all the bean containers here.
Nested Class Summary:
public static class  JspUtil.ValidAttribute   
Field Summary
public static final  int CHUNKSIZE     
Method from org.apache.jasper.compiler.JspUtil Summary:
booleanValue,   checkAttributes,   checkScope,   coerceToBoolean,   coerceToByte,   coerceToChar,   coerceToCharacter,   coerceToDouble,   coerceToFloat,   coerceToInt,   coerceToInteger,   coerceToLong,   coerceToPrimitiveBoolean,   coerceToPrimitiveByte,   coerceToPrimitiveDouble,   coerceToPrimitiveFloat,   coerceToPrimitiveLong,   coerceToPrimitiveShort,   coerceToShort,   escapeQueryString,   escapeQuotes,   escapeXml,   getCanonicalName,   getExpr,   getExprInXml,   getInputStream,   getReader,   getReader,   getTagHandlerClassName,   getTagHandlerClassName,   interpreterCall,   isExpression,   isJavaKeyword,   makeJavaIdentifier,   makeJavaPackage,   makeXmlJavaIdentifier,   mangleChar,   nextTemporaryVariableName,   removeQuotes,   replace,   resetTemporaryVariableName,   toClass,   toJavaSourceType,   toJavaSourceTypeFromTld,   validateExpressions
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jasper.compiler.JspUtil Detail:
 public static boolean booleanValue(String s) 
    Convert a String value to 'boolean'. Besides the standard conversions done by Boolean.valueOf(s).booleanValue(), the value "yes" (ignore case) is also converted to 'true'. If 's' is null, then 'false' is returned.
 public static  void checkAttributes(String typeOfTag,
    Node n,
    ValidAttribute[] validAttributes,
    ErrorDispatcher err) throws JasperException 
    Checks if all mandatory attributes are present and if all attributes present have valid names. Checks attributes specified as XML-style attributes as well as attributes specified using the jsp:attribute standard action.
 public static  void checkScope(String scope,
    Node n,
    ErrorDispatcher err) throws JasperException 
    Checks to see if the given scope is valid.
 public static String coerceToBoolean(String s,
    boolean isNamedAttribute) 
 public static String coerceToByte(String s,
    boolean isNamedAttribute) 
 public static String coerceToChar(String s,
    boolean isNamedAttribute) 
 public static String coerceToCharacter(String s,
    boolean isNamedAttribute) 
 public static String coerceToDouble(String s,
    boolean isNamedAttribute) 
 public static String coerceToFloat(String s,
    boolean isNamedAttribute) 
 public static String coerceToInt(String s,
    boolean isNamedAttribute) 
 public static String coerceToInteger(String s,
    boolean isNamedAttribute) 
 public static String coerceToLong(String s,
    boolean isNamedAttribute) 
 public static String coerceToPrimitiveBoolean(String s,
    boolean isNamedAttribute) 
 public static String coerceToPrimitiveByte(String s,
    boolean isNamedAttribute) 
 public static String coerceToPrimitiveDouble(String s,
    boolean isNamedAttribute) 
 public static String coerceToPrimitiveFloat(String s,
    boolean isNamedAttribute) 
 public static String coerceToPrimitiveLong(String s,
    boolean isNamedAttribute) 
 public static String coerceToPrimitiveShort(String s,
    boolean isNamedAttribute) 
 public static String coerceToShort(String s,
    boolean isNamedAttribute) 
 public static String escapeQueryString(String unescString) 
 public static char[] escapeQuotes(char[] chars) 
 public static String escapeXml(String s) 
    Escape the 5 entities defined by XML.
 public static String getCanonicalName(Class c) 
    Compute the canonical name from a Class instance. Note that a simple replacment of '$' with '.' of a binary name would not work, as '$' is a legal Java Identifier character.
 public static String getExpr(String expression,
    boolean isXml) 
 public static String getExprInXml(String expression) 
    Takes a potential expression and converts it into XML form
 public static InputStream getInputStream(String fname,
    JarFile jarFile,
    JspCompilationContext ctxt,
    ErrorDispatcher err) throws JasperException, IOException 
 static InputStreamReader getReader(String fname,
    String encoding,
    JarFile jarFile,
    JspCompilationContext ctxt,
    ErrorDispatcher err) throws JasperException, IOException 
 static InputStreamReader getReader(String fname,
    String encoding,
    JarFile jarFile,
    JspCompilationContext ctxt,
    ErrorDispatcher err,
    int skip) throws JasperException, IOException 
 public static String getTagHandlerClassName(String path,
    ErrorDispatcher err) throws JasperException 
Deprecated! Use - #getTagHandlerClassName(String, String, ErrorDispatcher) 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.
 public static String getTagHandlerClassName(String path,
    String urn,
    ErrorDispatcher err) throws JasperException 
    Gets the fully-qualified class name of the tag handler corresponding to the given tag file path.
 public static String interpreterCall(boolean isTagFile,
    String expression,
    Class expectedType,
    String fnmapvar,
    boolean XmlEscape) 
    Produces a String representing a call to the EL interpreter.
 public static boolean isExpression(String token,
    boolean isXml) 
    Checks if the token is a runtime expression. In standard JSP syntax, a runtime expression starts with '<%' and ends with '%>'. When the JSP document is in XML syntax, a runtime expression starts with '%=' and ends with '%'.
 public static boolean isJavaKeyword(String key) 
    Test whether the argument is a Java keyword
 public static final String makeJavaIdentifier(String identifier) 
    Converts the given identifier to a legal Java identifier
 public static final String makeJavaPackage(String path) 
    Converts the given path to a Java package or fully-qualified class name
 public static final String makeXmlJavaIdentifier(String name) 
    Converts the given Xml name to a legal Java identifier. This is slightly more efficient than makeJavaIdentifier in that we only need to worry about '.', '-', and ':' in the string. We also assume that the resultant string is further concatenated with some prefix string so that we don't have to worry about it being a Java key word.
 public static final String mangleChar(char ch) 
    Mangle the specified character to create a legal Java class name.
 public static String nextTemporaryVariableName() 
Deprecated!
    Generates a new temporary variable name. (not thread-safe)
 public static char[] removeQuotes(char[] chars) 
 public static String replace(String name,
    char replace,
    String with) 
    Replaces any occurrences of the character replace with the string with.
 public static  void resetTemporaryVariableName() 
Deprecated!
    Resets the temporary variable name. (not thread-safe)
 public static Class toClass(String type,
    ClassLoader loader) throws ClassNotFoundException 
    Returns the Class object associated with the class or interface with the given string name.

    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").

 public static String toJavaSourceType(String type) 
    Class.getName() return arrays in the form "[[[", where et, the element type can be one of ZBCDFIJS or L; It is converted into forms that can be understood by javac.
 public 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'
 public static  void validateExpressions(Mark where,
    String expressions,
    Class expectedType,
    FunctionMapper functionMapper,
    ErrorDispatcher err) throws JasperException 
Deprecated! now - delegated to the org.apache.el Package

    Validates the syntax of all ${} expressions within the given string.