javax.xml.validation
Class ValidatorHandler

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.xml.validation.ValidatorHandler
All Implemented Interfaces:
ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler

public abstract class ValidatorHandler
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler

Streaming validator that works on SAX stream.

A ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler object is a thread-unsafe, non-reentrant object. In other words, it is the application's responsibility to make sure that one ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler object is not used from more than one thread at any given time.

ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler checks if the SAX events follow the set of constraints described in the associated Schema sample code for javax.xml.validation.Schema definition code for javax.xml.validation.Schema , and additionally it may modify the SAX events (for example by adding default values, etc.)

ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler extends from ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler , but it refines the underlying ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler in the following way:

  1. startElement/endElement events must receive non-null String for uri, localName, and qname, even though SAX allows some of them to be null. Similarly, the user-specified ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler will receive non-null Strings for all three parameters.
  2. Applications must ensure that ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler 's ContentHandler.startPrefixMapping(String,String) sample code for org.xml.sax.ContentHandler.startPrefixMapping(java.lang.String, java.lang.String) definition code for org.xml.sax.ContentHandler.startPrefixMapping(java.lang.String, java.lang.String) and ContentHandler.endPrefixMapping(String) sample code for org.xml.sax.ContentHandler.endPrefixMapping(java.lang.String) definition code for org.xml.sax.ContentHandler.endPrefixMapping(java.lang.String) are invoked properly. Similarly, the user-specified ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler will receive startPrefixMapping/endPrefixMapping events. If the ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler introduces additional namespace bindings, the user-specified ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler will receive additional startPrefixMapping/endPrefixMapping events.
  3. Attributes sample code for org.xml.sax.Attributes definition code for org.xml.sax.Attributes for the ContentHandler.startElement(String,String,String,Attributes) sample code for org.xml.sax.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) definition code for org.xml.sax.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) method may or may not include xmlns* attributes.

A ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler is automatically reset every time the startDocument method is invoked.

Recognized Properties and Features

This spec defines the following feature that must be recognized by all ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler implementations.

http://xml.org/sax/features/namespace-prefixes

This feature controls how a ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler introduces namespace bindings that were not present in the original SAX event stream. When this feature is set to true, it must make sure that the user's ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler will see the corresponding xmlns* attribute in the Attributes sample code for org.xml.sax.Attributes definition code for org.xml.sax.Attributes object of the ContentHandler.startElement(String,String,String,Attributes) sample code for org.xml.sax.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) definition code for org.xml.sax.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) callback. Otherwise, xmlns* attributes must not be added to Attributes sample code for org.xml.sax.Attributes definition code for org.xml.sax.Attributes that's passed to the user-specified ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler .

(Note that regardless of this switch, namespace bindings are always notified to applications through ContentHandler.startPrefixMapping(String,String) sample code for org.xml.sax.ContentHandler.startPrefixMapping(java.lang.String, java.lang.String) definition code for org.xml.sax.ContentHandler.startPrefixMapping(java.lang.String, java.lang.String) and ContentHandler.endPrefixMapping(String) sample code for org.xml.sax.ContentHandler.endPrefixMapping(java.lang.String) definition code for org.xml.sax.ContentHandler.endPrefixMapping(java.lang.String) methods of the ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler specified by the user.)

Note that this feature does NOT affect the way a ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler receives SAX events. It merely changes the way it augments SAX events.

This feature is set to false by default.

Since:
1.5

Constructor Summary
protected ValidatorHandler sample code for javax.xml.validation.ValidatorHandler.ValidatorHandler() definition code for javax.xml.validation.ValidatorHandler.ValidatorHandler() ()
          Constructor for derived classes.
 
Method Summary
abstract  ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler getContentHandler sample code for javax.xml.validation.ValidatorHandler.getContentHandler() definition code for javax.xml.validation.ValidatorHandler.getContentHandler() ()
          Gets the ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler which receives the augmented validation result.
