# A2uiJsonReader

Artifact: [androidx.a2ui:a2ui-model](https://developer.android.com/jetpack/androidx/releases/a2ui) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/model/processor/A2uiJsonReader.kt+class:androidx.a2ui.model.processor.A2uiJsonReader) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

*** ** * ** ***


```
interface A2uiJsonReader : AutoCloseable
```

<br />

*** ** * ** ***

Reads a stream of JSON tokens.

Use this interface to pull JSON tokens sequentially without loading the entire document.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#beginArray()()` Consumes the opening delimiter of a JSON array. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#beginObject()()` Consumes the opening delimiter of a JSON object. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#endArray()()` Consumes the closing delimiter of a JSON array. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#endObject()()` Consumes the closing delimiter of a JSON object. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#hasNext()()` Returns true if the current object or array has more elements. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#nextBoolean()()` Consumes and returns the next boolean value. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#nextDouble()()` Consumes and returns the next double value. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#nextInt()()` Consumes and returns the next int value. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#nextLong()()` Consumes and returns the next long value. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#nextName()()` Consumes and returns the next property name. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#nextNull()()` Consumes the next null token. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#nextString()()` Consumes and returns the next string value. |
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonToken` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#peek()()` Returns the type of the next token without consuming it. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiJsonReader#skipValue()()` Skips the next value and all its children. |

### Inherited functions

From [java.lang.AutoCloseable](https://developer.android.com/reference/java/lang/AutoCloseable.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/java/lang/AutoCloseable.html#close()()`

## Public functions

### beginArray

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun beginArray(): Unit
```

Consumes the opening delimiter of a JSON array.

### beginObject

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun beginObject(): Unit
```

Consumes the opening delimiter of a JSON object.

### endArray

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun endArray(): Unit
```

Consumes the closing delimiter of a JSON array.

### endObject

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun endObject(): Unit
```

Consumes the closing delimiter of a JSON object.

### hasNext

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun hasNext(): Boolean
```

Returns true if the current object or array has more elements.

### nextBoolean

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun nextBoolean(): Boolean
```

Consumes and returns the next boolean value.

### nextDouble

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun nextDouble(): Double
```

Consumes and returns the next double value.

### nextInt

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun nextInt(): Int
```

Consumes and returns the next int value.

### nextLong

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun nextLong(): Long
```

Consumes and returns the next long value.

### nextName

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun nextName(): String
```

Consumes and returns the next property name.

### nextNull

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun nextNull(): Unit
```

Consumes the next null token.

### nextString

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun nextString(): String
```

Consumes and returns the next string value.

### peek

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun peek(): A2uiJsonToken
```

Returns the type of the next token without consuming it.

### skipValue

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
fun skipValue(): Unit
```

Skips the next value and all its children.