Package com.solace.serdes.avro
Class DereferencedAvroSchemaParser<U>
- java.lang.Object
-
- com.solace.serdes.avro.AvroSchemaParser<U>
-
- com.solace.serdes.avro.DereferencedAvroSchemaParser<U>
-
- Type Parameters:
U
- The type of the data container
- All Implemented Interfaces:
SchemaParser<org.apache.avro.Schema,U>
public class DereferencedAvroSchemaParser<U> extends AvroSchemaParser<U>
An implementation of AvroSchemaParser that extracts schemas directly from Avro records. This parser retrieves the schema embedded within the Avro record itself, allowing for schema resolution without external schema references.
-
-
Constructor Summary
Constructors Constructor Description DereferencedAvroSchemaParser()
Constructs a new DereferencedAvroSchemaParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParsedSchema<org.apache.avro.Schema>
getSchemaFromData(Record<U> data)
Extracts the schema from a given data record.-
Methods inherited from class com.solace.serdes.avro.AvroSchemaParser
artifactType, parse
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.solace.serdes.common.resolver.SchemaParser
getSchemaFromLocation, supportsGetSchemaFromData, supportsGetSchemaFromLocation
-
-
-
-
Method Detail
-
getSchemaFromData
public ParsedSchema<org.apache.avro.Schema> getSchemaFromData(Record<U> data)
Description copied from interface:SchemaParser
Extracts the schema from a given data record. This method is particularly useful for artifact types like AVRO, where the schema can be extracted directly from the Java object.- Specified by:
getSchemaFromData
in interfaceSchemaParser<org.apache.avro.Schema,U>
- Overrides:
getSchemaFromData
in classAvroSchemaParser<U>
- Parameters:
data
- The record from which to extract the schema.- Returns:
- A
ParsedSchema
containing both the raw schema (as bytes) and the parsed schema.
-
-