Package org.apache.avro
Class JsonSchemaFormatterFactory
java.lang.Object
org.apache.avro.JsonSchemaFormatterFactory
- All Implemented Interfaces:
SchemaFormatterFactory
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the default formatter for this schema format.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
- See Also:
-
VARIANT_NAME_INLINE
- See Also:
-
-
Constructor Details
-
JsonSchemaFormatterFactory
public JsonSchemaFormatterFactory()
-
-
Method Details
-
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 interfaceSchemaFormatterFactory
- Returns:
- the default formatter for this schema format
-
getFormatterForVariant
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 interfaceSchemaFormatterFactory
- Parameters:
variantName
- the name of the format variant (lower case), if specified- Returns:
- if the factory supports the format, a schema writer;
null
otherwise
-