Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.jasper.compiler
Class JspUtil

    java.lang.Object
      |
      +--org.apache.jasper.compiler.JspUtil

public class JspUtil
extends java.lang.Object

This class has all the utility method(s). Ideally should move all the bean containers here.

Author:
  Mandar Raje., Rajiv Mordani., Danno Ferrin, Pierre Delisle

Nested Class Summary
`static class` | `JspUtil.ValidAttribute`

Constructor Summary
`JspUtil()`

Method Summary
`static java.util.Hashtable` | `attrsToHashtable(org.xml.sax.Attributes attrs)`
`static boolean` | `booleanValue(java.lang.String s)` Convert a String value to 'boolean'.
`static void` | `checkAttributes(java.lang.String typeOfTag, org.xml.sax.Attributes attrs, JspUtil.ValidAttribute[] validAttributes, Mark start, ErrorDispatcher err)`
`static java.lang.String` | `escapeQueryString(java.lang.String unescString)`
`static char[]` | `escapeQuotes(char[] chars)`
`static java.lang.String` | `escapeXml(java.lang.String s)` Escape the 5 entities defined by XML.
`static java.lang.String` | `getElementChildTextData(org.w3c.dom.Element e)` Get the data for the first child associated with the Element provided as argument.
`static java.lang.String` | `getExpr(java.lang.String expression, boolean isXml)`
`static java.lang.String` | `getExprInXml(java.lang.String expression)` Takes a potential expression and converts it into XML form
`static boolean` | `isExpression(java.lang.String token, boolean isXml)` Checks if the token is a runtime expression.
`static org.w3c.dom.Document` | `parseXMLDoc(java.lang.String uri, java.io.InputStream in)` Deprecated. Use ParserUtils.parseXMLDocument() instead
`static org.w3c.dom.Document` | `parseXMLDocJaxp(java.lang.String uri, java.io.InputStream in)` Deprecated. Use ParserUtils.parseXMLDocument() instead
`static char[]` | `removeQuotes(char[] chars)`
`static java.lang.String` | `replace(java.lang.String name, char replace, java.lang.String with)` Replaces any occurrence of `replace` with `with` in the given string.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JspUtil

    public JspUtil()

Method Detail

### removeQuotes

    public static char[] removeQuotes(char[] chars)

### escapeQuotes

    public static char[] escapeQuotes(char[] chars)

### isExpression

    public static boolean isExpression(java.lang.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 '%'.

  Parameters:
    `token` - The token to be checked return whether the token is a runtime expression or not.

### getExpr

    public static java.lang.String getExpr(java.lang.String expression,
                                           boolean isXml)

  Returns:
    the "expression" part of a runtime expression, taking the delimiters out.

### getExprInXml

    public static java.lang.String getExprInXml(java.lang.String expression)

  Takes a potential expression and converts it into XML form

### parseXMLDoc

    public static org.w3c.dom.Document parseXMLDoc(java.lang.String uri,
                                                   java.io.InputStream in)
                                            throws JasperException

  Deprecated. Use ParserUtils.parseXMLDocument() instead

  Parses the XML document contained in the InputStream.

    `JasperException`

### parseXMLDocJaxp

    public static org.w3c.dom.Document parseXMLDocJaxp(java.lang.String uri,
                                                       java.io.InputStream in)
                                                throws JasperException

  Deprecated. Use ParserUtils.parseXMLDocument() instead

  Parses the XML document contained in the InputStream. This XML document is either web.xml or a tld. [The TLD has to be cached internally (see MyEntityResolver)]

    `JasperException`

### checkAttributes

    public static void checkAttributes(java.lang.String typeOfTag,
                                       org.xml.sax.Attributes attrs,
                                       JspUtil.ValidAttribute[] validAttributes,
                                       Mark start,
                                       ErrorDispatcher err)
                                throws JasperException

    `JasperException`

### escapeQueryString

    public static java.lang.String escapeQueryString(java.lang.String unescString)

### escapeXml

    public static java.lang.String escapeXml(java.lang.String s)

  Escape the 5 entities defined by XML.

### replace

    public static java.lang.String replace(java.lang.String name,
                                           char replace,
                                           java.lang.String with)

  Replaces any occurrence of `replace` with `with` in the given string.

### attrsToHashtable

    public static java.util.Hashtable attrsToHashtable(org.xml.sax.Attributes attrs)

### getElementChildTextData

    public static java.lang.String getElementChildTextData(org.w3c.dom.Element e)

  Get the data for the first child associated with the Element provided as argument. It is assumed that this first child is of type Text.

  Parameters:
    `e` - the DOM Element to read from
  Returns:
    the data associated with the first child of the DOM element.

### booleanValue

    public static boolean booleanValue(java.lang.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.

  Parameters:
    `s` - the string to be converted
  Returns:
    the boolean value associated with the string s

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 Apache Software Foundation. All Rights Reserved.