# Poco::JSON

# class ParseHandler

Library: JSON
Package: JSON
Header: Poco/JSON/ParseHandler.h

## Description

ParseHandler is the default handler for the JSON Parser.

This handler will construct an Object or Array based on the handlers called by the Parser.

## Inheritance

Direct Base Classes: Handler

All Base Classes: Handler

## Member Summary

Member Functions: asVar, endArray, endObject, key, null, reset, startArray, startObject, value

Inherited Functions: asStruct, asVar, endArray, endObject, key, null, reset, startArray, startObject, value

## Constructors

### ParseHandler

ParseHandler(
bool preserveObjectOrder = false
);

Creates the ParseHandler.

If preserveObjectOrder is true, the order of properties inside objects is preserved. Otherwise, items will be sorted by keys.

## Destructor

### ~ParseHandler

~ParseHandler() override;

Destroys the ParseHandler.

## Member Functions

### asVar

Dynamic::Var asVar() const override;

Returns the result of the parser (an object or an array).

### endArray

void endArray() override;

Handles a ']'; the array is closed.

See also: Poco::JSON::Handler::endArray()

### endObject

void endObject() override;

Handles a '}'; the object is closed.

See also: Poco::JSON::Handler::endObject()

### key

void key(
const std::string & k
) override;

A key is read

See also: Poco::JSON::Handler::key()

### null

void null() override;

A null value is read.

See also: Poco::JSON::Handler::null()

### reset

void reset() override;

Resets the handler state.

See also: Poco::JSON::Handler::reset()

### startArray

void startArray() override;

Handles a '['; a new array is started.

See also: Poco::JSON::Handler::startArray()

### startObject

void startObject() override;

Handles a '{'; a new object is started.

See also: Poco::JSON::Handler::startObject()

### value

void value(
int v
) override;

An integer value is read

See also: Poco::JSON::Handler::value()

### value

void value(
unsigned v
) override;

An unsigned value is read. This will only be triggered if the value cannot fit into a signed int.

See also: Poco::JSON::Handler::value()

### value

void value(
Int64 v
) override;

A 64-bit integer value is read

See also: Poco::JSON::Handler::value()

### value

void value(
UInt64 v
) override;

An unsigned 64-bit integer value is read. This will only be triggered if the value cannot fit into a signed 64-bit integer.

See also: Poco::JSON::Handler::value()

### value

void value(
const std::string & s
) override;

A string value is read.

See also: Poco::JSON::Handler::value()

### value

void value(
double d
) override;

A double value is read.

See also: Poco::JSON::Handler::value()

### value

void value(
bool b
) override;

A boolean value is read.

See also: Poco::JSON::Handler::value()