Package org.apache.avro

# Class JsonSchemaFormatterFactory

java.lang.Object
org.apache.avro.JsonSchemaFormatterFactory

All Implemented Interfaces:
  `SchemaFormatterFactory`

public class JsonSchemaFormatterFactory extends Object implements SchemaFormatterFactory

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`VARIANT_NAME_INLINE`
`static final String`
`VARIANT_NAME_PRETTY`

## Constructor Summary

Constructors
Constructor
Description
`JsonSchemaFormatterFactory()`

## Method Summary

Modifier and Type
Method
Description
`SchemaFormatter`
`getDefaultFormatter()`
Get the default formatter for this schema format.
`SchemaFormatter`
`getFormatterForVariant(String variantName)`
Get a formatter for the specified schema format variant, if multiple variants are supported.

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

## Field Details

### VARIANT_NAME_PRETTY

public static final String VARIANT_NAME_PRETTY

See Also:
  - Constant Field Values

### VARIANT_NAME_INLINE

public static final String VARIANT_NAME_INLINE

See Also:
  - Constant Field Values

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