# JSONTokenNotify
<span class="source-link">[[Source]](src/json/json_token_notify.md#L-0-1)</span>

Callback interface for `JSONTokenParser`.

Implement this to process JSON tokens as they are parsed, without
materializing the full document tree. Read a token's value off the token
itself (`JSONTokenKey.value`, `JSONTokenString.value`,
`JSONTokenNumber.value`);
the structural and literal tokens are primitives that carry no data.

Token emission contract: objects emit ObjectStart, then alternating
Key/value sequences, then ObjectEnd. Arrays emit ArrayStart, then
values, then ArrayEnd. `JSONReassembler` relies on this order; changing it
would break any such consumer.


```pony
interface ref JSONTokenNotify
```

## Public Functions

### apply
<span class="source-link">[[Source]](src/json/json_token_notify.md#L-0-17)</span>


Called for each token parsed from the JSON document. `token` carries its own
value. Use `parser` to read the token's byte position (`token_start()`,
`token_end()`, `line()`) and to call `abort()` if parsing should stop early;
those positions are valid only during this call.


```pony
fun ref apply(
  parser: JSONTokenParser ref,
  token: JSONToken)
: None val
```
#### Parameters

*   parser: [JSONTokenParser](json-JSONTokenParser.md) ref
*   token: [JSONToken](json-JSONToken.md)

#### Returns

* [None](builtin-None.md) val

---