abstract  ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler getErrorHandler sample code for javax.xml.validation.ValidatorHandler.getErrorHandler() definition code for javax.xml.validation.ValidatorHandler.getErrorHandler() ()
          Gets the current ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler set to this ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler .
 boolean getFeature sample code for javax.xml.validation.ValidatorHandler.getFeature(java.lang.String) definition code for javax.xml.validation.ValidatorHandler.getFeature(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Look up the value of a feature flag.
 Object sample code for java.lang.Object definition code for java.lang.Object getProperty sample code for javax.xml.validation.ValidatorHandler.getProperty(java.lang.String) definition code for javax.xml.validation.ValidatorHandler.getProperty(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Look up the value of a property.
abstract  LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver getResourceResolver sample code for javax.xml.validation.ValidatorHandler.getResourceResolver() definition code for javax.xml.validation.ValidatorHandler.getResourceResolver() ()
          Gets the current LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver set to this ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler .
abstract  TypeInfoProvider sample code for javax.xml.validation.TypeInfoProvider definition code for javax.xml.validation.TypeInfoProvider getTypeInfoProvider sample code for javax.xml.validation.ValidatorHandler.getTypeInfoProvider() definition code for javax.xml.validation.ValidatorHandler.getTypeInfoProvider() ()
          Obtains the TypeInfoProvider sample code for javax.xml.validation.TypeInfoProvider definition code for javax.xml.validation.TypeInfoProvider implementation of this ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler .
abstract  void setContentHandler sample code for javax.xml.validation.ValidatorHandler.setContentHandler(org.xml.sax.ContentHandler) definition code for javax.xml.validation.ValidatorHandler.setContentHandler(org.xml.sax.ContentHandler) (ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler  receiver)
          Sets the ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler which receives the augmented validation result.
abstract  void setErrorHandler sample code for javax.xml.validation.ValidatorHandler.setErrorHandler(org.xml.sax.ErrorHandler) definition code for javax.xml.validation.ValidatorHandler.setErrorHandler(org.xml.sax.ErrorHandler) (ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler  errorHandler)
          Sets the ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler to receive errors encountered during the validation.
 void setFeature sample code for javax.xml.validation.ValidatorHandler.setFeature(java.lang.String, boolean) definition code for javax.xml.validation.ValidatorHandler.setFeature(java.lang.String, boolean) (String sample code for java.lang.String definition code for java.lang.String  name, boolean value)
          Set the value of a feature flag.
 void setProperty sample code for javax.xml.validation.ValidatorHandler.setProperty(java.lang.String, java.lang.Object) definition code for javax.xml.validation.ValidatorHandler.setProperty(java.lang.String, java.lang.Object) (String sample code for java.lang.String definition code for java.lang.String  name, Object sample code for java.lang.Object definition code for java.lang.Object  object)
          Set the value of a property.
abstract  void setResourceResolver sample code for javax.xml.validation.ValidatorHandler.setResourceResolver(org.w3c.dom.ls.LSResourceResolver) definition code for javax.xml.validation.ValidatorHandler.setResourceResolver(org.w3c.dom.ls.LSResourceResolver) (LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver  resourceResolver)
          Sets the LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver to customize resource resolution while in a validation episode.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 
Methods inherited from interface org.xml.sax.ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler
characters sample code for org.xml.sax.ContentHandler.characters(char[], int, int) definition code for org.xml.sax.ContentHandler.characters(char[], int, int) , endDocument sample code for org.xml.sax.ContentHandler.endDocument() definition code for org.xml.sax.ContentHandler.endDocument() , endElement sample code for org.xml.sax.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String) definition code for org.xml.sax.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String) , endPrefixMapping sample code for org.xml.sax.ContentHandler.endPrefixMapping(java.lang.String) definition code for org.xml.sax.ContentHandler.endPrefixMapping(java.lang.String) , ignorableWhitespace sample code for org.xml.sax.ContentHandler.ignorableWhitespace(char[], int, int) definition code for org.xml.sax.ContentHandler.ignorableWhitespace(char[], int, int) , processingInstruction sample code for org.xml.sax.ContentHandler.processingInstruction(java.lang.String, java.lang.String) definition code for org.xml.sax.ContentHandler.processingInstruction(java.lang.String, java.lang.String) , setDocumentLocator sample code for org.xml.sax.ContentHandler.setDocumentLocator(org.xml.sax.Locator) definition code for org.xml.sax.ContentHandler.setDocumentLocator(org.xml.sax.Locator) , skippedEntity sample code for org.xml.sax.ContentHandler.skippedEntity(java.lang.String) definition code for org.xml.sax.ContentHandler.skippedEntity(java.lang.String) , startDocument sample code for org.xml.sax.ContentHandler.startDocument() definition code for org.xml.sax.ContentHandler.startDocument() , startElement sample code for org.xml.sax.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) definition code for org.xml.sax.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) , startPrefixMapping sample code for org.xml.sax.ContentHandler.startPrefixMapping(java.lang.String, java.lang.String) definition code for org.xml.sax.ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)
 

