Class ProtobufSchemaParser<U extends com.google.protobuf.Message>

java.lang.Object
io.apicurio.registry.serde.protobuf.ProtobufSchemaParser<U>
All Implemented Interfaces:
io.apicurio.registry.resolver.SchemaParser<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U>

public class ProtobufSchemaParser<U extends com.google.protobuf.Message> extends Object implements io.apicurio.registry.resolver.SchemaParser<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U>
Author:
Fabian Martinez
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    io.apicurio.registry.resolver.ParsedSchema<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema>
    getSchemaFromData(io.apicurio.registry.resolver.data.Record<U> data)
     
    io.apicurio.registry.resolver.ParsedSchema<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema>
    getSchemaFromData(io.apicurio.registry.resolver.data.Record<U> data, boolean dereference)
     
    io.apicurio.registry.utils.protobuf.schema.ProtobufSchema
    parseSchema(byte[] rawSchema, Map<String,io.apicurio.registry.resolver.ParsedSchema<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema>> resolvedReferences)
     
    com.squareup.wire.schema.internal.parser.ProtoFileElement
    toProtoFileElement(com.google.protobuf.Descriptors.FileDescriptor fileDescriptor)
    This method converts the Descriptor to a ProtoFileElement that allows to get a textual representation .proto file

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface io.apicurio.registry.resolver.SchemaParser

    supportsExtractSchemaFromData
  • Constructor Details

    • ProtobufSchemaParser

      public ProtobufSchemaParser()
  • Method Details

    • artifactType

      public String artifactType()
      Specified by:
      artifactType in interface io.apicurio.registry.resolver.SchemaParser<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U extends com.google.protobuf.Message>
      See Also:
    • parseSchema

      public io.apicurio.registry.utils.protobuf.schema.ProtobufSchema parseSchema(byte[] rawSchema, Map<String,io.apicurio.registry.resolver.ParsedSchema<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema>> resolvedReferences)
      Specified by:
      parseSchema in interface io.apicurio.registry.resolver.SchemaParser<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U extends com.google.protobuf.Message>
      See Also:
    • getSchemaFromData

      public io.apicurio.registry.resolver.ParsedSchema<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema> getSchemaFromData(io.apicurio.registry.resolver.data.Record<U> data)
      Specified by:
      getSchemaFromData in interface io.apicurio.registry.resolver.SchemaParser<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U extends com.google.protobuf.Message>
      See Also:
      • SchemaParser.getSchemaFromData(Record)
    • getSchemaFromData

      public io.apicurio.registry.resolver.ParsedSchema<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema> getSchemaFromData(io.apicurio.registry.resolver.data.Record<U> data, boolean dereference)
      Specified by:
      getSchemaFromData in interface io.apicurio.registry.resolver.SchemaParser<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U extends com.google.protobuf.Message>
    • toProtoFileElement

      public com.squareup.wire.schema.internal.parser.ProtoFileElement toProtoFileElement(com.google.protobuf.Descriptors.FileDescriptor fileDescriptor)
      This method converts the Descriptor to a ProtoFileElement that allows to get a textual representation .proto file
      Parameters:
      fileDescriptor -
      Returns:
      textual protobuf representation