webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
com.google.protobuf.GeneratedMessage Class Referenceabstract
Inheritance diagram for com.google.protobuf.GeneratedMessage:
com.google.protobuf.AbstractMessage com.google.protobuf.AbstractMessageLite< MessageType extends AbstractMessageLite< MessageType, BuilderType, BuilderType extends AbstractMessageLite.Builder< MessageType, BuilderType > com.google.protobuf.Message com.google.protobuf.MessageLite com.google.protobuf.MessageLite com.google.protobuf.MessageOrBuilder com.google.protobuf.MessageLiteOrBuilder com.google.protobuf.MessageLiteOrBuilder com.google.protobuf.MessageLiteOrBuilder

Classes

class  Builder
 
interface  BuilderParent
 
class  ExtendableBuilder
 
class  ExtendableMessage
 
interface  ExtendableMessageOrBuilder
 
interface  ExtensionDescriptorRetriever
 
class  FieldAccessorTable
 
class  GeneratedExtension
 

Public Member Functions

Parser<? extends GeneratedMessagegetParserForType ()
 
Descriptor getDescriptorForType ()
 
boolean isInitialized ()
 
Map< FieldDescriptor, ObjectgetAllFields ()
 
boolean hasOneof (final OneofDescriptor oneof)
 
FieldDescriptor getOneofFieldDescriptor (final OneofDescriptor oneof)
 
boolean hasField (final FieldDescriptor field)
 
Object getField (final FieldDescriptor field)
 
int getRepeatedFieldCount (final FieldDescriptor field)
 
Object getRepeatedField (final FieldDescriptor field, final int index)
 
UnknownFieldSet getUnknownFields ()
 
void writeTo (final CodedOutputStream output) throws IOException
 
int getSerializedSize ()
 
- Public Member Functions inherited from com.google.protobuf.AbstractMessage
boolean isInitialized ()
 
List< String > findInitializationErrors ()
 
String getInitializationErrorString ()
 
boolean hasOneof (OneofDescriptor oneof)
 
FieldDescriptor getOneofFieldDescriptor (OneofDescriptor oneof)
 
final String toString ()
 
void writeTo (final CodedOutputStream output) throws IOException
 
int getSerializedSize ()
 
boolean equals (final Object other)
 
int hashCode ()
 
- Public Member Functions inherited from com.google.protobuf.AbstractMessageLite< MessageType extends AbstractMessageLite< MessageType, BuilderType, BuilderType extends AbstractMessageLite.Builder< MessageType, BuilderType >
ByteString toByteString ()
 
byte [] toByteArray ()
 
void writeTo (final OutputStream output) throws IOException
 
void writeDelimitedTo (final OutputStream output) throws IOException
 
- Public Member Functions inherited from com.google.protobuf.Message
Builder newBuilderForType ()
 
Builder toBuilder ()
 
- Public Member Functions inherited from com.google.protobuf.MessageOrBuilder
Message getDefaultInstanceForType ()
 
boolean hasOneof (Descriptors.OneofDescriptor oneof)
 
Descriptors.FieldDescriptor getOneofFieldDescriptor (Descriptors.OneofDescriptor oneof)
 
boolean hasField (Descriptors.FieldDescriptor field)
 
Object getField (Descriptors.FieldDescriptor field)
 
int getRepeatedFieldCount (Descriptors.FieldDescriptor field)
 
Object getRepeatedField (Descriptors.FieldDescriptor field, int index)
 

Static Public Member Functions

static< ContainingType extends Message, Type > GeneratedExtension< ContainingType, TypenewMessageScopedGeneratedExtension (final Message scope, final int descriptorIndex, final Class singularType, final Message defaultInstance)
 
static< ContainingType extends Message, Type > GeneratedExtension< ContainingType, TypenewFileScopedGeneratedExtension (final Class singularType, final Message defaultInstance)
 
static< ContainingType extends Message, Type > GeneratedExtension< ContainingType, TypenewMessageScopedGeneratedExtension (final Message scope, final String name, final Class singularType, final Message defaultInstance)
 
static< ContainingType extends Message, Type > GeneratedExtension< ContainingType, TypenewFileScopedGeneratedExtension (final Class singularType, final Message defaultInstance, final String descriptorOuterClass, final String extensionName)
 