Constructor Detail

ValidatorHandler sample code for javax.xml.validation.ValidatorHandler() definition code for javax.xml.validation.ValidatorHandler()

protected ValidatorHandler()
Constructor for derived classes.

The constructor does nothing.

Derived classes must create ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler objects that have null ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler and null LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver .

Method Detail

setContentHandler sample code for javax.xml.validation.ValidatorHandler.setContentHandler(org.xml.sax.ContentHandler) definition code for javax.xml.validation.ValidatorHandler.setContentHandler(org.xml.sax.ContentHandler)

public abstract void setContentHandler(ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler  receiver)
Sets the ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler which receives the augmented validation result.

When a ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler is specified, a ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler will work as a filter and basically copy the incoming events to the specified ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler .

In doing so, a ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler may modify the events, for example by adding defaulted attributes.

A ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler may buffer events to certain extent, but to allow ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler to be used by a parser, the following requirement has to be met.

  1. When ContentHandler.startElement(String, String, String, Attributes) sample code for org.xml.sax.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) definition code for org.xml.sax.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) , ContentHandler.endElement(String, String, String) sample code for org.xml.sax.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String) definition code for org.xml.sax.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String) , ContentHandler.startDocument() sample code for org.xml.sax.ContentHandler.startDocument() definition code for org.xml.sax.ContentHandler.startDocument() , or ContentHandler.endDocument() sample code for org.xml.sax.ContentHandler.endDocument() definition code for org.xml.sax.ContentHandler.endDocument() are invoked on a ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler , the same method on the user-specified ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler must be invoked for the same event before the callback returns.
  2. ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler may not introduce new elements that were not present in the input.
  3. ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler may not remove attributes that were present in the input.

When a callback method on the specified ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler throws an exception, the same exception object must be thrown from the ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler . The ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler should not be notified of such an exception.

This method can be called even during a middle of a validation.

Parameters:
receiver - A ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler or a null value.

getContentHandler sample code for javax.xml.validation.ValidatorHandler.getContentHandler() definition code for javax.xml.validation.ValidatorHandler.getContentHandler()

public abstract ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler  getContentHandler()
Gets the ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler which receives the augmented validation result.

Returns:
This method returns the object that was last set through the getContentHandler() sample code for javax.xml.validation.ValidatorHandler.getContentHandler() definition code for javax.xml.validation.ValidatorHandler.getContentHandler() method, or null if that method has never been called since this ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler has created.
See Also:
setContentHandler(ContentHandler) sample code for javax.xml.validation.ValidatorHandler.setContentHandler(org.xml.sax.ContentHandler) definition code for javax.xml.validation.ValidatorHandler.setContentHandler(org.xml.sax.ContentHandler)

setErrorHandler sample code for javax.xml.validation.ValidatorHandler.setErrorHandler(org.xml.sax.ErrorHandler) definition code for javax.xml.validation.ValidatorHandler.setErrorHandler(org.xml.sax.ErrorHandler)

