|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.apache.jasper.compiler.JspUtil
public class JspUtil
This class has all the utility method(s). Ideally should move all the bean containers here.
| 嵌套类摘要 | |
|---|---|
static class |
JspUtil.ValidAttribute
|
| 字段摘要 | |
|---|---|
static int |
CHUNKSIZE
|
| 构造方法摘要 | |
|---|---|
JspUtil()
|
|
| 方法摘要 | |
|---|---|
static boolean |
booleanValue(String s)
Convert a String value to 'boolean'. |
static void |
checkAttributes(String typeOfTag,
org.apache.jasper.compiler.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,
org.apache.jasper.compiler.Node n,
ErrorDispatcher err)
Checks to see if the given scope is valid. |
static Object |
coerce(Class targetType,
String value)
|
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 |
coerceToEnum(String s,
String enumClass,
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 List<String> |
expandClassPath(List<String> files)
Given a list of jar files, their manifest attribute Class-path are scanned, and jars specified there are added to the list. |
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 |
interpreterCall(boolean isTagFile,
String expression,
Class expectedType,
String fnmapvar,
String expectedDeferredType,
String expectedReturnType,
String[] expectedParamTypes)
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. |
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. |
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 void |
validateExpressions(org.apache.jasper.compiler.Mark where,
String expressions,
FunctionMapper functionMapper,
ErrorDispatcher err)
Validates the syntax of all EL expressions within the given string. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
public static final int CHUNKSIZE
| 构造方法详细信息 |
|---|
public JspUtil()
| 方法详细信息 |
|---|
public static char[] removeQuotes(char[] chars)
public static char[] escapeQuotes(char[] chars)
public static boolean isExpression(String token,
boolean isXml)
token - The token to be checked
return whether the token is a runtime expression or not.
public static String getExpr(String expression,
boolean isXml)
public static String getExprInXml(String expression)
public static void checkScope(String scope,
org.apache.jasper.compiler.Node n,
ErrorDispatcher err)
throws JasperException
scope - The scope to be checkedn - The Node containing the 'scope' attribute whose value is to be
checkederr - error dispatcher
JasperException - if scope is not null and different from
"page", "request", "session", and
"application"
public static void checkAttributes(String typeOfTag,
org.apache.jasper.compiler.Node n,
JspUtil.ValidAttribute[] validAttributes,
ErrorDispatcher err)
throws JasperException
JasperExceptionpublic static String escapeQueryString(String unescString)
public static String escapeXml(String s)
public static String replace(String name,
char replace,
String with)
public static boolean booleanValue(String s)
s - the string to be converted
public static Class<?> toClass(String type,
ClassLoader loader)
throws ClassNotFoundException
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").
ClassNotFoundException
public static String interpreterCall(boolean isTagFile,
String expression,
Class expectedType,
String fnmapvar,
String expectedDeferredType,
String expectedReturnType,
String[] expectedParamTypes)
expression - a String containing zero or more "${}" expressionsexpectedType - the expected type of the interpreted resultfnmapvar - Variable pointing to a function map.
public static void validateExpressions(org.apache.jasper.compiler.Mark where,
String expressions,
FunctionMapper functionMapper,
ErrorDispatcher err)
throws JasperException
where - the approximate location of the expressions in the JSP pageexpressions - a string containing an EL expressionserr - an error dispatcher to use
JasperException
public static Object coerce(Class targetType,
String value)
throws ELException
ELExceptionpublic static void resetTemporaryVariableName()
public static String nextTemporaryVariableName()
public static String coerceToPrimitiveBoolean(String s,
boolean isNamedAttribute)
public static String coerceToBoolean(String s,
boolean isNamedAttribute)
public static String coerceToPrimitiveByte(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 coerceToPrimitiveDouble(String s,
boolean isNamedAttribute)
public static String coerceToDouble(String s,
boolean isNamedAttribute)
public static String coerceToPrimitiveFloat(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 coerceToPrimitiveShort(String s,
boolean isNamedAttribute)
public static String coerceToShort(String s,
boolean isNamedAttribute)
public static String coerceToPrimitiveLong(String s,
boolean isNamedAttribute)
public static String coerceToLong(String s,
boolean isNamedAttribute)
public static String coerceToEnum(String s,
String enumClass,
boolean isNamedAttribute)
public static InputStream getInputStream(String fname,
JarFile jarFile,
JspCompilationContext ctxt,
ErrorDispatcher err)
throws JasperException,
IOException
JasperException
IOException
public static String getTagHandlerClassName(String path,
ErrorDispatcher err)
throws JasperException
path - Tag file patherr - Error dispatcher
JasperExceptionpublic static final String makeJavaPackage(String path)
path - Path to convert
public static final String makeJavaIdentifier(String identifier)
identifier - Identifier to convert
public static final String mangleChar(char ch)
public static boolean isJavaKeyword(String key)
public static final String makeXmlJavaIdentifier(String name)
name - Identifier to convert
public static String toJavaSourceType(String type)
public static String getCanonicalName(Class c)
c - A instance of java.lang.Class
public static List<String> expandClassPath(List<String> files)
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||