# TypeInfoProvider

public abstract class **TypeInfoProvider** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
This class provides access to the type information determined
by `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`.


Some schema languages, such as W3C XML Schema, encourages a validator
to report the "type" it assigns to each attribute/element.
Those applications who wish to access this type information can invoke
methods defined on this "interface" to access such type information.


Implementation of this "interface" can be obtained through the
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html#getTypeInfoProvider()` method.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html`

### Protected Constructor Summary

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

### Public Method Summary

|---|---|
| abstract [TypeInfo](https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html) | [getAttributeTypeInfo](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/TypeInfoProvider.html#getAttributeTypeInfo(int))(int index) Returns the immutable `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html` object for the specified attribute of the current element. |
| abstract [TypeInfo](https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html) | [getElementTypeInfo](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/TypeInfoProvider.html#getElementTypeInfo())() Returns the immutable `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html` object for the current element. |
| abstract boolean | [isIdAttribute](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/TypeInfoProvider.html#isIdAttribute(int))(int index) Returns true if the specified attribute is determined to be ID. |
| abstract boolean | [isSpecified](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/TypeInfoProvider.html#isSpecified(int))(int index) Returns false if the attribute was added by the validator. |

### 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. |

## Protected Constructors

#### protected
**TypeInfoProvider**
()

Constructor for the derived class.


The constructor does nothing.

## Public Methods

#### public abstract [TypeInfo](https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html)
**getAttributeTypeInfo**
(int index)

Returns the immutable `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html` object for the specified
attribute of the current element.


The method may only be called by the startElement event of
the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` that the application sets to the
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`.

##### Parameters

| index | The index of the attribute. The same index for the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Attributes.html` object passed to the startElement callback. |
|---|---|

##### Returns

- An immutable `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html` object that represents the type of the specified attribute. Note that the caller can keep references to the obtained `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html` longer than the callback scope. Otherwise, this method returns null if the validator is unable to determine the type.

##### Throws

| [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) | If the index is invalid. |
| [IllegalStateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalStateException.html) | If this method is called from other `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` methods. |
|---|---|

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

<br />

Returns the immutable `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html` object for the current element.


The method may only be called by the startElement and endElement event of
the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` that the application sets to the
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`.

<br />

##### Returns

- An immutable `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html` object that represents the type of the current element. Note that the caller can keep references to the obtained `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/TypeInfo.html` longer than the callback scope. Otherwise, this method returns null if the validator is unable to determine the type of the current element for some reason (for example, if the validator is recovering from an earlier error.)

##### Throws

| [IllegalStateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalStateException.html) | If this method is called from other `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` methods. |
|---|---|

#### public abstract boolean
**isIdAttribute**
(int index)

Returns true if the specified attribute is determined
to be ID.


Exactly how an attribute is "determined to be ID" is up to the
schema language. In case of W3C XML Schema, this means
that the actual type of the attribute is the built-in ID type
or its derived type.


A `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/parsers/DocumentBuilder.html` uses this information
to properly implement `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/Attr.html#isId()`.


The method may only be called by the startElement event of
the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` that the application sets to the
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`.

##### Parameters

| index | The index of the attribute. The same index for the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Attributes.html` object passed to the startElement callback. |
|---|---|

##### Returns

- true if the type of the specified attribute is ID.

##### Throws

| [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) | If the index is invalid. |
| [IllegalStateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalStateException.html) | If this method is called from other `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` methods. |
|---|---|

#### public abstract boolean
**isSpecified**
(int index)

Returns false if the attribute was added by the validator.


This method provides information necessary for
a `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/parsers/DocumentBuilder.html` to determine what
the DOM tree should return from the `https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/Attr.html#getSpecified()` method.


The method may only be called by the startElement event of
the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` that the application sets to the
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/validation/ValidatorHandler.html`.


A general guideline for validators is to return true if
the attribute was originally present in the pipeline, and
false if it was added by the validator.

##### Parameters

| index | The index of the attribute. The same index for the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Attributes.html` object passed to the startElement callback. |
|---|---|

##### Returns

- true if the attribute was present before the validator processes input. false if the attribute was added by the validator.

##### Throws

| [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) | If the index is invalid. |
| [IllegalStateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalStateException.html) | If this method is called from other `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` methods. |
|---|---|