Package org.apache.jasper.xmlparser
Class ParserUtils
- java.lang.Object
-
- org.apache.jasper.xmlparser.ParserUtils
-
public class ParserUtils extends Object
XML parsing utilities for processing web application deployment descriptor and tag library descriptor files. FIXME - make these use a separate class loader for the parser to be used.- Version:
- $Revision: 1.11 $ $Date: 2007/05/05 05:32:59 $
- Author:
- Craig R. McClanahan
-
-
Constructor Summary
Constructors Constructor Description ParserUtils()
ParserUtils(boolean blockExternal)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TreeNode
convert(TreeNode parent, Node node)
Create and return a TreeNode that corresponds to the specified Node, including processing all of the attributes and children nodes.TreeNode
parseXMLDocument(String uri, InputStream is)
Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.TreeNode
parseXMLDocument(String uri, InputStream is, boolean validate)
Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.TreeNode
parseXMLDocument(String uri, InputSource is)
Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.TreeNode
parseXMLDocument(String uri, InputSource is, boolean validate)
Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.static void
setDtdResourcePrefix(String prefix)
Sets the path prefix URL for .dtd resourcesstatic void
setEntityResolver(EntityResolver er)
static void
setSchemaResourcePrefix(String prefix)
Sets the path prefix URL for .xsd resources
-
-
-
Method Detail
-
setEntityResolver
public static void setEntityResolver(EntityResolver er)
-
setSchemaResourcePrefix
public static void setSchemaResourcePrefix(String prefix)
Sets the path prefix URL for .xsd resources
-
setDtdResourcePrefix
public static void setDtdResourcePrefix(String prefix)
Sets the path prefix URL for .dtd resources
-
parseXMLDocument
public TreeNode parseXMLDocument(String uri, InputSource is) throws JasperException
Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.- Parameters:
uri
- URI of the XML document being parsedis
- Input source containing the deployment descriptor- Throws:
JasperException
- if an I/O or parsing error has occurred
-
parseXMLDocument
public TreeNode parseXMLDocument(String uri, InputSource is, boolean validate) throws JasperException
Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.- Parameters:
uri
- URI of the XML document being parsedis
- Input source containing the deployment descriptorvalidate
- true if the XML document needs to be validated against its DTD or schema, false otherwise- Throws:
JasperException
- if an I/O or parsing error has occurred
-
parseXMLDocument
public TreeNode parseXMLDocument(String uri, InputStream is) throws JasperException
Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.- Parameters:
uri
- URI of the XML document being parsedis
- Input stream containing the deployment descriptor- Throws:
JasperException
- if an I/O or parsing error has occurred
-
parseXMLDocument
public TreeNode parseXMLDocument(String uri, InputStream is, boolean validate) throws JasperException
Parse the specified XML document, and return aTreeNode
that corresponds to the root node of the document tree.- Parameters:
uri
- URI of the XML document being parsedis
- Input stream containing the deployment descriptorvalidate
- true if the XML document needs to be validated against its DTD or schema, false otherwise- Throws:
JasperException
- if an I/O or parsing error has occurred
-
convert
protected TreeNode convert(TreeNode parent, Node node)
Create and return a TreeNode that corresponds to the specified Node, including processing all of the attributes and children nodes.- Parameters:
parent
- The parent TreeNode (if any) for the new TreeNodenode
- The XML document Node to be converted
-
-