Class JsonSchemaFormatterFactory

java.lang.Object
org.apache.avro.JsonSchemaFormatterFactory
All Implemented Interfaces:
SchemaFormatterFactory

public class JsonSchemaFormatterFactory extends Object implements SchemaFormatterFactory
  • Field Details

  • Constructor Details

    • JsonSchemaFormatterFactory

      public JsonSchemaFormatterFactory()
  • Method Details

    • getDefaultFormatter

      public SchemaFormatter getDefaultFormatter()
      Description copied from interface: SchemaFormatterFactory
      Get the default formatter for this schema format. Instances should be thread-safe, as they may be cached.

      Implementations should either return the only formatter for this format, or call SchemaFormatterFactory.getFormatterForVariant(String) with the default variant and implement that method as well.

      Specified by:
      getDefaultFormatter in interface SchemaFormatterFactory
      Returns:
      the default formatter for this schema format
    • getFormatterForVariant

      public SchemaFormatter getFormatterForVariant(String variantName)
      Description copied from interface: SchemaFormatterFactory
      Get a formatter for the specified schema format variant, if multiple variants are supported. Instances should be thread-safe, as they may be cached.
      Specified by:
      getFormatterForVariant in interface SchemaFormatterFactory
      Parameters:
      variantName - the name of the format variant (lower case), if specified
      Returns:
      if the factory supports the format, a schema writer; null otherwise