public abstract void setErrorHandler(ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler  errorHandler)
Sets the ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler to receive errors encountered during the validation.

Error handler can be used to customize the error handling process during a validation. When an ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler is set, errors found during the validation will be first sent to the ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler .

The error handler can abort further validation immediately by throwing SAXException sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException from the handler. Or for example it can print an error to the screen and try to continue the validation by returning normally from the ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler

If any Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable is thrown from an ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler , the same Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable object will be thrown toward the root of the call stack.

ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler is not allowed to throw SAXException sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException without first reporting it to ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler .

When the ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler is null, the implementation will behave as if the following ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler is set:

 class DraconianErrorHandler implements ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler  {
     public void fatalError( SAXParseException sample code for org.xml.sax.SAXParseException definition code for org.xml.sax.SAXParseException  e ) throws SAXException sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException  {
         throw e;
     }
     public void error( SAXParseException sample code for org.xml.sax.SAXParseException definition code for org.xml.sax.SAXParseException  e ) throws SAXException sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException  {
         throw e;
     }
     public void warning( SAXParseException sample code for org.xml.sax.SAXParseException definition code for org.xml.sax.SAXParseException  e ) throws SAXException sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException  {
         // noop
     }
 }
 

When a new ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler object is created, initially this field is set to null.

Parameters:
errorHandler - A new error handler to be set. This parameter can be null.

getErrorHandler sample code for javax.xml.validation.ValidatorHandler.getErrorHandler() definition code for javax.xml.validation.ValidatorHandler.getErrorHandler()

public abstract ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler  getErrorHandler()
Gets the current ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler set to this ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler .

Returns:
This method returns the object that was last set through the setErrorHandler(ErrorHandler) sample code for javax.xml.validation.ValidatorHandler.setErrorHandler(org.xml.sax.ErrorHandler) definition code for javax.xml.validation.ValidatorHandler.setErrorHandler(org.xml.sax.ErrorHandler) method, or null if that method has never been called since this ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler has created.
See Also:
setErrorHandler(ErrorHandler) sample code for javax.xml.validation.ValidatorHandler.setErrorHandler(org.xml.sax.ErrorHandler) definition code for javax.xml.validation.ValidatorHandler.setErrorHandler(org.xml.sax.ErrorHandler)

setResourceResolver sample code for javax.xml.validation.ValidatorHandler.setResourceResolver(org.w3c.dom.ls.LSResourceResolver) definition code for javax.xml.validation.ValidatorHandler.setResourceResolver(org.w3c.dom.ls.LSResourceResolver)

public abstract void setResourceResolver(LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver  resourceResolver)
Sets the LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver to customize resource resolution while in a validation episode.

ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler uses a LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver when it needs to locate external resources while a validation, although exactly what constitutes "locating external resources" is up to each schema language.

When the LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver is null, the implementation will behave as if the following LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver is set:

 class DumbLSResourceResolver implements LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver  {
     public LSInput sample code for org.w3c.dom.ls.LSInput definition code for org.w3c.dom.ls.LSInput  resolveResource(
         String publicId, String systemId, String baseURI) {
         
         return null; // always return null
     }
 }
 

If a LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver throws a RuntimeException sample code for java.lang.RuntimeException definition code for java.lang.RuntimeException (or instances of its derived classes), then the ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler will abort the parsing and the caller of the validate method will receive the same RuntimeException sample code for java.lang.RuntimeException definition code for java.lang.RuntimeException .

When a new ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler object is created, initially this field is set to null.

Parameters:
resourceResolver - A new resource resolver to be set. This parameter can be null.

getResourceResolver sample code for javax.xml.validation.ValidatorHandler.getResourceResolver() definition code for javax.xml.validation.ValidatorHandler.getResourceResolver()

public abstract LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver  getResourceResolver()
Gets the current LSResourceResolver sample code for org.w3c.dom.ls.LSResourceResolver definition code for org.w3c.dom.ls.LSResourceResolver set to this ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler .

