# ValidatorHandler

public abstract class **ValidatorHandler** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
implements [ContentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html) Streaming validator that works on SAX stream.


A `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` object is a thread-unsafe, non-reentrant object.
In other words, it is the application's responsibility to make
sure that one `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` object is not used from
more than one thread at any given time.


`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` checks if the SAX events follow
the set of constraints described in the associated `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/Schema.html`,
and additionally it may modify the SAX events (for example
by adding default values, etc.)


`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` extends from `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html`,
but it refines the underlying `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` 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 `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` will receive non-null Strings for all three parameters.
2. Applications must ensure that `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`'s `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startPrefixMapping(java.lang.String,%20java.lang.String)` and `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endPrefixMapping(java.lang.String)` are invoked properly. Similarly, the user-specified `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` will receive startPrefixMapping/endPrefixMapping events. If the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` introduces additional namespace bindings, the user-specified `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` will receive additional startPrefixMapping/endPrefixMapping events.
3. `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Attributes.html` for the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes)` method may or may not include xmlns\* attributes.


A `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` 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 `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` implementations.

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


This feature controls how a `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` 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 `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` will see
the corresponding `xmlns*` attribute in
the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Attributes.html` object of the
`https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes)`
callback. Otherwise, `xmlns*` attributes must not be
added to `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Attributes.html` that's passed to the
user-specified `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html`.


(Note that regardless of this switch, namespace bindings are
always notified to applications through
`https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startPrefixMapping(java.lang.String,%20java.lang.String)` and
`https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endPrefixMapping(java.lang.String)` methods of the
`https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` specified by the user.)


Note that this feature does *NOT* affect the way
a `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` receives SAX events. It merely
changes the way it augments SAX events.

This feature is set to `false` by default.

<br />

### Protected Constructor Summary

|---|---|
|   | [ValidatorHandler](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#ValidatorHandler())() Constructor for derived classes. |

### Public Method Summary

|---|---|
| abstract [ContentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html) | [getContentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#getContentHandler())() Gets the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` which receives the augmented validation result. |
| abstract [ErrorHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html) | [getErrorHandler](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#getErrorHandler())() Gets the current `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html` set to this `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`. |
| boolean | [getFeature](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#getFeature(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Look up the value of a feature flag. |
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [getProperty](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#getProperty(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Look up the value of a property. |
| abstract [LSResourceResolver](https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html) | [getResourceResolver](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#getResourceResolver())() Gets the current `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html` set to this `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`. |
| abstract [TypeInfoProvider](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/TypeInfoProvider.html) | [getTypeInfoProvider](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#getTypeInfoProvider())() Obtains the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/TypeInfoProvider.html` implementation of this `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`. |
| abstract void | [setContentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#setContentHandler(org.xml.sax.ContentHandler))([ContentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html) receiver) Sets the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` which receives the augmented validation result. |
| abstract void | [setErrorHandler](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#setErrorHandler(org.xml.sax.ErrorHandler))([ErrorHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html) errorHandler) Sets the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html` to receive errors encountered during the validation. |
| void | [setFeature](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#setFeature(java.lang.String,%20boolean))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, boolean value) Set the value of a feature flag. |
| void | [setProperty](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#setProperty(java.lang.String,%20java.lang.Object))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) object) Set the value of a property. |
| abstract void | [setResourceResolver](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#setResourceResolver(org.w3c.dom.ls.LSResourceResolver))([LSResourceResolver](https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html) resourceResolver) Sets the `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html` to customize resource resolution while in a validation episode. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [org.xml.sax.ContentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html)

|---|---|
| abstract void | [characters](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#characters(char[],%20int,%20int))(char\[\] ch, int start, int length) Receive notification of character data. |
| abstract void | [endDocument](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endDocument())() Receive notification of the end of a document. |
| abstract void | [endElement](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endElement(java.lang.String,%20java.lang.String,%20java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) uri, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) localName, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) qName) Receive notification of the end of an element. |
| abstract void | [endPrefixMapping](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endPrefixMapping(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) prefix) End the scope of a prefix-URI mapping. |
| abstract void | [ignorableWhitespace](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#ignorableWhitespace(char[],%20int,%20int))(char\[\] ch, int start, int length) Receive notification of ignorable whitespace in element content. |
| abstract void | [processingInstruction](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#processingInstruction(java.lang.String,%20java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) target, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) data) Receive notification of a processing instruction. |
| abstract void | [setDocumentLocator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#setDocumentLocator(org.xml.sax.Locator))([Locator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html) locator) Receive an object for locating the origin of SAX document events. |
| abstract void | [skippedEntity](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#skippedEntity(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Receive notification of a skipped entity. |
| abstract void | [startDocument](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startDocument())() Receive notification of the beginning of a document. |
| abstract void | [startElement](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) uri, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) localName, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) qName, [Attributes](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Attributes.html) atts) Receive notification of the beginning of an element. |
| abstract void | [startPrefixMapping](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startPrefixMapping(java.lang.String,%20java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) prefix, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) uri) Begin the scope of a prefix-URI Namespace mapping. |

## Protected Constructors

#### protected
**ValidatorHandler**
()

Constructor for derived classes.


The constructor does nothing.


Derived classes must create `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` objects that have
null `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html` and
null `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html`.

## Public Methods

#### public abstract [ContentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html)
**getContentHandler**
()

Gets the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` which receives the
augmented validation result.

##### Returns

- This method returns the object that was last set through the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#getContentHandler()` method, or null if that method has never been called since this `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` has created.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#setContentHandler(org.xml.sax.ContentHandler)`

#### public abstract [ErrorHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html)
**getErrorHandler**
()

Gets the current `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html` set to this `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`.

##### Returns

- This method returns the object that was last set through the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#setErrorHandler(org.xml.sax.ErrorHandler)` method, or null if that method has never been called since this `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` has created.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#setErrorHandler(org.xml.sax.ErrorHandler)`

#### public boolean
**getFeature**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name)

Look up the value of a feature flag.

The feature name is any fully-qualified URI. It is
possible for a `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` 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.

<br />

##### 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](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotRecognizedException.html) | If the feature value can't be assigned or retrieved. |
| [SAXNotSupportedException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotSupportedException.html) | When the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` recognizes the feature name but cannot determine its value at this time. |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | When the name parameter is null. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#setFeature(java.lang.String,%20boolean)`

#### public [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)
**getProperty**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name)

Look up the value of a property.

The property name is any fully-qualified URI. It is
possible for a `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` 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.

`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`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.

<br />

##### Parameters

| name | The property name, which is a non-null fully-qualified URI. |
|---|---|

##### Returns

- The current value of the property.

##### Throws

| [SAXNotRecognizedException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotRecognizedException.html) | If the property value can't be assigned or retrieved. |
| [SAXNotSupportedException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotSupportedException.html) | When the XMLReader recognizes the property name but cannot determine its value at this time. |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | When the name parameter is null. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#setProperty(java.lang.String,%20java.lang.Object)`

#### public abstract [LSResourceResolver](https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html)
**getResourceResolver**
()

Gets the current `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html` set to this `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`.

##### Returns

- This method returns the object that was last set through the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#setResourceResolver(org.w3c.dom.ls.LSResourceResolver)` method, or null if that method has never been called since this `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` has created.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#setErrorHandler(org.xml.sax.ErrorHandler)`

#### public abstract [TypeInfoProvider](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/TypeInfoProvider.html)
**getTypeInfoProvider**
()

Obtains the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/TypeInfoProvider.html` implementation of this
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`.


The obtained `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/TypeInfoProvider.html` 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 `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html`. Otherwise a non-null valid `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/TypeInfoProvider.html`.

#### public abstract void
**setContentHandler**
([ContentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html) receiver)

Sets the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` which receives
the augmented validation result.


When a `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` is specified, a
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` will work as a filter
and basically copy the incoming events to the
specified `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html`.


In doing so, a `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` may modify
the events, for example by adding defaulted attributes.


A `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` may buffer events to certain
extent, but to allow `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` to be used
by a parser, the following requirement has to be met.

1. When `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes)`, `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endElement(java.lang.String,%20java.lang.String,%20java.lang.String)`, `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startDocument()`, or `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endDocument()` are invoked on a `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`, the same method on the user-specified `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` must be invoked for the same event before the callback returns.
2. `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` may not introduce new elements that were not present in the input.
3. `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` may not remove attributes that were present in the input.


When a callback method on the specified `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html`
throws an exception, the same exception object must be thrown
from the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`. The `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html`
should not be notified of such an exception.


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

##### Parameters

| receiver | A `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` or a null value. |
|---|---|

#### public abstract void
**setErrorHandler**
([ErrorHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html) errorHandler)

Sets the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html` to receive errors encountered
during the validation.


Error handler can be used to customize the error handling process
during a validation. When an `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html` is set,
errors found during the validation will be first sent
to the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html`.


The error handler can abort further validation immediately
by throwing `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html` 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 `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html`


If any `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html` is thrown from an `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html`,
the same `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html` object will be thrown toward the
root of the call stack.


`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` is not allowed to
throw `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html` without first reporting it to
`https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html`.


When the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html` is null, the implementation will
behave as if the following `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html` is set:

     class DraconianErrorHandler implements https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html {
         public void fatalError( https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html e ) throws https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html {
             throw e;
         }
         public void error( https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html e ) throws https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html {
             throw e;
         }
         public void warning( https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html e ) throws https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html {
             // noop
         }
     }
     

When a new `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` object is created, initially
this field is set to null.

##### Parameters

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

#### public void
**setFeature**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, boolean value)

Set the value of a feature flag.


Feature can be used to control the way a `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`
parses schemas, although `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`s are not required
to recognize any specific property names.

The feature name is any fully-qualified URI. It is
possible for a `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` 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.

<br />

##### 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](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotRecognizedException.html) | If the feature value can't be assigned or retrieved. |
| [SAXNotSupportedException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotSupportedException.html) | When the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` recognizes the feature name but cannot set the requested value. |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | When the name parameter is null. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#getFeature(java.lang.String)`

#### public void
**setProperty**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) object)

Set the value of a property.

The property name is any fully-qualified URI. It is
possible for a `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` 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.

`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`s are not required to recognize setting
any specific property names.

<br />

##### Parameters

| name | The property name, which is a non-null fully-qualified URI. |
| object | The requested value for the property. |
|---|---|

##### Throws

| [SAXNotRecognizedException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotRecognizedException.html) | If the property value can't be assigned or retrieved. |
| [SAXNotSupportedException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotSupportedException.html) | When the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` recognizes the property name but cannot set the requested value. |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | When the name parameter is null. |
|---|---|

#### public abstract void
**setResourceResolver**
([LSResourceResolver](https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html) resourceResolver)

Sets the `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html` to customize
resource resolution while in a validation episode.


`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` uses a `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html`
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 `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html` is null, the implementation will
behave as if the following `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html` is set:

     class DumbLSResourceResolver implements https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html {
         public https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSInput.html resolveResource(
             String publicId, String systemId, String baseURI) {

             return null; // always return null
         }
     }
     

If a `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSResourceResolver.html` throws a `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/RuntimeException.html`
(or instances of its derived classes),
then the `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` will abort the parsing and
the caller of the `validate` method will receive
the same `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/RuntimeException.html`.


When a new `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html` object is created, initially
this field is set to null.

##### Parameters

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