Package io.apicurio.registry.resolver
Interface SchemaParser<S,U>
-
public interface SchemaParser<S,U>- Author:
- Fabian Martinez
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringartifactType()ParsedSchema<S>getSchemaFromData(Record<U> data)In some artifact types, such as AVRO, it is possible to extract the schema from the java object.ParsedSchema<S>getSchemaFromData(Record<U> data, boolean dereference)In some artifact types, such as AVRO, it is possible to extract the schema from the java object.SparseSchema(byte[] rawSchema, Map<String,ParsedSchema<S>> resolvedReferences)default booleansupportsExtractSchemaFromData()Flag that indicates ifgetSchemaFromData(Record)is implemented or not.
-
-
-
Method Detail
-
artifactType
String artifactType()
-
parseSchema
S parseSchema(byte[] rawSchema, Map<String,ParsedSchema<S>> resolvedReferences)
-
getSchemaFromData
ParsedSchema<S> getSchemaFromData(Record<U> data)
In some artifact types, such as AVRO, it is possible to extract the schema from the java object. But this can be easily extended to other formats by using a customRecordimplementation that adds additional fields that allows to build aParsedSchema- Parameters:
data-- Returns:
- the ParsedSchema, containing both the raw schema (bytes) and the parsed schema. Can be null.
-
getSchemaFromData
ParsedSchema<S> getSchemaFromData(Record<U> data, boolean dereference)
In some artifact types, such as AVRO, it is possible to extract the schema from the java object. But this can be easily extended to other formats by using a customRecordimplementation that adds additional fields that allows to build aParsedSchema- Parameters:
data-dereference- indicate the schema parser whether to try to dereference the record schema.- Returns:
- the ParsedSchema, containing both the raw schema (bytes) and the parsed schema. Can be null.
-
supportsExtractSchemaFromData
default boolean supportsExtractSchemaFromData()
Flag that indicates ifgetSchemaFromData(Record)is implemented or not.
-
-