org.apache.avro.io.parsing
Class JsonGrammarGenerator

java.lang.Object
  extended by org.apache.avro.io.parsing.ValidatingGrammarGenerator
      extended by org.apache.avro.io.parsing.JsonGrammarGenerator

public class JsonGrammarGenerator
extends ValidatingGrammarGenerator

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


Constructor Summary
JsonGrammarGenerator()
           
 
Method Summary
 Symbol generate(Schema schema)
          Returns the non-terminal that is the start symbol for the grammar for the grammar for the given schema sc.
 Symbol generate(Schema sc, Map<org.apache.avro.io.parsing.ValidatingGrammarGenerator.LitS,Symbol> seen)
          Returns the non-terminal that is the start symbol for grammar of the given schema sc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonGrammarGenerator

public JsonGrammarGenerator()
Method Detail

generate

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

Overrides:
generate in class ValidatingGrammarGenerator

generate

public Symbol generate(Schema sc,
                       Map<org.apache.avro.io.parsing.ValidatingGrammarGenerator.LitS,Symbol> seen)
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.

Overrides:
generate in class ValidatingGrammarGenerator
Parameters:
sc - The schema for which the start symbol is required
seen - A map of schema to symbol mapping done so far.
Returns:
The start symbol for the schema


Copyright © 2010 The Apache Software Foundation