org.jboss.jsfunit.analysis.util
Class ParserUtils

java.lang.Object
  extended by org.jboss.jsfunit.analysis.util.ParserUtils

public class ParserUtils
extends Object

Since:
1.0
Author:
Dennis Byrne

Constructor Summary
ParserUtils()
           
 
Method Summary
static Document getDocument(String xml)
           
static DocumentBuilder getDocumentBuilder()
           
static Document getDomDocument(InputStream file, String filePath)
          Setup the DOM parser for the file specified.
static Document getDomDocument(String filePath, StreamProvider streamProvider)
          Setup the DOM parser for the file specified.
static String getXml(String resourcePath, StreamProvider streamProvider)
           
static NodeList query(Node node, String xpathQuery, String filePath)
           
static String querySingle(Node node, String xpathQuery, String filePath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserUtils

public ParserUtils()
Method Detail

getDocumentBuilder

public static DocumentBuilder getDocumentBuilder()

getXml

public static String getXml(String resourcePath,
                            StreamProvider streamProvider)

getDocument

public static Document getDocument(String xml)
                            throws SAXException,
                                   IOException
Throws:
SAXException
IOException

query

public static NodeList query(Node node,
                             String xpathQuery,
                             String filePath)

querySingle

public static String querySingle(Node node,
                                 String xpathQuery,
                                 String filePath)

getDomDocument

public static Document getDomDocument(String filePath,
                                      StreamProvider streamProvider)
Setup the DOM parser for the file specified.

Parameters:
filePath - the path to the file to be parsed
streamProvider - the StreamProvider
Returns:
a DOM Document

getDomDocument

public static Document getDomDocument(InputStream file,
                                      String filePath)
Setup the DOM parser for the file specified.

Parameters:
file - the input stream to be parsed
filePath - the path to the file to be parsed
Returns:
a DOM Document


Copyright © 2007-2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.