# MessageFormat.Field

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

# Field

```
open class Field : Format.Field
```

|---|---|---|----------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                       ||||
| ↳ | [java.text.AttributedCharacterIterator.Attribute](https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute) |||
|   | ↳ | [java.text.Format.Field](https://developer.android.com/reference/kotlin/java/text/Format.Field)                   ||
|   |   | ↳ | [java.text.MessageFormat.Field](https://developer.android.com/reference/kotlin/java/text/MessageFormat.Field#) |

Defines constants that are used as attribute keys in the`AttributedCharacterIterator`returned from`MessageFormat.formatToCharacterIterator`.

## Summary

|                                                                                                                Protected constructors                                                                                                                 ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Field](https://developer.android.com/reference/kotlin/java/text/MessageFormat.Field#Field(kotlin.String))`(`name:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Creates a Field with the specified name. |

|                                                                                                                         Protected methods                                                                                                                         ||
|---------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | [readResolve](https://developer.android.com/reference/kotlin/java/text/MessageFormat.Field#readResolve())`()` Resolves instances being deserialized to the predefined constants. |

|                                                                                                                                                                              Properties                                                                                                                                                                              ||
|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[MessageFormat.Field](https://developer.android.com/reference/kotlin/java/text/MessageFormat.Field#)! | [ARGUMENT](https://developer.android.com/reference/kotlin/java/text/MessageFormat.Field#ARGUMENT:java.text.MessageFormat.Field) Constant identifying a portion of a message that was generated from an argument passed into`formatToCharacterIterator`. |

## Protected constructors

### Field

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

```
protected Field(name: String!)
```

Creates a Field with the specified name.

|                                                   Parameters                                                    ||
|--------|---------------------------------------------------------------------------------------------------------|
| `name` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:Name of the attribute |

## Protected methods

### readResolve

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

```
protected open fun readResolve(): Any!
```

Resolves instances being deserialized to the predefined constants.

|                                                       Return                                                       ||
|-----------------------------------------------------------------------------|---------------------------------------|
| [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | resolved MessageFormat.Field constant |

|                                Exceptions                                ||
|----------------------------------|----------------------------------------|
| `java.io.InvalidObjectException` | if the constant could not be resolved. |

## Properties

### ARGUMENT

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

```
static val ARGUMENT: MessageFormat.Field!
```

Constant identifying a portion of a message that was generated from an argument passed into`formatToCharacterIterator`. The value associated with the key will be an`Integer`indicating the index in the`arguments`array of the argument from which the text was generated.