Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#pubctors) \| [Methods](https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#inhmethods)

# Attributes2Impl


`
public


class
Attributes2Impl
`


`


`

`

extends https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl


`

`


implements

https://developer.android.com/reference/org/xml/sax/ext/Attributes2


`

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [org.xml.sax.helpers.AttributesImpl](https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl) ||
|   | ↳ | org.xml.sax.ext.Attributes2Impl |

<br />

*** ** * ** ***

SAX2 extension helper for additional Attributes information,
implementing the `https://developer.android.com/reference/org/xml/sax/ext/Attributes2` interface.

> *This module, both source code and documentation, is in the
> Public Domain, and comes with **NO WARRANTY**.*

This is not part of core-only SAX2 distributions.

The *specified* flag for each attribute will always
be true, unless it has been set to false in the copy constructor
or using `https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#setSpecified(int,%20boolean)`.
Similarly, the *declared* flag for each attribute will
always be false, except for defaulted attributes (*specified*
is false), non-CDATA attributes, or when it is set to true using
`https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#setDeclared(int,%20boolean)`.
If you change an attribute's type by hand, you may need to modify
its *declared* flag to match.

<br />

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#Attributes2Impl()() ` Construct a new, empty Attributes2Impl object. |
| ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#Attributes2Impl(org.xml.sax.Attributes)(https://developer.android.com/reference/org/xml/sax/Attributes atts) ` Copy an existing Attributes or Attributes2 object. |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#addAttribute(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName, https://developer.android.com/reference/java/lang/String qName, https://developer.android.com/reference/java/lang/String type, https://developer.android.com/reference/java/lang/String value) ` Add an attribute to the end of the list, setting its "specified" flag to true. |
| ` boolean` | ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#isDeclared(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName) ` Returns false unless the attribute was declared in the DTD. |
| ` boolean` | ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#isDeclared(int)(int index) ` Returns false unless the attribute was declared in the DTD. |
| ` boolean` | ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#isDeclared(java.lang.String)(https://developer.android.com/reference/java/lang/String qName) ` Returns false unless the attribute was declared in the DTD. |
| ` boolean` | ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#isSpecified(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName) ` Returns the current value of an attribute's "specified" flag. |
| ` boolean` | ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#isSpecified(int)(int index) ` Returns the current value of an attribute's "specified" flag. |
| ` boolean` | ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#isSpecified(java.lang.String)(https://developer.android.com/reference/java/lang/String qName) ` Returns the current value of an attribute's "specified" flag. |
| ` void` | ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#removeAttribute(int)(int index) ` Remove an attribute from the list. |
| ` void` | ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#setAttributes(org.xml.sax.Attributes)(https://developer.android.com/reference/org/xml/sax/Attributes atts) ` Copy an entire Attributes object. |
| ` void` | ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#setDeclared(int,%20boolean)(int index, boolean value) ` Assign a value to the "declared" flag of a specific attribute. |
| ` void` | ` https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#setSpecified(int,%20boolean)(int index, boolean value) ` Assign a value to the "specified" flag of a specific attribute. |

### Inherited methods

From class `

https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl

` `


void` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#addAttribute(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName, https://developer.android.com/reference/java/lang/String qName, https://developer.android.com/reference/java/lang/String type, https://developer.android.com/reference/java/lang/String value)
`

Add an attribute to the end of the list.


`


void` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#clear()()
`

Clear the attribute list for reuse.


`


int` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#getIndex(java.lang.String)(https://developer.android.com/reference/java/lang/String qName)
`

Look up an attribute's index by qualified (prefixed) name.


`


int` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#getIndex(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName)
`

Look up an attribute's index by Namespace name.


`


int` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#getLength()()
`

Return the number of attributes in the list.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#getLocalName(int)(int index)
`

Return an attribute's local name.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#getQName(int)(int index)
`

Return an attribute's qualified (prefixed) name.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#getType(java.lang.String)(https://developer.android.com/reference/java/lang/String qName)
`

Look up an attribute's type by qualified (prefixed) name.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#getType(int)(int index)
`

Return an attribute's type by index.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#getType(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName)
`

Look up an attribute's type by Namespace-qualified name.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#getURI(int)(int index)
`

Return an attribute's Namespace URI.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#getValue(java.lang.String)(https://developer.android.com/reference/java/lang/String qName)
`

Look up an attribute's value by qualified (prefixed) name.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#getValue(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName)
`

Look up an attribute's value by Namespace-qualified name.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#getValue(int)(int index)
`

Return an attribute's value by index.


`


void` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#removeAttribute(int)(int index)
`

Remove an attribute from the list.


`


void` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#setAttribute(int,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)(int index, https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName, https://developer.android.com/reference/java/lang/String qName, https://developer.android.com/reference/java/lang/String type, https://developer.android.com/reference/java/lang/String value)
`

Set an attribute in the list.


`


void` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#setAttributes(org.xml.sax.Attributes)(https://developer.android.com/reference/org/xml/sax/Attributes atts)
`

Copy an entire Attributes object.


`


void` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#setLocalName(int,%20java.lang.String)(int index, https://developer.android.com/reference/java/lang/String localName)
`

