Package org.apache.avro

# Class CanonicalSchemaFormatterFactory

java.lang.Object
org.apache.avro.CanonicalSchemaFormatterFactory

All Implemented Interfaces:
  `SchemaFormatter`, `SchemaFormatterFactory`

public class CanonicalSchemaFormatterFactory extends Object implements SchemaFormatterFactory, SchemaFormatter
Schema formatter factory that supports the "Parsing Canonical Form".

See Also:
  - Specification: Parsing Canonical Form for Schemas

## Constructor Summary

Constructors
Constructor
Description
`CanonicalSchemaFormatterFactory()`

## Method Summary

Modifier and Type
Method
Description
`String`
`format(Schema schema)`
Write the specified schema as a String.
`SchemaFormatter`
`getDefaultFormatter()`
Get the default formatter for this schema format.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.avro.SchemaFormatterFactory

`formatName, getFormatterForVariant`

## Constructor Details

### CanonicalSchemaFormatterFactory

public CanonicalSchemaFormatterFactory()

## 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

### format

public String format(Schema schema)
Description copied from interface: `SchemaFormatter`
Write the specified schema as a String.

Specified by:
  `format` in interface `SchemaFormatter`
Parameters:
  `schema` - the schema to write
Returns:
  the formatted schema