jcreek.cke.importexport.xml
Interface DOMparserWrapper

All Known Implementing Classes:
XercesParserWrapper

public interface DOMparserWrapper

Encapsulates a DOM parser.

This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation and was originally based on software copyright (c) 1999, International Business Machines, Inc., http://www.apache.org. For more information on the Apache Software Foundation, please see www.apache.org.

Author:
Stein L. Tomassen, NTNU 2002, Apache org.

Method Summary
 java.lang.String getErrorsMsg()
          Returns a string with all the error messages the parser reports when parsing.
 java.lang.String getFatalErrorsMsg()
          Returns a string with all the fatal error messages the parser reports when parsing.
 int getNumberOfErrors()
          Returns the number of error messages the parser reports when parsing
 int getNumberOfFatalErrors()
          Returns the number of fatal error messages the parser reports when parsing
 int getNumberOfWarnings()
          Returns the number of warning messages the parser reports when parsing
 java.lang.String getWarningsMsg()
          Returns a string with all the warning messages the parser reports when parsing.
 org.w3c.dom.Document parse(org.w3c.dom.Document document)
          Parses the specified Document and returns it as a DOM document.
 org.w3c.dom.Document parse(java.io.InputStream istream)
          Parses the specified InputStream and returns the document.
 org.w3c.dom.Document parse(java.io.Reader reader)
          Parses the specified Reader and returns it as a DOM document.
 org.w3c.dom.Document parse(java.lang.String url)
          Parses the specified URL and returns it as a DOM document.
 void setFeature(java.lang.String featureId, boolean state)
          Set the state of a feature.
 

Method Detail

parse

public org.w3c.dom.Document parse(java.lang.String url)
                           throws java.lang.Exception
Parses the specified URL and returns it as a DOM document.

Parameters:
url - the URL of the document to parse
Returns:
the parsed document as a DOM object
Throws:
java.lang.Exception - an expection if an parser error occurs

parse

public org.w3c.dom.Document parse(java.io.InputStream istream)
                           throws java.lang.Exception
Parses the specified InputStream and returns the document.

Parameters:
istream - the input stream being the source of the document to parse
Returns:
the parsed document as a DOM object
Throws:
java.lang.Exception - an expection if an parser error occurs

parse

public org.w3c.dom.Document parse(java.io.Reader reader)
                           throws java.lang.Exception
Parses the specified Reader and returns it as a DOM document.

Parameters:
reader - the input reader being the source of the document to parse
Returns:
the parsed document as a DOM object
Throws:
java.lang.Exception - an expection if an parser error occurs

parse

public org.w3c.dom.Document parse(org.w3c.dom.Document document)
                           throws java.lang.Exception
Parses the specified Document and returns it as a DOM document. This method makes it easier to revalidate a document. In a future version of Xerces, maybe revalidation will a feature...

Parameters:
document - the DOM object to parse
Returns:
the parsed document as a DOM object
Throws:
java.lang.Exception - an expection if an parser error occurs

setFeature

public void setFeature(java.lang.String featureId,
                       boolean state)
                throws org.xml.sax.SAXNotRecognizedException,
                       org.xml.sax.SAXNotSupportedException
Set the state of a feature. Set the state of any feature in a SAX2 parser. The parser might not recognize the feature, and if it does recognize it, it might not be able to fulfill the request.

Parameters:
featureId - The unique identifier (URI) of the feature.
state - The requested state of the feature (true or false).
Throws:
org.xml.sax.SAXNotRecognizedException - If the requested feature is not known.
org.xml.sax.SAXNotSupportedException - If the requested feature is known, but the requested state is not supported.
org.xml.sax.SAXException - If there is any other problem fulfilling the request.

getErrorsMsg

public java.lang.String getErrorsMsg()
Returns a string with all the error messages the parser reports when parsing. The messages is separeted with a new line character.

Returns:
a string with all the error messages

getWarningsMsg

public java.lang.String getWarningsMsg()
Returns a string with all the warning messages the parser reports when parsing. The messages is separeted with a new line character.

Returns:
a string with all the warning messages

getFatalErrorsMsg

public java.lang.String getFatalErrorsMsg()
Returns a string with all the fatal error messages the parser reports when parsing. The messages is separeted with a new line character.

Returns:
a string with all the fatal error messages

getNumberOfErrors

public int getNumberOfErrors()
Returns the number of error messages the parser reports when parsing

Returns:
the number of errors

getNumberOfWarnings

public int getNumberOfWarnings()
Returns the number of warning messages the parser reports when parsing

Returns:
the number of warnings

getNumberOfFatalErrors

public int getNumberOfFatalErrors()
Returns the number of fatal error messages the parser reports when parsing

Returns:
the number of fatal errors


Created at IDI, NTNU by the Artificial Intelligence and Learning group