Set the local name of a specific attribute.


`


void` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#setQName(int,%20java.lang.String)(int index, https://developer.android.com/reference/java/lang/String qName)
`

Set the qualified name of a specific attribute.


`


void` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#setType(int,%20java.lang.String)(int index, https://developer.android.com/reference/java/lang/String type)
`

Set the type of a specific attribute.


`


void` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#setURI(int,%20java.lang.String)(int index, https://developer.android.com/reference/java/lang/String uri)
`

Set the Namespace URI of a specific attribute.


`


void` `
https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#setValue(int,%20java.lang.String)(int index, https://developer.android.com/reference/java/lang/String value)
`

Set the value of a specific attribute.


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


From interface `

https://developer.android.com/reference/org/xml/sax/Attributes

` `
abstract


int` `
https://developer.android.com/reference/org/xml/sax/Attributes#getIndex(java.lang.String)(https://developer.android.com/reference/java/lang/String qName)
`

Look up the index of an attribute by XML qualified (prefixed) name.


`
abstract


int` `
https://developer.android.com/reference/org/xml/sax/Attributes#getIndex(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName)
`

Look up the index of an attribute by Namespace name.


`
abstract


int` `
https://developer.android.com/reference/org/xml/sax/Attributes#getLength()()
`

Return the number of attributes in the list.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/Attributes#getLocalName(int)(int index)
`

Look up an attribute's local name by index.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/Attributes#getQName(int)(int index)
`

Look up an attribute's XML qualified (prefixed) name by index.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/Attributes#getType(java.lang.String)(https://developer.android.com/reference/java/lang/String qName)
`

Look up an attribute's type by XML qualified (prefixed) name.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/Attributes#getType(int)(int index)
`

Look up an attribute's type by index.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/Attributes#getType(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName)
`

Look up an attribute's type by Namespace name.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/Attributes#getURI(int)(int index)
`

Look up an attribute's Namespace URI by index.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/Attributes#getValue(java.lang.String)(https://developer.android.com/reference/java/lang/String qName)
`

Look up an attribute's value by XML qualified (prefixed) name.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/Attributes#getValue(int)(int index)
`

Look up an attribute's value by index.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/org/xml/sax/Attributes#getValue(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName)
`

Look up an attribute's value by Namespace name.


From interface `

https://developer.android.com/reference/org/xml/sax/ext/Attributes2

` `
abstract


boolean` `
https://developer.android.com/reference/org/xml/sax/ext/Attributes2#isDeclared(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName)
`

Returns false unless the attribute was declared in the DTD.


`
abstract


boolean` `
https://developer.android.com/reference/org/xml/sax/ext/Attributes2#isDeclared(int)(int index)
`

Returns false unless the attribute was declared in the DTD.


`
abstract


boolean` `
https://developer.android.com/reference/org/xml/sax/ext/Attributes2#isDeclared(java.lang.String)(https://developer.android.com/reference/java/lang/String qName)
`

Returns false unless the attribute was declared in the DTD.


`
abstract


boolean` `
https://developer.android.com/reference/org/xml/sax/ext/Attributes2#isSpecified(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String uri, https://developer.android.com/reference/java/lang/String localName)
`

Returns true unless the attribute value was provided
by DTD defaulting.


`
abstract


boolean` `
https://developer.android.com/reference/org/xml/sax/ext/Attributes2#isSpecified(int)(int index)
`

Returns true unless the attribute value was provided
by DTD defaulting.


`
abstract


boolean` `
https://developer.android.com/reference/org/xml/sax/ext/Attributes2#isSpecified(java.lang.String)(https://developer.android.com/reference/java/lang/String qName)
`

Returns true unless the attribute value was provided
by DTD defaulting.


## Public constructors

### Attributes2Impl

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

```
public Attributes2Impl ()
```

Construct a new, empty Attributes2Impl object.

<br />

### Attributes2Impl

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

```
public Attributes2Impl (Attributes atts)
```

Copy an existing Attributes or Attributes2 object.
If the object implements Attributes2, values of the
*specified* and *declared* flags for each
attribute are copied.
Otherwise the flag values are defaulted to assume no DTD was used,
unless there is evidence to the contrary (such as attributes with
type other than CDATA, which must have been *declared*).

This constructor is especially useful inside a
`https://developer.android.com/reference/org/xml/sax/ContentHandler#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes)` event.

<br />

<br />

| Parameters ||
|---|---|
| `atts` | `Attributes`: The existing Attributes object. <br /> |

## Public methods

### addAttribute

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

```
public void addAttribute (String uri, 
                String localName, 
                String qName, 
                String type, 
                String value)
```

Add an attribute to the end of the list, setting its
"specified" flag to true. To set that flag's value
to false, use `https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#setSpecified(int,%20boolean)`.

Unless the attribute *type* is CDATA, this attribute
is marked as being declared in the DTD. To set that flag's value
to true for CDATA attributes, use `https://developer.android.com/reference/org/xml/sax/ext/Attributes2Impl#setDeclared(int,%20boolean)`.

<br />

