Package com.google.protobuf
Class ExtensionSchema<T extends FieldSet.FieldDescriptorLite<T>>
java.lang.Object
com.google.protobuf.ExtensionSchema<T>
- Direct Known Subclasses:
ExtensionSchemaFull,ExtensionSchemaLite
@CheckReturnValue
abstract class ExtensionSchema<T extends FieldSet.FieldDescriptorLite<T>>
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract intextensionNumber(Map.Entry<?, ?> extension) Gets the field number of an extension entry.(package private) abstract ObjectfindExtensionByNumber(ExtensionRegistryLite extensionRegistry, MessageLite defaultInstance, int number) Finds an extension by field number.getExtensions(Object message) Returns the extensionFieldSetfor the message instance.getMutableExtensions(Object message) Returns the extensionFieldSetand ensures it's mutable.(package private) abstract booleanhasExtensions(MessageLite prototype) Returns true for messages that support extensions.(package private) abstract voidmakeImmutable(Object message) Marks the extensionFieldSetas immutable.(package private) abstract <UT,UB> UB parseExtension(Object containerMessage, Reader reader, Object extension, ExtensionRegistryLite extensionRegistry, FieldSet<T> extensions, UB unknownFields, UnknownFieldSchema<UT, UB> unknownFieldSchema) Parses an extension.(package private) abstract voidparseLengthPrefixedMessageSetItem(Reader reader, Object extension, ExtensionRegistryLite extensionRegistry, FieldSet<T> extensions) Parses a length-prefixed MessageSet item from the reader.(package private) abstract voidparseMessageSetItem(ByteString data, Object extension, ExtensionRegistryLite extensionRegistry, FieldSet<T> extensions) Parses the entire content of aByteStringas one MessageSet item.(package private) abstract voidserializeExtension(Writer writer, Map.Entry<?, ?> extension) Serializes one extension entry.(package private) abstract voidsetExtensions(Object message, FieldSet<T> extensions) Replaces the extensionFieldSetfor the message instance.
-
Constructor Details
-
ExtensionSchema
ExtensionSchema()
-
-
Method Details
-
hasExtensions
Returns true for messages that support extensions. -
getExtensions
Returns the extensionFieldSetfor the message instance. -
setExtensions
Replaces the extensionFieldSetfor the message instance. -
getMutableExtensions
Returns the extensionFieldSetand ensures it's mutable. -
makeImmutable
Marks the extensionFieldSetas immutable. -
parseExtension
abstract <UT,UB> UB parseExtension(Object containerMessage, Reader reader, Object extension, ExtensionRegistryLite extensionRegistry, FieldSet<T> extensions, UB unknownFields, UnknownFieldSchema<UT, UB> unknownFieldSchema) throws IOExceptionParses an extension. Returns the passed-in unknownFields parameter if no unknown enum value is found or a modified unknownFields (a new instance if the passed-in unknownFields is null) containing unknown enum values found while parsing.- Type Parameters:
UT- The type used to store unknown fields. It's either UnknownFieldSet in full runtime or UnknownFieldSetLite in lite runtime.- Throws:
IOException
-
extensionNumber
Gets the field number of an extension entry. -
serializeExtension
Serializes one extension entry.- Throws:
IOException
-
findExtensionByNumber
abstract Object findExtensionByNumber(ExtensionRegistryLite extensionRegistry, MessageLite defaultInstance, int number) Finds an extension by field number. -
parseLengthPrefixedMessageSetItem
abstract void parseLengthPrefixedMessageSetItem(Reader reader, Object extension, ExtensionRegistryLite extensionRegistry, FieldSet<T> extensions) throws IOException Parses a length-prefixed MessageSet item from the reader.- Throws:
IOException
-
parseMessageSetItem
abstract void parseMessageSetItem(ByteString data, Object extension, ExtensionRegistryLite extensionRegistry, FieldSet<T> extensions) throws IOException Parses the entire content of aByteStringas one MessageSet item. UnlikeparseLengthPrefixedMessageSetItem(com.google.protobuf.Reader, java.lang.Object, com.google.protobuf.ExtensionRegistryLite, com.google.protobuf.FieldSet<T>), there isn't a length-prefix.- Throws:
IOException
-