Class ProtobufSchema
java.lang.Object
io.confluent.kafka.schemaregistry.protobuf.ProtobufSchema
- All Implemented Interfaces:
ParsedSchema
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final com.squareup.wire.schema.Locationstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final com.google.protobuf.ExtensionRegistrystatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionProtobufSchema(com.google.protobuf.Descriptors.Descriptor descriptor) ProtobufSchema(com.google.protobuf.Descriptors.Descriptor descriptor, List<SchemaReference> references) ProtobufSchema(com.google.protobuf.Descriptors.EnumDescriptor enumDescriptor) ProtobufSchema(com.google.protobuf.Descriptors.EnumDescriptor enumDescriptor, List<SchemaReference> references) ProtobufSchema(com.google.protobuf.Descriptors.FileDescriptor fileDescriptor) ProtobufSchema(com.google.protobuf.Descriptors.FileDescriptor fileDescriptor, List<SchemaReference> references) ProtobufSchema(com.squareup.wire.schema.internal.parser.ProtoFileElement protoFileElement, List<SchemaReference> references, Map<String, com.squareup.wire.schema.internal.parser.ProtoFileElement> dependencies) ProtobufSchema(String schemaString) ProtobufSchema(String schemaString, List<SchemaReference> references, Map<String, String> resolvedReferences, Metadata metadata, RuleSet ruleSet, Integer version, String name) ProtobufSchema(String schemaString, List<SchemaReference> references, Map<String, String> resolvedReferences, Integer version, String name) -
Method Summary
Modifier and TypeMethodDescriptioncopy()copy(List<SchemaReference> references) copy(List<SchemaReference> references, Map<String, com.squareup.wire.schema.internal.parser.ProtoFileElement> dependencies) copy(Map<SchemaEntity, Set<String>> tagsToAdd, Map<SchemaEntity, Set<String>> tagsToRemove) copyMessage(Object message) copyWithSchema(String schema) booleanstatic Stringstatic ProtobufSchema.ProtobufMetastatic ProtobufSchema.ProtobufMetastatic Optional<com.squareup.wire.schema.internal.parser.OptionElement>findOption(String name, List<com.squareup.wire.schema.internal.parser.OptionElement> options) static Optional<com.squareup.wire.schema.internal.parser.OptionElement>findOption(String name, Map<String, com.squareup.wire.schema.internal.parser.OptionElement> options) findParams(Optional<com.squareup.wire.schema.internal.parser.OptionElement> meta) formattedString(String format) fromJson(com.fasterxml.jackson.databind.JsonNode json) fullName()com.google.protobuf.Descriptors.EnumDescriptorgetEnumDescriptor(String enumTypeName) com.google.protobuf.Descriptors.EnumValueDescriptorgetEnumValue(String enumTypeName, int enumNumber) inthashCode()booleanhasTopLevelField(String field) isBackwardCompatible(ParsedSchema previousSchema) protected static com.squareup.wire.schema.internal.parser.OptionElementmerge(com.squareup.wire.schema.internal.parser.OptionElement existing, com.squareup.wire.schema.internal.parser.OptionElement replacement) metadata()name()com.google.protobuf.DynamicMessage.Buildercom.google.protobuf.DynamicMessage.BuildernewMessageBuilder(String name) com.squareup.wire.schema.internal.parser.ProtoFileElementruleSet()static com.google.protobuf.DescriptorProtos.ExtensionRangeOptions.DeclarationtoDeclaration(com.squareup.wire.schema.internal.parser.OptionElement option) com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptortoDescriptor(String name) static FieldDefinitiontoDynamicField(Context ctx, com.squareup.wire.schema.internal.parser.FieldElement fieldElement, String label, boolean isProto3Optional, Integer oneofIndex, String extendee) static FieldDefinitiontoDynamicField(Context ctx, com.squareup.wire.schema.internal.parser.FieldElement fieldElement, String type, String label, boolean isProto3Optional, Integer oneofIndex, String extendee) toDynamicSchema(String name) static com.google.protobuf.DescriptorProtos.FieldOptions.EditionDefaulttoEditionDefault(com.squareup.wire.schema.internal.parser.OptionElement option) static com.google.protobuf.DescriptorProtos.FeatureSettoFeatures(com.squareup.wire.schema.internal.parser.OptionElement option) static com.google.protobuf.DescriptorProtos.FieldOptions.FeatureSupporttoFeatureSupport(com.squareup.wire.schema.internal.parser.OptionElement option) com.fasterxml.jackson.databind.JsonNodestatic StringtoMapEntry(String s) static StringtoMapField(String s) toMessageIndexes(String name) toMessageIndexes(String name, boolean normalize) toMessageName(MessageIndexes indexes) static ObjecttoPrimitiveValue(Object value) com.google.protobuf.Descriptors.GenericDescriptortoSpecificDescriptor(String originalPath) toString()protected static com.squareup.wire.schema.internal.parser.OptionElementtransform(com.squareup.wire.schema.internal.parser.OptionElement option) transformMessage(RuleContext ctx, FieldTransform transform, Object message) static StringunderscoresToCamelCase(String input, boolean capitalizeNextLetter) voidvalidate(boolean strict) version()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.confluent.kafka.schemaregistry.ParsedSchema
canLookup, deepEquals, equivalent, getReservedFields, isBackwardCompatible, isCompatible, isCompatible, tags, validate
-
Field Details
-
TYPE
- See Also:
-
PROTO2
- See Also:
-
PROTO3
- See Also:
-
DOC_FIELD
- See Also:
-
PARAMS_FIELD
- See Also:
-
TAGS_FIELD
- See Also:
-
PRECISION_KEY
- See Also:
-
SCALE_KEY
- See Also:
-
DEFAULT_NAME
- See Also:
-
MAP_ENTRY_SUFFIX
- See Also:
-
KEY_FIELD
- See Also:
-
VALUE_FIELD
- See Also:
-
CONFLUENT_PREFIX
- See Also:
-
CONFLUENT_FILE_META
- See Also:
-
CONFLUENT_MESSAGE_META
- See Also:
-
CONFLUENT_FIELD_META
- See Also:
-
CONFLUENT_ENUM_META
- See Also:
-
CONFLUENT_ENUM_VALUE_META
- See Also:
-
DEFAULT_LOCATION
public static final com.squareup.wire.schema.Location DEFAULT_LOCATION -
CFLT_META_LOCATION
- See Also:
-
CFLT_DECIMAL_LOCATION
- See Also:
-
CALENDAR_PERIOD_LOCATION
- See Also:
-
COLOR_LOCATION
- See Also:
-
DATE_LOCATION
- See Also:
-
DATETIME_LOCATION
- See Also:
-
DAY_OF_WEEK_LOCATION
- See Also:
-
DECIMAL_LOCATION
- See Also:
-
EXPR_LOCATION
- See Also:
-
FRACTION_LOCATION
- See Also:
-
INTERVAL_LOCATION
- See Also:
-
LATLNG_LOCATION
- See Also:
-
MONEY_LOCATION
- See Also:
-
MONTH_LOCATION
- See Also:
-
PHONE_NUMBER_LOCATION
- See Also:
-
POSTAL_ADDRESS_LOCATION
- See Also:
-
QUATERNION_LOCATION
- See Also:
-
TIME_OF_DAY_LOCATION
- See Also:
-
ANY_LOCATION
- See Also:
-
API_LOCATION
- See Also:
-
DESCRIPTOR_LOCATION
- See Also:
-
DURATION_LOCATION
- See Also:
-
EMPTY_LOCATION
- See Also:
-
FIELD_MASK_LOCATION
- See Also:
-
SOURCE_CONTEXT_LOCATION
- See Also:
-
STRUCT_LOCATION
- See Also:
-
TIMESTAMP_LOCATION
- See Also:
-
TYPE_LOCATION
- See Also:
-
WRAPPER_LOCATION
- See Also:
-
EXTENSION_REGISTRY
public static final com.google.protobuf.ExtensionRegistry EXTENSION_REGISTRY
-
-
Constructor Details
-
ProtobufSchema
-
ProtobufSchema
-
ProtobufSchema
-
ProtobufSchema
public ProtobufSchema(com.squareup.wire.schema.internal.parser.ProtoFileElement protoFileElement, List<SchemaReference> references, Map<String, com.squareup.wire.schema.internal.parser.ProtoFileElement> dependencies) -
ProtobufSchema
public ProtobufSchema(com.google.protobuf.Descriptors.Descriptor descriptor) -
ProtobufSchema
public ProtobufSchema(com.google.protobuf.Descriptors.Descriptor descriptor, List<SchemaReference> references) -
ProtobufSchema
public ProtobufSchema(com.google.protobuf.Descriptors.EnumDescriptor enumDescriptor) -
ProtobufSchema
public ProtobufSchema(com.google.protobuf.Descriptors.EnumDescriptor enumDescriptor, List<SchemaReference> references) -
ProtobufSchema
public ProtobufSchema(com.google.protobuf.Descriptors.FileDescriptor fileDescriptor) -
ProtobufSchema
public ProtobufSchema(com.google.protobuf.Descriptors.FileDescriptor fileDescriptor, List<SchemaReference> references)
-
-
Method Details
-
knownTypes
-
copy
- Specified by:
copyin interfaceParsedSchema
-
copy
- Specified by:
copyin interfaceParsedSchema
-
copy
-
copy
-
copy
public ProtobufSchema copy(List<SchemaReference> references, Map<String, com.squareup.wire.schema.internal.parser.ProtoFileElement> dependencies) -
copy
- Specified by:
copyin interfaceParsedSchema
-
copy
public ParsedSchema copy(Map<SchemaEntity, Set<String>> tagsToAdd, Map<SchemaEntity, Set<String>> tagsToRemove) - Specified by:
copyin interfaceParsedSchema
-
copyWithSchema
-
toDescriptor
public com.google.protobuf.Descriptors.Descriptor toDescriptor() -
toDescriptor
-
newMessageBuilder
public com.google.protobuf.DynamicMessage.Builder newMessageBuilder() -
newMessageBuilder
-
getEnumDescriptor
-
getEnumValue
public com.google.protobuf.Descriptors.EnumValueDescriptor getEnumValue(String enumTypeName, int enumNumber) -
toDynamicSchema
-
toDynamicSchema
-
merge
protected static com.squareup.wire.schema.internal.parser.OptionElement merge(com.squareup.wire.schema.internal.parser.OptionElement existing, com.squareup.wire.schema.internal.parser.OptionElement replacement) -
transform
protected static com.squareup.wire.schema.internal.parser.OptionElement transform(com.squareup.wire.schema.internal.parser.OptionElement option) -
toDeclaration
public static com.google.protobuf.DescriptorProtos.ExtensionRangeOptions.Declaration toDeclaration(com.squareup.wire.schema.internal.parser.OptionElement option) -
toFeatures
public static com.google.protobuf.DescriptorProtos.FeatureSet toFeatures(com.squareup.wire.schema.internal.parser.OptionElement option) -
toFeatureSupport
public static com.google.protobuf.DescriptorProtos.FieldOptions.FeatureSupport toFeatureSupport(com.squareup.wire.schema.internal.parser.OptionElement option) -
toEditionDefault
public static com.google.protobuf.DescriptorProtos.FieldOptions.EditionDefault toEditionDefault(com.squareup.wire.schema.internal.parser.OptionElement option) -
toPrimitiveValue
-
toDynamicField
public static FieldDefinition toDynamicField(Context ctx, com.squareup.wire.schema.internal.parser.FieldElement fieldElement, String label, boolean isProto3Optional, Integer oneofIndex, String extendee) -
toDynamicField
-
findOption
-
findOption
-
findMeta
public static ProtobufSchema.ProtobufMeta findMeta(String name, List<com.squareup.wire.schema.internal.parser.OptionElement> options) -
findMeta
public static ProtobufSchema.ProtobufMeta findMeta(String name, Map<String, com.squareup.wire.schema.internal.parser.OptionElement> options) -
findDoc
-
findParams
-
findTags
-
rawSchema
public com.squareup.wire.schema.internal.parser.ProtoFileElement rawSchema()- Specified by:
rawSchemain interfaceParsedSchema
-
hasTopLevelField
- Specified by:
hasTopLevelFieldin interfaceParsedSchema
-
schemaType
- Specified by:
schemaTypein interfaceParsedSchema
-
name
- Specified by:
namein interfaceParsedSchema
-
canonicalString
- Specified by:
canonicalStringin interfaceParsedSchema
-
formattedString
- Specified by:
formattedStringin interfaceParsedSchema
-
version
- Specified by:
versionin interfaceParsedSchema
-
references
- Specified by:
referencesin interfaceParsedSchema
-
resolvedReferences
-
dependencies
-
dependenciesWithLogicalTypes
-
metadata
- Specified by:
metadatain interfaceParsedSchema
-
ruleSet
- Specified by:
ruleSetin interfaceParsedSchema
-
normalize
- Specified by:
normalizein interfaceParsedSchema
-
validate
public void validate(boolean strict) - Specified by:
validatein interfaceParsedSchema
-
isBackwardCompatible
- Specified by:
isBackwardCompatiblein interfaceParsedSchema
-
equals
-
hashCode
public int hashCode() -
toString
-
toSpecificDescriptor
-
fullName
-
fullName
-
toMessageIndexes
-
toMessageIndexes
-
toMessageName
-
toMapEntry
-
toMapField
-
fromJson
- Specified by:
fromJsonin interfaceParsedSchema- Throws:
IOException
-
toJson
- Specified by:
toJsonin interfaceParsedSchema- Throws:
IOException
-
copyMessage
- Specified by:
copyMessagein interfaceParsedSchema
-
transformMessage
public Object transformMessage(RuleContext ctx, FieldTransform transform, Object message) throws RuleException - Specified by:
transformMessagein interfaceParsedSchema- Throws:
RuleException
-
inlineTags
- Specified by:
inlineTagsin interfaceParsedSchema
-
inlineTaggedEntities
- Specified by:
inlineTaggedEntitiesin interfaceParsedSchema
-
underscoresToCamelCase
-