Protected Member Functions

 GeneratedMessage ()
 
 GeneratedMessage (Builder<?> builder)
 
abstract FieldAccessorTable internalGetFieldAccessorTable ()
 
boolean parseUnknownField (CodedInputStream input, UnknownFieldSet.Builder unknownFields, ExtensionRegistryLite extensionRegistry, int tag) throws IOException
 
void makeExtensionsImmutable ()
 
abstract Message.Builder newBuilderForType (BuilderParent parent)
 
MapField internalGetMapField (int fieldNumber)
 
Object writeReplace () throws ObjectStreamException
 

Static Protected Member Functions

static< M extends Message > M parseWithIOException (Parser< M > parser, InputStream input) throws IOException
 
static< M extends Message > M parseWithIOException (Parser< M > parser, InputStream input, ExtensionRegistryLite extensions) throws IOException
 
static< M extends Message > M parseWithIOException (Parser< M > parser, CodedInputStream input) throws IOException
 
static< M extends Message > M parseWithIOException (Parser< M > parser, CodedInputStream input, ExtensionRegistryLite extensions) throws IOException
 
static< M extends Message > M parseDelimitedWithIOException (Parser< M > parser, InputStream input) throws IOException
 
static< M extends Message > M parseDelimitedWithIOException (Parser< M > parser, InputStream input, ExtensionRegistryLite extensions) throws IOException
 
static int computeStringSize (final int fieldNumber, final Object value)
 
static int computeStringSizeNoTag (final Object value)
 
static void writeString (CodedOutputStream output, final int fieldNumber, final Object value) throws IOException
 
static void writeStringNoTag (CodedOutputStream output, final Object value) throws IOException
 
- Static Protected Member Functions inherited from com.google.protobuf.AbstractMessage
static int hashFields (int hash, Map< FieldDescriptor, Object > map)
 
- Static Protected Member Functions inherited from com.google.protobuf.AbstractMessageLite< MessageType extends AbstractMessageLite< MessageType, BuilderType, BuilderType extends AbstractMessageLite.Builder< MessageType, BuilderType >
static void checkByteStringIsUtf8 (ByteString byteString) throws IllegalArgumentException
 
static< T > void addAll (final Iterable< T > values, final Collection<? super T > list)
 

Protected Attributes

UnknownFieldSet unknownFields
 
- Protected Attributes inherited from com.google.protobuf.AbstractMessage
int memoizedSize = -1
 
- Protected Attributes inherited from com.google.protobuf.AbstractMessageLite< MessageType extends AbstractMessageLite< MessageType, BuilderType, BuilderType extends AbstractMessageLite.Builder< MessageType, BuilderType >
int memoizedHashCode = 0
 

Static Protected Attributes

static boolean alwaysUseFieldBuilders = false
 

Detailed Description

All generated protocol message classes extend this class. This class implements most of the Message and Builder interfaces using Java reflection. Users can ignore this class and pretend that generated messages implement the Message interface directly.

Author
kento.nosp@m.n@go.nosp@m.ogle..nosp@m.com Kenton Varda

Constructor & Destructor Documentation

◆ GeneratedMessage() [1/2]

com.google.protobuf.GeneratedMessage.GeneratedMessage ( )
inlineprotected

◆ GeneratedMessage() [2/2]

com.google.protobuf.GeneratedMessage.GeneratedMessage ( Builder<?>  builder)
inlineprotected

Member Function Documentation

◆ computeStringSize()

static int com.google.protobuf.GeneratedMessage.computeStringSize ( final int  fieldNumber,
final Object  value 
)
inlinestaticprotected

◆ computeStringSizeNoTag()

static int com.google.protobuf.GeneratedMessage.computeStringSizeNoTag ( final Object  value)
inlinestaticprotected

◆ getAllFields()

Map<FieldDescriptor, Object> com.google.protobuf.GeneratedMessage.getAllFields ( )
inline

Returns a collection of all the fields in this message which are set and their corresponding values. A singular ("required" or "optional") field is set iff hasField() returns true for that field. A "repeated" field is set iff getRepeatedFieldCount() is greater than zero. The values are exactly what would be returned by calling getField(Descriptors.FieldDescriptor) for each field. The map is guaranteed to be a sorted map, so iterating over it will return fields in order by field number.
If this is for a builder, the returned map may or may not reflect future changes to the builder. Either way, the returned map is itself unmodifiable.

