Package com.google.protobuf
Class ExtensionSchema<T extends FieldSet.FieldDescriptorLite<T>>
java.lang.Object
com.google.protobuf.ExtensionSchema<T>
- Direct Known Subclasses:
ExtensionSchemaFull
,ExtensionSchemaLite
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract int
extensionNumber
(Map.Entry<?, ?> extension) Gets the field number of an extension entry.(package private) abstract Object
findExtensionByNumber
(ExtensionRegistryLite extensionRegistry, MessageLite defaultInstance, int number) Finds an extension by field number.getExtensions
(Object message) Returns the extensionFieldSet
for the message instance.getMutableExtensions
(Object message) Returns the extensionFieldSet
and ensures it's mutable.(package private) abstract boolean
hasExtensions
(MessageLite prototype) Returns true for messages that support extensions.(package private) abstract void
makeImmutable
(Object message) Marks the extensionFieldSet
as 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 void
parseLengthPrefixedMessageSetItem
(Reader reader, Object extension, ExtensionRegistryLite extensionRegistry, FieldSet<T> extensions) Parses a length-prefixed MessageSet item from the reader.(package private) abstract void
parseMessageSetItem
(ByteString data, Object extension, ExtensionRegistryLite extensionRegistry, FieldSet<T> extensions) Parses the entire content of aByteString
as one MessageSet item.(package private) abstract void
serializeExtension
(Writer writer, Map.Entry<?, ?> extension) Serializes one extension entry.(package private) abstract void
setExtensions
(Object message, FieldSet<T> extensions) Replaces the extensionFieldSet
for the message instance.
-
Constructor Details
-
ExtensionSchema
ExtensionSchema()
-
-
Method Details
-
hasExtensions
Returns true for messages that support extensions. -
getExtensions
Returns the extensionFieldSet
for the message instance. -
setExtensions
Replaces the extensionFieldSet
for the message instance. -
getMutableExtensions
Returns the extensionFieldSet
and ensures it's mutable. -
makeImmutable
Marks the extensionFieldSet
as 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 aByteString
as 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
-