Home » xml-commons-external-1.4.01-src » javax » xml » validation » [javadoc | source]
javax.xml.validation
abstract public class: Validator [javadoc | source]
java.lang.Object
   javax.xml.validation.Validator

A processor that checks an XML document against Schema .

A validator is a thread-unsafe and non-reentrant object. In other words, it is the application's responsibility to make sure that one Validator object is not used from more than one thread at any given time, and while the validate method is invoked, applications may not recursively call the validate method.

Note that while the #validate(javax.xml.transform.Source) and #validate(javax.xml.transform.Source, javax.xml.transform.Result) methods take a Source instance, the Source instance must be a SAXSource, DOMSource, StAXSource or StreamSource.

Constructor:
 protected Validator() 
Method from javax.xml.validation.Validator Summary:
getErrorHandler,   getFeature,   getProperty,   getResourceResolver,   reset,   setErrorHandler,   setFeature,   setProperty,   setResourceResolver,   validate,   validate
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.xml.validation.Validator Detail:
 abstract public ErrorHandler getErrorHandler()
 public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException 
    Look up the value of a feature flag.

    The feature name is any fully-qualified URI. It is possible for a Validator to recognize a feature name but temporarily be unable to return its value. Some feature values may be available only in specific contexts, such as before, during, or after a validation.

    Implementors are free (and encouraged) to invent their own features, using names built on their own URIs.

 public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException 
    Look up the value of a property.

    The property name is any fully-qualified URI. It is possible for a Validator to recognize a property name but temporarily be unable to return its value. Some property values may be available only in specific contexts, such as before, during, or after a validation.

    Validator s are not required to recognize any specific property names.

    Implementors are free (and encouraged) to invent their own properties, using names built on their own URIs.

 abstract public LSResourceResolver getResourceResolver()
 abstract public  void reset()

    Reset this Validator to its original configuration.

    Validator is reset to the same state as when it was created with Schema#newValidator() . reset() is designed to allow the reuse of existing Validators thus saving resources associated with the creation of new Validators.

    The reset Validator is not guaranteed to have the same LSResourceResolver or ErrorHandler Objects, e.g. Object#equals(Object obj) . It is guaranteed to have a functionally equal LSResourceResolver and ErrorHandler.

 abstract public  void setErrorHandler(ErrorHandler errorHandler)
 public  void setFeature(String name,
    boolean value) throws SAXNotRecognizedException, SAXNotSupportedException 
    Set the value of a feature flag.

    Feature can be used to control the way a Validator parses schemas, although Validator s are not required to recognize any specific property names.

    The feature name is any fully-qualified URI. It is possible for a Validator to expose a feature value but to be unable to change the current value. Some feature values may be immutable or mutable only in specific contexts, such as before, during, or after a validation.

 public  void setProperty(String name,
    Object object) throws SAXNotRecognizedException, SAXNotSupportedException 
    Set the value of a property.

    The property name is any fully-qualified URI. It is possible for a Validator to recognize a property name but to be unable to change the current value. Some property values may be immutable or mutable only in specific contexts, such as before, during, or after a validation.

    Validator s are not required to recognize setting any specific property names.

 abstract public  void setResourceResolver(LSResourceResolver resourceResolver)
 public  void validate(Source source) throws SAXException, IOException 
    Validates the specified input.

    This is just a convenience method of:

    validate(source,null);
    
 abstract public  void validate(Source source,
    Result result) throws SAXException, IOException