# 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

virtual ~ParseHandler();

Destroys the ParseHandler.

## Member Functions

### asVar

Dynamic::Var asVar() const;

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

### endArray

void endArray();

Handles a ']'; the array is closed.

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

### endObject

void endObject();

Handles a '}'; the object is closed.

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

### key

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

A key is read

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

### null

virtual void null();

A null value is read.

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

### reset

virtual void reset();

Resets the handler state.

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

### startArray

void startArray();

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

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

### startObject

void startObject();

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

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

### value

virtual void value(
int v
);

An integer value is read

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

### value

virtual void value(
unsigned v
);

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

virtual void value(
Int64 v
);

A 64-bit integer value is read

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

### value

virtual void value(
UInt64 v
);

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

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

A string value is read.

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

### value

virtual void value(
double d
);

A double value is read.

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

### value

virtual void value(
bool b
);

A boolean value is read.

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