org.apache.avro.io.parsing
Class ResolvingGrammarGenerator

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

public class ResolvingGrammarGenerator
extends ValidatingGrammarGenerator

The class that generates a resolving grammar to resolve between two schemas.


Constructor Summary
ResolvingGrammarGenerator()
           
 
Method Summary
 Symbol generate(Schema writer, Schema reader)
          Resolves the writer schema writer and the reader schema reader and returns the start symbol for the grammar generated.
 Symbol generate(Schema writer, Schema reader, Map<org.apache.avro.io.parsing.ValidatingGrammarGenerator.LitS,Symbol> seen)
          Resolves the writer schema writer and the reader schema reader and returns the start symbol for the grammar generated.
 
Methods inherited from class org.apache.avro.io.parsing.ValidatingGrammarGenerator
generate, generate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResolvingGrammarGenerator

public ResolvingGrammarGenerator()
Method Detail

generate

public final Symbol generate(Schema writer,
                             Schema reader)
                      throws IOException
Resolves the writer schema writer and the reader schema reader and returns the start symbol for the grammar generated.

Parameters:
writer - The schema used by the writer
reader - The schema used by the reader
Returns:
The start symbol for the resolving grammar
Throws:
IOException

generate

public Symbol generate(Schema writer,
                       Schema reader,
                       Map<org.apache.avro.io.parsing.ValidatingGrammarGenerator.LitS,Symbol> seen)
                throws IOException
Resolves the writer schema writer and the reader schema reader and returns the start symbol for the grammar generated. If there is already a symbol in the map seen for resolving the two schemas, then that symbol is returned. Otherwise a new symbol is generated and returnd.

Parameters:
writer - The schema used by the writer
reader - The schema used by the reader
seen - The <reader-schema, writer-schema> to symbol map of start symbols of resolving grammars so far.
Returns:
The start symbol for the resolving grammar
Throws:
IOException


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.