xdoclet.util
public class XmlValidator extends DefaultHandler
Version: $Revision: 1.19 $
UNKNOWN: September 18, 2001 Deal with Translator.getString()'s exception better in resolveEntity(String, String)
Field Summary | |
---|---|
protected ClassLoader | classLoader |
static String | DEFAULT_XML_READER_CLASSNAME
The crimson implementation is shipped with ant. |
protected String | readerClassName |
protected XMLReader | xmlReader
XMLReader used for validation |
Constructor Summary | |
---|---|
XmlValidator(ClassLoader classLoader)
Describe what the XmlValidator constructor does
|
Method Summary | |
---|---|
void | error(SAXParseException e)
Called by parser if a error occurs
|
static XmlValidator | getInstance()
Gets the Instance attribute of the XmlValidator class
|
void | registerDTD(String publicId, URL dtdURL)
Registers a local DTD document by its public id. |
void | registerSchema(URL schemaURL)
Registers a local XSD document by its public id. |
void | reset()
Resets the Validator |
InputSource | resolveEntity(String publicId, String systemId)
Called by parser when a DTD declaration is encountered in the parsed XML document
|
static void | setInstance(XmlValidator instance)
Sets the Instance attribute of the XmlValidator class
|
void | validate(File xmlFile)
Validates an XML file for conformance to a declared DTD or XMLSchema. |
void | warning(SAXParseException e)
Called by parser if a warning occurs
|
Parameters: e an exception describing the error
Throws: SAXParseException every time this method is called by the parser
Returns: The Instance value
Parameters: publicId the publicId of the DTD dtdURL the URL of the local DTD, which must be loadable by the class passed in the constructor. This URL typically points inside a local jar file
Parameters: schemaURL
Parameters: publicId the public id of the DTD systemId the system id of the DTD
Returns: an InputSource from containing the DTD document, provided it has been previously registered via the XmlValidator method. If not, null will be returned, and the parser will atempt to load the DTD from the systemId value, Usually an Internet http URL.
Parameters: instance The new Instance value
Parameters: xmlFile Description of Parameter
Throws: XDocletException Description of Exception
Parameters: e an exception describing the warning
Throws: SAXParseException every time this method is called by the parser