|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
xdoclet.util.XmlValidator
public class XmlValidator
This handler implementation is capable of providing dtds from a local storage instead of accessing them over the net. Further, it will throw an exception if the parsed xml is not acording to the DTD it specifies.
Field Summary | |
---|---|
protected java.lang.ClassLoader |
classLoader
|
static java.lang.String |
DEFAULT_XML_READER_CLASSNAME
The crimson implementation is shipped with ant. |
protected java.lang.String |
readerClassName
|
protected org.xml.sax.XMLReader |
xmlReader
XMLReader used for validation |
Constructor Summary | |
---|---|
XmlValidator(java.lang.ClassLoader classLoader)
Describe what the XmlValidator constructor does |
Method Summary | |
---|---|
void |
error(org.xml.sax.SAXParseException e)
Called by parser if a error occurs |
static XmlValidator |
getInstance()
Gets the Instance attribute of the XmlValidator class |
void |
registerDTD(java.lang.String publicId,
java.net.URL dtdURL)
Registers a local DTD document by its public id. |
void |
registerSchema(java.net.URL schemaURL)
Registers a local XSD document by its public id. |
void |
reset()
Resets the Validator |
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.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(java.io.File xmlFile)
Validates an XML file for conformance to a declared DTD or XMLSchema. |
void |
warning(org.xml.sax.SAXParseException e)
Called by parser if a warning occurs |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
characters, endDocument, endElement, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_XML_READER_CLASSNAME
protected java.lang.ClassLoader classLoader
protected org.xml.sax.XMLReader xmlReader
protected java.lang.String readerClassName
Constructor Detail |
---|
public XmlValidator(java.lang.ClassLoader classLoader)
classLoader
- Describe what the parameter doesMethod Detail |
---|
public static XmlValidator getInstance()
public static void setInstance(XmlValidator instance)
instance
- The new Instance valuepublic void registerDTD(java.lang.String publicId, java.net.URL dtdURL)
publicId
- the publicId of the DTDdtdURL
- 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 filepublic void registerSchema(java.net.URL schemaURL)
schemaURL
- public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
resolveEntity
in interface org.xml.sax.EntityResolver
resolveEntity
in class org.xml.sax.helpers.DefaultHandler
publicId
- the public id of the DTDsystemId
- the system id of the DTD
registerDTD(java.lang.String, java.net.URL)
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.public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXParseException
error
in interface org.xml.sax.ErrorHandler
error
in class org.xml.sax.helpers.DefaultHandler
e
- an exception describing the error
org.xml.sax.SAXParseException
- every time this method is called by the parserpublic void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXParseException
warning
in interface org.xml.sax.ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
e
- an exception describing the warning
org.xml.sax.SAXParseException
- every time this method is called by the parserpublic void validate(java.io.File xmlFile) throws XDocletException
xmlFile
- Description of Parameter
XDocletException
- Description of Exceptionpublic void reset()
|
http://xdoclet.sourceforge.net/ | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |