|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jorm.xml2mi.lib.SAXParserHelper
This class is an helper for the use of SAX Parser. It manages the entity resolving public id, and handling errors.
Constructor Summary | |
SAXParserHelper(java.util.Properties publicid2location,
Logger logger)
Creates and initializes a SAX parser with the classLoader of the current class. |
|
SAXParserHelper(java.util.Properties publicid2location,
Logger logger,
java.lang.ClassLoader cl,
boolean dtdverify)
Creates and initializes a SAX parser. |
Method Summary | |
void |
error(org.xml.sax.SAXParseException e)
|
void |
fatalError(org.xml.sax.SAXParseException e)
|
org.w3c.dom.Document |
parse(java.io.InputStream is)
Parses a stream as an xml file. |
org.w3c.dom.Document |
parse(java.lang.String xmlFileName)
Parses a xml file. |
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Resolves the entity according to the associaition contained in #publicid2location. |
void |
warning(org.xml.sax.SAXParseException e)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SAXParserHelper(java.util.Properties publicid2location, Logger logger) throws org.xml.sax.SAXException
publicid2location
- contains the association between public id and
locationpublic SAXParserHelper(java.util.Properties publicid2location, Logger logger, java.lang.ClassLoader cl, boolean dtdverify) throws org.xml.sax.SAXException
publicid2location
- contains the association between public id and
locationcl
- is the classLoader used to try to load entities and xml filesdtdverify
- indicates if the DTD checking must be doneMethod Detail |
public org.w3c.dom.Document parse(java.lang.String xmlFileName) throws org.xml.sax.SAXException
xmlFileName
- is the path to the xml file. This path can be valid
from the file system or the classpath/classloader. The path can be an
URL.
org.xml.sax.SAXException
- is thrown if the file cannot be found or if the
file is malformed.public org.w3c.dom.Document parse(java.io.InputStream is) throws org.xml.sax.SAXException
is
- an inputStream contains the XML xml content
org.xml.sax.SAXException
- is thrown if the file cannot be found or if the
file is malformed.public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
org.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
org.xml.sax.SAXException
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
org.xml.sax.SAXException
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
resolveEntity
in interface org.xml.sax.EntityResolver
org.xml.sax.SAXException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |