Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Protected Ctors](https://developer.android.com/reference/javax/xml/validation/TypeInfoProvider#proctors) \| [Methods](https://developer.android.com/reference/javax/xml/validation/TypeInfoProvider#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/javax/xml/validation/TypeInfoProvider#inhmethods)

# TypeInfoProvider

` public abstract class TypeInfoProvider `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | javax.xml.validation.TypeInfoProvider |

<br />

*** ** * ** ***

This class provides access to the type information determined by `https://developer.android.com/reference/javax/xml/validation/ValidatorHandler`.

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://developer.android.com/reference/javax/xml/validation/ValidatorHandler#getTypeInfoProvider()` method.
**See also:**

- `https://developer.android.com/reference/org/w3c/dom/TypeInfo`

## Summary

| ### Protected constructors ||
|---|---|
| ` https://developer.android.com/reference/javax/xml/validation/TypeInfoProvider#TypeInfoProvider()() ` Constructor for the derived class. |

| ### Public methods ||
|---|---|
| ` abstract https://developer.android.com/reference/org/w3c/dom/TypeInfo` | ` https://developer.android.com/reference/javax/xml/validation/TypeInfoProvider#getAttributeTypeInfo(int)(int index) ` Returns the immutable `https://developer.android.com/reference/org/w3c/dom/TypeInfo` object for the specified attribute of the current element. |
| ` abstract https://developer.android.com/reference/org/w3c/dom/TypeInfo` | ` https://developer.android.com/reference/javax/xml/validation/TypeInfoProvider#getElementTypeInfo()() ` <br /> Returns the immutable `https://developer.android.com/reference/org/w3c/dom/TypeInfo` object for the current element. |
| ` abstract boolean` | ` https://developer.android.com/reference/javax/xml/validation/TypeInfoProvider#isIdAttribute(int)(int index) ` Returns true if the specified attribute is determined to be ID. |
| ` abstract boolean` | ` https://developer.android.com/reference/javax/xml/validation/TypeInfoProvider#isSpecified(int)(int index) ` Returns false if the attribute was added by the validator. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Protected constructors

### TypeInfoProvider

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected TypeInfoProvider ()
```

Constructor for the derived class.

The constructor does nothing.

<br />

## Public methods

### getAttributeTypeInfo

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract TypeInfo getAttributeTypeInfo (int index)
```

Returns the immutable `https://developer.android.com/reference/org/w3c/dom/TypeInfo` object for the specified attribute of the current element.

The method may only be called by the startElement event of the `https://developer.android.com/reference/org/xml/sax/ContentHandler` that the application sets to the `https://developer.android.com/reference/javax/xml/validation/ValidatorHandler`.

<br />

| Parameters ||
|---|---|
| `index` | `int`: The index of the attribute. The same index for the `https://developer.android.com/reference/org/xml/sax/Attributes` object passed to the startElement callback. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/org/w3c/dom/TypeInfo` | An immutable `https://developer.android.com/reference/org/w3c/dom/TypeInfo` object that represents the type of the specified attribute. Note that the caller can keep references to the obtained `https://developer.android.com/reference/org/w3c/dom/TypeInfo` longer than the callback scope. Otherwise, this method returns null if the validator is unable to determine the type. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If this method is called from other `https://developer.android.com/reference/org/xml/sax/ContentHandler` methods. |
| `https://developer.android.com/reference/java/lang/IndexOutOfBoundsException` | If the index is invalid. |

### getElementTypeInfo

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract TypeInfo getElementTypeInfo ()
```

<br />

Returns the immutable `https://developer.android.com/reference/org/w3c/dom/TypeInfo` object for the current element.

The method may only be called by the startElement and endElement event of the `https://developer.android.com/reference/org/xml/sax/ContentHandler` that the application sets to the `https://developer.android.com/reference/javax/xml/validation/ValidatorHandler`.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/org/w3c/dom/TypeInfo` | An immutable `https://developer.android.com/reference/org/w3c/dom/TypeInfo` object that represents the type of the current element. Note that the caller can keep references to the obtained `https://developer.android.com/reference/org/w3c/dom/TypeInfo` 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.) <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If this method is called from other `https://developer.android.com/reference/org/xml/sax/ContentHandler` methods. |

### isIdAttribute

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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://developer.android.com/reference/javax/xml/parsers/DocumentBuilder` uses this information to properly implement `https://developer.android.com/reference/org/w3c/dom/Attr#isId()`.

The method may only be called by the startElement event of the `https://developer.android.com/reference/org/xml/sax/ContentHandler` that the application sets to the `https://developer.android.com/reference/javax/xml/validation/ValidatorHandler`.

<br />

| Parameters ||
|---|---|
| `index` | `int`: The index of the attribute. The same index for the `https://developer.android.com/reference/org/xml/sax/Attributes` object passed to the startElement callback. <br /> |

| Returns ||
|---|---|
| `boolean` | true if the type of the specified attribute is ID. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If this method is called from other `https://developer.android.com/reference/org/xml/sax/ContentHandler` methods. |
| `https://developer.android.com/reference/java/lang/IndexOutOfBoundsException` | If the index is invalid. |

### isSpecified

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract boolean isSpecified (int index)
```

Returns false if the attribute was added by the validator.

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

The method may only be called by the startElement event of the `https://developer.android.com/reference/org/xml/sax/ContentHandler` that the application sets to the `https://developer.android.com/reference/javax/xml/validation/ValidatorHandler`.

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.

<br />

| Parameters ||
|---|---|
| `index` | `int`: The index of the attribute. The same index for the `https://developer.android.com/reference/org/xml/sax/Attributes` object passed to the startElement callback. <br /> |

| Returns ||
|---|---|
| `boolean` | true if the attribute was present before the validator processes input. false if the attribute was added by the validator. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If this method is called from other `https://developer.android.com/reference/org/xml/sax/ContentHandler` methods. |
| `https://developer.android.com/reference/java/lang/IndexOutOfBoundsException` | If the index is invalid. |