A convenient base class for implementing consumers.

Implementation of every method throws an "Unexpected " exception. The methods can then be overriden in a subclass to support parsing needed JSON values.

Methods

addArrayElement (context:TArrayContext, parser:Parser):Void

Complain about being unimplemented, see BaseConsumer.consumeArray

addObjectField (context:TObjectContext, name:String, parser:Parser):Void

Complain about being unimplemented, see BaseConsumer.consumeObject

consumeArray ():TArrayContext

Complain about unexpected array.

Note that when overriding this method, you MUST also override addArrayElement and finalizeArray methods.

consumeBool (b:Bool):TResult

Complain about unexpected boolean

consumeNull ():TResult

Complain about unexpected null

consumeNumber (n:String):TResult

Complain about unexpected number

consumeObject ():TObjectContext

Complain about unexpected object.

Note that when overriding this method, you MUST also override addObjectField and finalizeObject methods.

consumeString (s:String):TResult

Complain about unexpected string

finalizeArray (context:TArrayContext):TResult

Complain about being unimplemented, see BaseConsumer.consumeArray

finalizeObject (context:TObjectContext):TResult

Complain about being unimplemented, see BaseConsumer.consumeObject