public abstract class VerifierImpl extends java.lang.Object implements Verifier
Verifier
.
This class is useful as the base class of the verifier implementation.
The only remaining method that has to be implemented by the derived
class is the getVerifierHandler
method. Please be noted
that applications can call the setErrorHandler
method
after the getVerifierHandler
method and that change
should take effect.
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getProperty(java.lang.String property)
Gets a property value
|
VerifierFilter |
getVerifierFilter()
Gets a VerifierFilter.
|
abstract VerifierHandler |
getVerifierHandler()
Gets a VerifierHandler.
|
boolean |
isFeature(java.lang.String feature)
Checks whether a feature is supported or not.
|
void |
setEntityResolver(org.xml.sax.EntityResolver resolver)
Sets a
EntityResolver to resolve external entity locations. |
void |
setErrorHandler(org.xml.sax.ErrorHandler handler)
Sets a
ErrorHandler that receives validation
errors/warnings. |
void |
setFeature(java.lang.String feature,
boolean value)
Sets a value to a feature.
|
void |
setProperty(java.lang.String property,
java.lang.Object value)
Sets a property value
|
boolean |
verify(java.io.File f)
validates an XML document.
|
boolean |
verify(org.xml.sax.InputSource source)
validates an XML document.
|
boolean |
verify(org.w3c.dom.Node node)
validates an XML document.
|
boolean |
verify(java.lang.String uri)
validates an XML document.
|
public java.lang.Object getProperty(java.lang.String property) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
Verifier
This method is modeled after SAX2.
getProperty
in interface Verifier
property
- property nameorg.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
public VerifierFilter getVerifierFilter() throws org.xml.sax.SAXException
Verifier
you can use the returned
VerifierHandler
to validate documents
through SAX.
Note that two different invocations of this method
can return the same value; this method does NOT
necessarily create a new VerifierFilter
object.
getVerifierFilter
in interface Verifier
org.xml.sax.SAXException
public abstract VerifierHandler getVerifierHandler() throws org.xml.sax.SAXException
Verifier
you can use the returned
VerifierHandler
to validate documents
through SAX.
Note that two different invocations of this method
can return the same value; this method does NOT
necessarily create a new VerifierHandler
object.
getVerifierHandler
in interface Verifier
org.xml.sax.SAXException
public boolean isFeature(java.lang.String feature) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
Verifier
This method is modeled after SAX2.
public void setEntityResolver(org.xml.sax.EntityResolver resolver)
Verifier
EntityResolver
to resolve external entity locations.
The given entity resolver is used in the
Verifier.verify(String)
method and the
Verifier.verify(InputSource)
method.
setEntityResolver
in interface Verifier
resolver
- EntityResolverpublic void setErrorHandler(org.xml.sax.ErrorHandler handler)
Verifier
ErrorHandler
that receives validation
errors/warnings.
If no error handler is set explicitly, a verifier implementation will not report any error/warning at all. However, the caller can still obtain the result of validation through the return value.
Conscious developers should always set an error handler explicitly as the default behavior has been changed several times.
setErrorHandler
in interface Verifier
handler
- this object will receive errors/warning encountered
during the validation.public void setFeature(java.lang.String feature, boolean value) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
Verifier
This method is modeled after SAX2.
setFeature
in interface Verifier
feature
- feature namevalue
- feature valueorg.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
public void setProperty(java.lang.String property, java.lang.Object value) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
Verifier
This method is modeled after SAX2.
setProperty
in interface Verifier
property
- property namevalue
- property valueorg.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
public boolean verify(java.io.File f) throws org.xml.sax.SAXException, java.io.IOException
Verifier
public boolean verify(org.xml.sax.InputSource source) throws org.xml.sax.SAXException, java.io.IOException
Verifier
public boolean verify(org.w3c.dom.Node node) throws org.xml.sax.SAXException
Verifier
An implementation is required to accept Document
object
as the node parameter. If it also implements partial validation,
it can also accepts things like Element
.
public boolean verify(java.lang.String uri) throws org.xml.sax.SAXException, java.io.IOException
Verifier