org.iso_relax.verifier
public interface Verifier
An instance of this interface can be obtained through the VerifierFactory method or Schema method. Once it is created, an application can use one instance to validate multiple documents.
This interface is not thread-safe and not reentrant. That is, only one thread can use it at any given time, and you can only validate one document at any given time.
Since: Feb. 23, 2001
Version: Mar. 4, 2001
Field Summary | |
---|---|
String | FEATURE_FILTER
a read-only feature that checks whether the implementation supports
getVerifierFilter method.
|
String | FEATURE_HANDLER
a read-only feature that checks whether the implementation supports
getVerifierHandler method.
|
Method Summary | |
---|---|
Object | getProperty(String property)
Gets a property value
This method is modeled after SAX2. |
VerifierFilter | getVerifierFilter()
Gets a VerifierFilter.
|
VerifierHandler | getVerifierHandler()
Gets a VerifierHandler.
|
boolean | isFeature(String feature)
Checks whether a feature is supported or not.
|
void | setEntityResolver(EntityResolver handler)
Sets a EntityResolver to resolve external entity locations.
|
void | setErrorHandler(ErrorHandler handler)
Sets a ErrorHandler that receives validation
errors/warnings.
|
void | setFeature(String feature, boolean value)
Sets a value to a feature.
|
void | setProperty(String property, Object value)
Sets a property value
This method is modeled after SAX2. |
boolean | verify(String uri)
validates an XML document.
|
boolean | verify(InputSource source)
validates an XML document.
|
boolean | verify(File file)
validates an XML document.
|
boolean | verify(Node node)
validates an XML document.
|
Deprecated:
a read-only feature that checks whether the implementation supportsgetVerifierFilter
method.
Now a verifier implementation is required to support VerifierFilter. Therefore an application doesn't need to check this feature.
Deprecated:
a read-only feature that checks whether the implementation supportsgetVerifierHandler
method.
Now a verifier implementation is required to support VerifierHandler. Therefore an application doesn't need to check this feature.
This method is modeled after SAX2.
Parameters: property property name
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.
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.
This method is modeled after SAX2.
Parameters: feature feature name
EntityResolver
to resolve external entity locations.
The given entity resolver is used in the
verify(String)
method and the
verify(InputSource)
method.
Parameters: handler EntityResolver
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.
Parameters: handler this object will receive errors/warning encountered during the validation.
This method is modeled after SAX2.
Parameters: feature feature name value feature value
This method is modeled after SAX2.
Parameters: property property name value property value
Parameters: uri URI of a document.
Returns: true if the document is valid. false if otherwise.
Parameters: source InputSource of a XML document to verify.
Returns: true if the document is valid. false if otherwise.
Parameters: file File to be validated
Returns: true if the document is valid. false if otherwise.
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
.
Parameters: node the root DOM node of an XML document.
Returns: true if the document is valid. false if otherwise.
Throws: UnsupportedOperationException If the node type of the node parameter is something which this implementation does not support.