org.mycore.common.xml
Interface MCRParserInterface

All Known Implementing Classes:
MCRParserXerces

public interface MCRParserInterface

This interface is designed to choose the XML parser. To construct a JDOM you have to methodes, one for a URI input an one for a XML stream.

Version:
$Revision: 15270 $ $Date: 2009-05-25 17:27:57 +0200 (Mon, 25 May 2009) $
Author:
Jens Kupferschmidt, Thomas Scheffler (yagee)

Method Summary
 Document parseURI(URI uri)
          Parses an XML file from a URI and returns it as DOM.
 Document parseURI(URI uri, boolean valid)
          Parses an XML file from a URI and returns it as DOM.
 Document parseXML(byte[] xml)
          Parses an Byte Array and returns it as DOM.
 Document parseXML(byte[] xml, boolean valid)
          Parses an Byte Array and returns it as DOM.
 Document parseXML(InputStream input)
          Parses an Byte Array and returns it as DOM.
 Document parseXML(InputStream input, boolean validate)
          Parses an Byte Array and returns it as DOM.
 Document parseXML(String xml)
          Parses an XML String and returns it as DOM.
 Document parseXML(String xml, boolean valid)
          Parses an XML String and returns it as DOM.
 

Method Detail

parseURI

Document parseURI(URI uri)
                  throws MCRException
Parses an XML file from a URI and returns it as DOM. Use the validation value from mycore.properties.

Parameters:
uri - the URI of the XML stream
Returns:
a document object (DOM)
Throws:
MCRException - general Exception of MyCoRe

parseURI

Document parseURI(URI uri,
                  boolean valid)
                  throws MCRException
Parses an XML file from a URI and returns it as DOM. Use the given validation flag.

Parameters:
uri - the URI of the XML file
valid - the validation flag
Returns:
the XML file as a DOM object
Throws:
MCRException - if XML could not be parsed

parseXML

Document parseXML(String xml)
                  throws MCRException
Parses an XML String and returns it as DOM. Use the validation value from mycore.properties.

Parameters:
xml - the XML data stream
Returns:
a document object (DOM)
Throws:
MCRException - general Exception of MyCoRe

parseXML

Document parseXML(String xml,
                  boolean valid)
                  throws MCRException
Parses an XML String and returns it as DOM. Use the given validation flag.

Parameters:
xml - the XML String to be parsed
valid - the validation flag
Returns:
the XML file as a DOM object
Throws:
MCRException - if XML could not be parsed

parseXML

Document parseXML(byte[] xml)
                  throws MCRException
Parses an Byte Array and returns it as DOM. Use the validation value from mycore.properties.

Parameters:
xml - the XML Byte Array to be parsed
Returns:
the XML file as a DOM object
Throws:
MCRException - if XML could not be parsed

parseXML

Document parseXML(byte[] xml,
                  boolean valid)
                  throws MCRException
Parses an Byte Array and returns it as DOM. Use the given validation flag.

Parameters:
xml - the XML Byte Array to be parsed
valid - the validation flag
Returns:
the XML file as a DOM object
Throws:
MCRException - if XML could not be parsed

parseXML

Document parseXML(InputStream input)
                  throws MCRException
Parses an Byte Array and returns it as DOM. Use the validation value from mycore.properties.

Parameters:
input - the InputStream to be parsed
Returns:
the XML file as a DOM object
Throws:
MCRException - if XML could not be parsed

parseXML

Document parseXML(InputStream input,
                  boolean validate)
                  throws MCRException
Parses an Byte Array and returns it as DOM. Use the given validation flag.

Parameters:
input - the InputStream to be parsed
validate - the validation flag
Returns:
the XML file as a DOM object
Throws:
MCRException - if XML could not be parsed