org.qedeq.kernel.xml.parser
Class SaxParser

java.lang.Object
  extended by org.qedeq.kernel.xml.parser.SaxParser

public final class SaxParser
extends java.lang.Object

Parser for XML files. This class uses features specific for Xerces.

Author:
Michael Meyling

Field Summary
protected static java.lang.String SCHEMA_FULL_CHECKING_FEATURE_ID
          Schema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking).
 
Constructor Summary
SaxParser(ModuleService plugin, SaxDefaultHandler handler)
          Constructor.
 
Method Summary
 java.lang.String getEncoding()
          Get encoding of XML document.
 SourceFileExceptionList getExceptionList()
          Get errors that occurred during last parsing.
 void parse(java.io.File file, java.lang.String original)
          Parses the XML file.
 void parse(java.lang.String fileName, java.lang.String original)
          Parses XML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEMA_FULL_CHECKING_FEATURE_ID

protected static final java.lang.String SCHEMA_FULL_CHECKING_FEATURE_ID
Schema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking).

See Also:
Constant Field Values
Constructor Detail

SaxParser

public SaxParser(ModuleService plugin,
                 SaxDefaultHandler handler)
          throws javax.xml.parsers.ParserConfigurationException,
                 org.xml.sax.SAXException
Constructor.

Parameters:
plugin - We work for this plugin.
handler - Default handler for this application.
Throws:
javax.xml.parsers.ParserConfigurationException - Severe parser configuration problem.
org.xml.sax.SAXException - Option not recognized or supported.
Method Detail

parse

public final void parse(java.lang.String fileName,
                        java.lang.String original)
                 throws SourceFileExceptionList
Parses XML file.

Parameters:
fileName - File name.
original - Original URL for the file. If this is null same as file name.
Throws:
SourceFileExceptionList - Loading failed.

parse

public final void parse(java.io.File file,
                        java.lang.String original)
                 throws SourceFileExceptionList
Parses the XML file.

Parameters:
file - File to parse.
original - Original URL for the file. If this is null same as file.
Throws:
SourceFileExceptionList - Loading failed.

getExceptionList

public SourceFileExceptionList getExceptionList()
Get errors that occurred during last parsing.

Returns:
List with collected Exceptions.

getEncoding

public java.lang.String getEncoding()
Get encoding of XML document. This value is set during parsing the document.

Returns:
Encoding. Maybe null.


Copyright © 2014. All Rights Reserved.