org.apache.avro.io.parsing
Class ResolvingGrammarGenerator
java.lang.Object
org.apache.avro.io.parsing.ValidatingGrammarGenerator
org.apache.avro.io.parsing.ResolvingGrammarGenerator
public class ResolvingGrammarGenerator
- extends ValidatingGrammarGenerator
The class that generates a resolving grammar to resolve between two
schemas.
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResolvingGrammarGenerator
public ResolvingGrammarGenerator()
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 writerreader
- 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 writerreader
- The schema used by the readerseen
- 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 © 2010 The Apache Software Foundation