java.lang.Object
org.apache.drill.exec.store.easy.json.parser.AbstractElementParser
org.apache.drill.exec.store.easy.json.parser.ValueParser
All Implemented Interfaces:
ElementParser
Direct Known Subclasses:
BaseExtendedValueParser, JsonValueParser, ScalarValueParser

public abstract class ValueParser extends AbstractElementParser
Parses a JSON value. JSON allows any value type to appear anywhere a value is allowed; this parser reflects that rule. The associated listener is responsible for semantics: whether a given value should be allowed.

Scalar value processing occurs in one of two ways:

  • Typed: The type of the JSON value determines which of the listener "on" method is called. This ensures that the JSON text is parsed into typed values using JSON's parsing rules.
  • Text: The text value is passed to the listener's onString() method regardless of the JSON type. (That is, according to Drill's "all-text mode."
Listeners can enforce one type only, or can be more flexible and allow multiple types.