Implements com.google.protobuf.MessageOrBuilder.

◆ getDescriptorForType()

Descriptor com.google.protobuf.GeneratedMessage.getDescriptorForType ( )
inline

Get the message's type's descriptor. This differs from the

getDescriptor()

method of generated message classes in that this method is an abstract method of the

interface whereas

getDescriptor()

is a static method of a specific class. They return the same thing.

Implements com.google.protobuf.MessageOrBuilder.

◆ getField()

Object com.google.protobuf.GeneratedMessage.getField ( final FieldDescriptor  field)
inline

◆ getOneofFieldDescriptor()

FieldDescriptor com.google.protobuf.GeneratedMessage.getOneofFieldDescriptor ( final OneofDescriptor  oneof)
inline

◆ getParserForType()

Parser<? extends GeneratedMessage> com.google.protobuf.GeneratedMessage.getParserForType ( )
inline

Gets the parser for a message of the same type as this message.

Implements com.google.protobuf.Message.

◆ getRepeatedField()

Object com.google.protobuf.GeneratedMessage.getRepeatedField ( final FieldDescriptor  field,
final int  index 
)
inline

◆ getRepeatedFieldCount()

int com.google.protobuf.GeneratedMessage.getRepeatedFieldCount ( final FieldDescriptor  field)
inline

◆ getSerializedSize()

int com.google.protobuf.GeneratedMessage.getSerializedSize ( )
inline

Get the number of bytes required to encode this message. The result is only computed on the first call and memoized after that.

Implements com.google.protobuf.MessageLite.

◆ getUnknownFields()

UnknownFieldSet com.google.protobuf.GeneratedMessage.getUnknownFields ( )
inline

Get the UnknownFieldSet for this message.

Implements com.google.protobuf.MessageOrBuilder.

◆ hasField()

boolean com.google.protobuf.GeneratedMessage.hasField ( final FieldDescriptor  field)
inline

◆ hasOneof()

boolean com.google.protobuf.GeneratedMessage.hasOneof ( final OneofDescriptor  oneof)
inline

◆ internalGetFieldAccessorTable()

abstract FieldAccessorTable com.google.protobuf.GeneratedMessage.internalGetFieldAccessorTable ( )
abstractprotected

Get the FieldAccessorTable for this type. We can't have the message class pass this in to the constructor because of bootstrapping trouble with DescriptorProtos.

◆ internalGetMapField()

MapField com.google.protobuf.GeneratedMessage.internalGetMapField ( int  fieldNumber)
inlineprotected

Gets the map field with the given field number. This method should be overridden in the generated message class if the message contains map fields.

Unlike other field types, reflection support for map fields can't be implemented based on generated public API because we need to access a map field as a list in reflection API but the generated API only allows us to access it as a map. This method returns the underlying map field directly and thus enables us to access the map field as a list.

◆ isInitialized()

boolean com.google.protobuf.GeneratedMessage.isInitialized ( )
inline

Returns true if all required fields in the message and all embedded messages are set, false otherwise.

See also: MessageOrBuilder#getInitializationErrorString()

Implements com.google.protobuf.MessageLiteOrBuilder.

◆ makeExtensionsImmutable()

void com.google.protobuf.GeneratedMessage.makeExtensionsImmutable ( )
inlineprotected

Used by parsing constructors in generated classes.

◆ newBuilderForType()

abstract Message.Builder com.google.protobuf.GeneratedMessage.newBuilderForType ( BuilderParent  parent)
abstractprotected

◆ newFileScopedGeneratedExtension() [1/2]

static <ContainingType extends Message, Type> GeneratedExtension<ContainingType, Type> com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension ( final Class  singularType,
final Message  defaultInstance 
)
inlinestatic

For use by generated code only.

◆ newFileScopedGeneratedExtension() [2/2]

static <ContainingType extends Message, Type> GeneratedExtension<ContainingType, Type> com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension ( final Class  singularType,
final Message  defaultInstance,
final String  descriptorOuterClass,
final String  extensionName 
)
inlinestatic

Used in proto1 generated code only.