Returns:
This method returns the object that was last set through the setResourceResolver(LSResourceResolver) sample code for javax.xml.validation.ValidatorHandler.setResourceResolver(org.w3c.dom.ls.LSResourceResolver) definition code for javax.xml.validation.ValidatorHandler.setResourceResolver(org.w3c.dom.ls.LSResourceResolver) method, or null if that method has never been called since this ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler has created.
See Also:
setErrorHandler(ErrorHandler) sample code for javax.xml.validation.ValidatorHandler.setErrorHandler(org.xml.sax.ErrorHandler) definition code for javax.xml.validation.ValidatorHandler.setErrorHandler(org.xml.sax.ErrorHandler)

getTypeInfoProvider sample code for javax.xml.validation.ValidatorHandler.getTypeInfoProvider() definition code for javax.xml.validation.ValidatorHandler.getTypeInfoProvider()

public abstract TypeInfoProvider sample code for javax.xml.validation.TypeInfoProvider definition code for javax.xml.validation.TypeInfoProvider  getTypeInfoProvider()
Obtains the TypeInfoProvider sample code for javax.xml.validation.TypeInfoProvider definition code for javax.xml.validation.TypeInfoProvider implementation of this ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler .

The obtained TypeInfoProvider sample code for javax.xml.validation.TypeInfoProvider definition code for javax.xml.validation.TypeInfoProvider can be queried during a parse to access the type information determined by the validator.

Some schema languages do not define the notion of type, for those languages, this method may not be supported. However, to be compliant with this specification, implementations for W3C XML Schema 1.0 must support this operation.

Returns:
null if the validator / schema language does not support the notion of TypeInfo sample code for org.w3c.dom.TypeInfo definition code for org.w3c.dom.TypeInfo . Otherwise a non-null valid TypeInfoProvider sample code for javax.xml.validation.TypeInfoProvider definition code for javax.xml.validation.TypeInfoProvider .

getFeature sample code for javax.xml.validation.ValidatorHandler.getFeature(java.lang.String) definition code for javax.xml.validation.ValidatorHandler.getFeature(java.lang.String)

public boolean getFeature(String sample code for java.lang.String definition code for java.lang.String  name)
                   throws SAXNotRecognizedException sample code for org.xml.sax.SAXNotRecognizedException definition code for org.xml.sax.SAXNotRecognizedException ,
                          SAXNotSupportedException sample code for org.xml.sax.SAXNotSupportedException definition code for org.xml.sax.SAXNotSupportedException 
Look up the value of a feature flag.

The feature name is any fully-qualified URI. It is possible for a ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler 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.

Parameters:
name - The feature name, which is a non-null fully-qualified URI.
Returns:
The current value of the feature (true or false).
Throws:
SAXNotRecognizedException sample code for org.xml.sax.SAXNotRecognizedException definition code for org.xml.sax.SAXNotRecognizedException - If the feature value can't be assigned or retrieved.
SAXNotSupportedException sample code for org.xml.sax.SAXNotSupportedException definition code for org.xml.sax.SAXNotSupportedException - When the ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler recognizes the feature name but cannot determine its value at this time.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - When the name parameter is null.
See Also:
setFeature(String, boolean) sample code for javax.xml.validation.ValidatorHandler.setFeature(java.lang.String, boolean) definition code for javax.xml.validation.ValidatorHandler.setFeature(java.lang.String, boolean)

setFeature sample code for javax.xml.validation.ValidatorHandler.setFeature(java.lang.String, boolean) definition code for javax.xml.validation.ValidatorHandler.setFeature(java.lang.String, boolean)

public void setFeature(String sample code for java.lang.String definition code for java.lang.String  name,
                       boolean value)
                throws SAXNotRecognizedException sample code for org.xml.sax.SAXNotRecognizedException definition code for org.xml.sax.SAXNotRecognizedException ,
                       SAXNotSupportedException sample code for org.xml.sax.SAXNotSupportedException definition code for org.xml.sax.SAXNotSupportedException 
Set the value of a feature flag.

Feature can be used to control the way a ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler parses schemas, although ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler s are not required to recognize any specific property names.

The feature name is any fully-qualified URI. It is possible for a ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler 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.

Parameters:
name - The feature name, which is a non-null fully-qualified URI.
value - The requested value of the feature (true or false).
Throws:
SAXNotRecognizedException sample code for org.xml.sax.SAXNotRecognizedException definition code for org.xml.sax.SAXNotRecognizedException - If the feature value can't be assigned or retrieved.
SAXNotSupportedException sample code for org.xml.sax.SAXNotSupportedException definition code for org.xml.sax.SAXNotSupportedException - When the ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler recognizes the feature name but cannot set the requested value.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - When the name parameter is null.
See Also:
getFeature(String) sample code for javax.xml.validation.ValidatorHandler.getFeature(java.lang.String) definition code for javax.xml.validation.ValidatorHandler.getFeature(java.lang.String)

setProperty sample code for javax.xml.validation.ValidatorHandler.setProperty(java.lang.String, java.lang.Object) definition code for javax.xml.validation.ValidatorHandler.setProperty(java.lang.String, java.lang.Object)

public void setProperty(String sample code for java.lang.String definition code for java.lang.String  name,
                        Object sample code for java.lang.Object definition code for java.lang.Object  object)
                 throws SAXNotRecognizedException sample code for org.xml.sax.SAXNotRecognizedException definition code for org.xml.sax.SAXNotRecognizedException ,
                        SAXNotSupportedException sample code for org.xml.sax.SAXNotSupportedException definition code for org.xml.sax.SAXNotSupportedException 
Set the value of a property.

The property name is any fully-qualified URI. It is possible for a ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler 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.

ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler s are not required to recognize setting any specific property names.

Parameters:
name - The property name, which is a non-null fully-qualified URI.
object - The requested value for the property.
Throws:
SAXNotRecognizedException sample code for org.xml.sax.SAXNotRecognizedException definition code for org.xml.sax.SAXNotRecognizedException - If the property value can't be assigned or retrieved.
SAXNotSupportedException sample code for org.xml.sax.SAXNotSupportedException definition code for org.xml.sax.SAXNotSupportedException - When the ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler recognizes the property name but cannot set the requested value.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - When the name parameter is null.

getProperty sample code for javax.xml.validation.ValidatorHandler.getProperty(java.lang.String) definition code for javax.xml.validation.ValidatorHandler.getProperty(java.lang.String)

public Object sample code for java.lang.Object definition code for java.lang.Object  getProperty(String sample code for java.lang.String definition code for java.lang.String  name)
                   throws SAXNotRecognizedException sample code for org.xml.sax.SAXNotRecognizedException definition code for org.xml.sax.SAXNotRecognizedException ,
                          SAXNotSupportedException sample code for org.xml.sax.SAXNotSupportedException definition code for org.xml.sax.SAXNotSupportedException 
Look up the value of a property.

The property name is any fully-qualified URI. It is possible for a ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler 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.

ValidatorHandler sample code for javax.xml.validation.ValidatorHandler definition code for javax.xml.validation.ValidatorHandler 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.

Parameters:
name - The property name, which is a non-null fully-qualified URI.
Returns:
The current value of the property.
Throws:
SAXNotRecognizedException sample code for org.xml.sax.SAXNotRecognizedException definition code for org.xml.sax.SAXNotRecognizedException - If the property value can't be assigned or retrieved.
SAXNotSupportedException sample code for org.xml.sax.SAXNotSupportedException definition code for org.xml.sax.SAXNotSupportedException - When the XMLReader recognizes the property name but cannot determine its value at this time.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - When the name parameter is null.
See Also:
setProperty(String, Object) sample code for javax.xml.validation.ValidatorHandler.setProperty(java.lang.String, java.lang.Object) definition code for javax.xml.validation.ValidatorHandler.setProperty(java.lang.String, java.lang.Object)