| Parameters ||
|---|---|
| `uri` | `String`: The Namespace URI, or the empty string if none is available or Namespace processing is not being performed. <br /> |
| `localName` | `String`: The local name, or the empty string if Namespace processing is not being performed. <br /> |
| `qName` | `String`: The qualified (prefixed) name, or the empty string if qualified names are not available. <br /> |
| `type` | `String`: The attribute type as a string. <br /> |
| `value` | `String`: The attribute value. <br /> |

**See also:**

- `https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#addAttribute(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)`

### isDeclared

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

```
public boolean isDeclared (String uri, 
                String localName)
```

Returns false unless the attribute was declared in the DTD.
This helps distinguish two kinds of attributes that SAX reports
as CDATA: ones that were declared (and hence are usually valid),
and those that were not (and which are never valid).

Remember that since DTDs do not "understand" namespaces, the
namespace URI associated with an attribute may not have come from
the DTD. The declaration will have applied to the attribute's
*qName*.

<br />

| Parameters ||
|---|---|
| `uri` | `String`: The Namespace URI, or the empty string if the name has no Namespace URI. <br /> |
| `localName` | `String`: The attribute's local name. <br /> |

| Returns ||
|---|---|
| `boolean` | true if the attribute was declared in the DTD, false otherwise. <br /> |

### isDeclared

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

```
public boolean isDeclared (int index)
```

Returns false unless the attribute was declared in the DTD.
This helps distinguish two kinds of attributes that SAX reports
as CDATA: ones that were declared (and hence are usually valid),
and those that were not (and which are never valid).

<br />

| Parameters ||
|---|---|
| `index` | `int`: The attribute index (zero-based). <br /> |

| Returns ||
|---|---|
| `boolean` | true if the attribute was declared in the DTD, false otherwise. <br /> |

### isDeclared

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

```
public boolean isDeclared (String qName)
```

Returns false unless the attribute was declared in the DTD.
This helps distinguish two kinds of attributes that SAX reports
as CDATA: ones that were declared (and hence are usually valid),
and those that were not (and which are never valid).

<br />

| Parameters ||
|---|---|
| `qName` | `String`: The XML qualified (prefixed) name. <br /> |

| Returns ||
|---|---|
| `boolean` | true if the attribute was declared in the DTD, false otherwise. <br /> |

### isSpecified

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

```
public boolean isSpecified (String uri, 
                String localName)
```

Returns the current value of an attribute's "specified" flag.

<br />

| Parameters ||
|---|---|
| `uri` | `String`: The Namespace URI, or the empty string if the name has no Namespace URI. <br /> |
| `localName` | `String`: The attribute's local name. <br /> |

| Returns ||
|---|---|
| `boolean` | current flag value <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | When the supplied names do not identify an attribute. |

### isSpecified

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

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

Returns the current value of an attribute's "specified" flag.

<br />

| Parameters ||
|---|---|
| `index` | `int`: The attribute index (zero-based). <br /> |

| Returns ||
|---|---|
| `boolean` | current flag value <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/ArrayIndexOutOfBoundsException` | When the supplied index does not identify an attribute. |

### isSpecified

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

```
public boolean isSpecified (String qName)
```

Returns the current value of an attribute's "specified" flag.

<br />

| Parameters ||
|---|---|
| `qName` | `String`: The XML qualified (prefixed) name. <br /> |

| Returns ||
|---|---|
| `boolean` | current flag value <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | When the supplied name does not identify an attribute. |

### removeAttribute

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

```
public void removeAttribute (int index)
```

Remove an attribute from the list.

<br />

| Parameters ||
|---|---|
| `index` | `int`: The index of the attribute (zero-based). <br /> |

### setAttributes

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

```
public void setAttributes (Attributes atts)
```

Copy an entire Attributes object. The "specified" flags are
assigned as true, and "declared" flags as false (except when
an attribute's type is not CDATA),
unless the object is an Attributes2 object.
In that case those flag values are all copied.

<br />

| Parameters ||
|---|---|
| `atts` | `Attributes`: The attributes to copy. <br /> |

**See also:**

- `https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#setAttributes(org.xml.sax.Attributes)`

### setDeclared

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

```
public void setDeclared (int index, 
                boolean value)
```

Assign a value to the "declared" flag of a specific attribute.
This is normally needed only for attributes of type CDATA,
including attributes whose type is changed to or from CDATA.

<br />

| Parameters ||
|---|---|
| `index` | `int`: The index of the attribute (zero-based). <br /> |
| `value` | `boolean`: The desired flag value. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/ArrayIndexOutOfBoundsException` | When the supplied index does not identify an attribute. |

**See also:**

- `https://developer.android.com/reference/org/xml/sax/helpers/AttributesImpl#setType(int,%20java.lang.String)`

### setSpecified

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

```
public void setSpecified (int index, 
                boolean value)
```

Assign a value to the "specified" flag of a specific attribute.
This is the only way this flag can be cleared, except clearing
by initialization with the copy constructor.

<br />

| Parameters ||
|---|---|
| `index` | `int`: The index of the attribute (zero-based). <br /> |
| `value` | `boolean`: The desired flag value. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/ArrayIndexOutOfBoundsException` | When the supplied index does not identify an attribute. |