Top Description Constructors Methods
org.apache.avro.io.parsing

public Class JsonGrammarGenerator

extends ValidatingGrammarGenerator
Class Inheritance
Imports
java.util.HashMap, .Map, org.apache.avro.Schema, .Schema.Field

The class that generates a grammar suitable to parse Avro data in JSON format.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Symbol
generate(Schema schema)

Overrides org.apache.avro.io.parsing.ValidatingGrammarGenerator.generate.

Returns the non-terminal that is the start symbol for the grammar for the grammar for the given schema sc.
public Symbol

Returns:

The start symbol for the schema
generate
(Schema
The schema for which the start symbol is required
sc
,
Map<ValidatingGrammarGenerator.LitS, Symbol>
A map of schema to symbol mapping done so far.
seen
)

Overrides org.apache.avro.io.parsing.ValidatingGrammarGenerator.generate.

Returns the non-terminal that is the start symbol for grammar of the given schema sc.

Constructor Detail

JsonGrammarGeneratorback to summary
public JsonGrammarGenerator()

Method Detail

generateback to summary
public Symbol generate(Schema schema)

Overrides org.apache.avro.io.parsing.ValidatingGrammarGenerator.generate.

Returns the non-terminal that is the start symbol for the grammar for the grammar for the given schema sc.

Annotations
@Override
generateback to summary
public Symbol generate(Schema sc, Map<ValidatingGrammarGenerator.LitS, Symbol> seen)

Overrides org.apache.avro.io.parsing.ValidatingGrammarGenerator.generate.

Returns the non-terminal that is the start symbol for grammar of the given schema sc. If there is already an entry for the given schema in the given map seen then that entry is returned. Otherwise a new symbol is generated and an entry is inserted into the map.

Parameters
sc:Schema

The schema for which the start symbol is required

seen:Map<ValidatingGrammarGenerator.LitS, Symbol>

A map of schema to symbol mapping done so far.

Returns:Symbol

The start symbol for the schema

Annotations
@Override