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.
  • Constructor Details

    • ResolvingGrammarGenerator

      public ResolvingGrammarGenerator()
  • Method Details

    • 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
    • encode

      public static void encode(Encoder e, Schema s, com.fasterxml.jackson.databind.JsonNode n) throws IOException
      Encodes the given Json node n on to the encoder e according to the schema s.
      Parameters:
      e - The encoder to encode into.
      s - The schema for the object being encoded.
      n - The Json node to encode.
      Throws:
      IOException