After enabling bridge, we can define proto2 extensions (the extended type is a proto2 mutable message) in a proto1 .proto file. For these extensions we should generate proto2 GeneratedExtensions.

◆ newMessageScopedGeneratedExtension() [1/2]

static <ContainingType extends Message, Type> GeneratedExtension<ContainingType, Type> com.google.protobuf.GeneratedMessage.newMessageScopedGeneratedExtension ( final Message  scope,
final int  descriptorIndex,
final Class  singularType,
final Message  defaultInstance 
)
inlinestatic

For use by generated code only.

◆ newMessageScopedGeneratedExtension() [2/2]

static <ContainingType extends Message, Type> GeneratedExtension<ContainingType, Type> com.google.protobuf.GeneratedMessage.newMessageScopedGeneratedExtension ( final Message  scope,
final String  name,
final Class  singularType,
final Message  defaultInstance 
)
inlinestatic

Used in proto1 generated code only.

After enabling bridge, we can define proto2 extensions (the extended type is a proto2 mutable message) in a proto1 .proto file. For these extensions we should generate proto2 GeneratedExtensions.

◆ parseDelimitedWithIOException() [1/2]

static <M extends Message> M com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException ( Parser< M parser,
InputStream  input 
) throws IOException
inlinestaticprotected

◆ parseDelimitedWithIOException() [2/2]

static <M extends Message> M com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException ( Parser< M parser,
InputStream  input,
ExtensionRegistryLite  extensions 
) throws IOException
inlinestaticprotected

◆ parseUnknownField()

boolean com.google.protobuf.GeneratedMessage.parseUnknownField ( CodedInputStream  input,
UnknownFieldSet.Builder  unknownFields,
ExtensionRegistryLite  extensionRegistry,
int  tag 
) throws IOException
inlineprotected

Called by subclasses to parse an unknown field.

Returns
true
unless the tag is an end-group tag.

◆ parseWithIOException() [1/4]

static <M extends Message> M com.google.protobuf.GeneratedMessage.parseWithIOException ( Parser< M parser,
InputStream  input 
) throws IOException
inlinestaticprotected

◆ parseWithIOException() [2/4]

static <M extends Message> M com.google.protobuf.GeneratedMessage.parseWithIOException ( Parser< M parser,
InputStream  input,
ExtensionRegistryLite  extensions 
) throws IOException
inlinestaticprotected

◆ parseWithIOException() [3/4]

static <M extends Message> M com.google.protobuf.GeneratedMessage.parseWithIOException ( Parser< M parser,
CodedInputStream  input 
) throws IOException
inlinestaticprotected

◆ parseWithIOException() [4/4]

static <M extends Message> M com.google.protobuf.GeneratedMessage.parseWithIOException ( Parser< M parser,
CodedInputStream  input,
ExtensionRegistryLite  extensions 
) throws IOException
inlinestaticprotected

◆ writeReplace()

Object com.google.protobuf.GeneratedMessage.writeReplace ( ) throws ObjectStreamException
inlineprotected

Replaces this object in the output stream with a serialized form. Part of Java's serialization magic. Generated sub-classes must override this method by calling

return super.writeReplace();
Returns
a SerializedForm of this message

◆ writeString()

static void com.google.protobuf.GeneratedMessage.writeString ( CodedOutputStream  output,
final int  fieldNumber,
final Object  value 
) throws IOException
inlinestaticprotected

◆ writeStringNoTag()

static void com.google.protobuf.GeneratedMessage.writeStringNoTag ( CodedOutputStream  output,
final Object  value 
) throws IOException
inlinestaticprotected

◆ writeTo()

void com.google.protobuf.GeneratedMessage.writeTo ( final CodedOutputStream  output) throws IOException
inline

Serializes the message and writes it to

. This does not flush or close the stream.

Implements com.google.protobuf.MessageLite.

Member Data Documentation

◆ alwaysUseFieldBuilders

boolean com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders = false
staticprotected

For testing. Allows a test to disable the optimization that avoids using field builders for nested messages until they are requested. By disabling this optimization, existing tests can be reused to test the field builders.

◆ unknownFields

UnknownFieldSet com.google.protobuf.GeneratedMessage.unknownFields
protected

For use by generated code only.


The documentation for this class was generated from the following file: