Classes | |
class | Builder |
interface | BuilderParent |
class | CachedDescriptorRetriever |
class | ExtendableBuilder |
class | ExtendableMessage |
interface | ExtendableMessageOrBuilder |
interface | ExtensionDescriptorRetriever |
class | FieldAccessorTable |
class | GeneratedExtension |
Static Public Member Functions | |
static< ContainingType extends Message, Type > GeneratedExtension< ContainingType, Type > | newFileScopedGeneratedExtension (final Class singularType, final Message defaultInstance) |
static< ContainingType extends Message, Type > GeneratedExtension< ContainingType, Type > | newFileScopedGeneratedExtension (final Class singularType, final Message defaultInstance, final String descriptorOuterClass, final String extensionName) |
static< ContainingType extends Message, Type > GeneratedExtension< ContainingType, Type > | newMessageScopedGeneratedExtension (final Message scope, final int descriptorIndex, final Class singularType, final Message defaultInstance) |
static< ContainingType extends Message, Type > GeneratedExtension< ContainingType, Type > | newMessageScopedGeneratedExtension (final Message scope, final String name, final Class singularType, final Message defaultInstance) |
Protected Member Functions | |
GeneratedMessage () | |
GeneratedMessage (Builder<?> builder) | |
abstract FieldAccessorTable | internalGetFieldAccessorTable () |
MapField | internalGetMapField (int fieldNumber) |
void | makeExtensionsImmutable () |
abstract Message.Builder | newBuilderForType (BuilderParent parent) |
Message.Builder | newBuilderForType (final AbstractMessage.BuilderParent parent) |
boolean | parseUnknownField (CodedInputStream input, UnknownFieldSet.Builder unknownFields, ExtensionRegistryLite extensionRegistry, int tag) throws IOException |
Object | writeReplace () throws ObjectStreamException |
![]() | |
Message.Builder | newBuilderForType (BuilderParent parent) |
Static Protected Member Functions | |
static int | computeStringSize (final int fieldNumber, final Object value) |
static int | computeStringSizeNoTag (final Object value) |
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< 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 | parseWithIOException (Parser< M > parser, InputStream input) throws IOException |
static< M extends Message > M | parseWithIOException (Parser< M > parser, InputStream input, ExtensionRegistryLite extensions) throws IOException |
static void | writeString (CodedOutputStream output, final int fieldNumber, final Object value) throws IOException |
static void | writeStringNoTag (CodedOutputStream output, final Object value) throws IOException |
![]() | |
static int | hashBoolean (boolean b) |
static int | hashEnum (EnumLite e) |
static int | hashEnumList (List<? extends EnumLite > list) |
static int | hashFields (int hash, Map< FieldDescriptor, Object > map) |
static int | hashLong (long n) |
![]() | |
static< T > void | addAll (final Iterable< T > values, final Collection<? super T > list) |
static< T > void | addAll (final Iterable< T > values, final List<? super T > list) |
static void | checkByteStringIsUtf8 (ByteString byteString) throws IllegalArgumentException |
Protected Attributes | |
UnknownFieldSet | unknownFields |
![]() | |
int | memoizedSize = -1 |
![]() | |
int | memoizedHashCode = 0 |
Static Protected Attributes | |
static boolean | alwaysUseFieldBuilders = false |
Private Member Functions | |
Map< FieldDescriptor, Object > | getAllFieldsMutable (boolean getBytesForString) |
Static Private Member Functions | |
static< MessageType extends ExtendableMessage< MessageType > T Extension< MessageType, T > | checkNotLite (ExtensionLite< MessageType, T > extension) |
static Method | getMethodOrDie (final Class clazz, final String name, final Class... params) |
static Object | invokeOrDie (final Method method, final Object object, final Object... params) |
Static Private Attributes | |
static final long | serialVersionUID = 1L |
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.
Definition at line 61 of file GeneratedMessage.java.
|
inlineprotected |
Definition at line 75 of file GeneratedMessage.java.
|
inlineprotected |
Definition at line 79 of file GeneratedMessage.java.
|
inlinestaticprivate |
Definition at line 3009 of file GeneratedMessage.java.
|
inlinestaticprotected |
Definition at line 3018 of file GeneratedMessage.java.
|
inlinestaticprotected |
Definition at line 3026 of file GeneratedMessage.java.
|
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.
Reimplemented in com.google.protobuf.GeneratedMessage.ExtendableMessage< MessageType extends ExtendableMessage >.
Definition at line 196 of file GeneratedMessage.java.
|
inlineprivate |
Internal helper to return a modifiable map containing all the fields. The returned Map is modifialbe so that the caller can add additional extension fields to implement getAllFields().
getBytesForString | whether to generate ByteString for string fields |
Definition at line 118 of file GeneratedMessage.java.
|
inline |
Get the message's type's descriptor. This differs from the
method of generated message classes in that this method is an abstract method of the
interface whereas
is a static method of a specific class. They return the same thing.
Implements com.google.protobuf.MessageOrBuilder.
Definition at line 107 of file GeneratedMessage.java.
|
inline |
Reimplemented in com.google.protobuf.GeneratedMessage.ExtendableMessage< MessageType extends ExtendableMessage >.
Definition at line 232 of file GeneratedMessage.java.
|
inlinestaticprivate |
Calls Class.getMethod and throws a RuntimeException if it fails.
Definition at line 1967 of file GeneratedMessage.java.
|
inline |
TODO(jieluo): Clear it when all subclasses have implemented this method.
Reimplemented from com.google.protobuf.AbstractMessage.
Definition at line 222 of file GeneratedMessage.java.
|
inline |
Gets the parser for a message of the same type as this message.
Implements com.google.protobuf.Message.
Reimplemented in com.google.protobuf.jruby.SentinelOuterClass.Sentinel.
Definition at line 84 of file GeneratedMessage.java.
|
inline |
Reimplemented in com.google.protobuf.GeneratedMessage.ExtendableMessage< MessageType extends ExtendableMessage >.
Definition at line 255 of file GeneratedMessage.java.
|
inline |
Reimplemented in com.google.protobuf.GeneratedMessage.ExtendableMessage< MessageType extends ExtendableMessage >.
Definition at line 249 of file GeneratedMessage.java.
|
inline |
Get the number of bytes required to encode this message. The result is only computed on the first call and memoized after that.
Reimplemented from com.google.protobuf.AbstractMessage.
Definition at line 338 of file GeneratedMessage.java.
|
inline |
Get the UnknownFieldSet for this message.
Implements com.google.protobuf.MessageOrBuilder.
Reimplemented in com.google.protobuf.jruby.SentinelOuterClass.Sentinel.
Definition at line 261 of file GeneratedMessage.java.
|
inline |
Reimplemented in com.google.protobuf.GeneratedMessage.ExtendableMessage< MessageType extends ExtendableMessage >.
Definition at line 227 of file GeneratedMessage.java.
|
inline |
TODO(jieluo): Clear it when all subclasses have implemented this method.
Reimplemented from com.google.protobuf.AbstractMessage.
Definition at line 217 of file GeneratedMessage.java.
|
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.
Reimplemented in com.google.protobuf.jruby.SentinelOuterClass.Sentinel.
|
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.
Definition at line 2012 of file GeneratedMessage.java.
|
inlinestaticprivate |
Calls invoke and throws a RuntimeException if it fails.
Definition at line 1979 of file GeneratedMessage.java.
|
inline |
Returns true if all required fields in the message and all embedded messages are set, false otherwise.
See also: MessageOrBuilder#getInitializationErrorString()
Reimplemented from com.google.protobuf.AbstractMessage.
Reimplemented in com.google.protobuf.GeneratedMessage.ExtendableMessage< MessageType extends ExtendableMessage >.
Definition at line 166 of file GeneratedMessage.java.
|
inlineprotected |
Used by parsing constructors in generated classes.
Reimplemented in com.google.protobuf.GeneratedMessage.ExtendableMessage< MessageType extends ExtendableMessage >.
Definition at line 354 of file GeneratedMessage.java.
|
abstractprotected |
TODO(xiaofeng): remove this together with GeneratedMessage.BuilderParent.
|
inlineprotected |
Definition at line 372 of file GeneratedMessage.java.
|
inlinestatic |
For use by generated code only.
Definition at line 1638 of file GeneratedMessage.java.
|
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.
Definition at line 1704 of file GeneratedMessage.java.
|
inlinestatic |
For use by generated code only.
Definition at line 1616 of file GeneratedMessage.java.
|
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.
Definition at line 1677 of file GeneratedMessage.java.
|
inlinestaticprotected |
Definition at line 314 of file GeneratedMessage.java.
|
inlinestaticprotected |
Definition at line 323 of file GeneratedMessage.java.
|
inlineprotected |
Called by subclasses to parse an unknown field.
Definition at line 270 of file GeneratedMessage.java.
|
inlinestaticprotected |
Definition at line 296 of file GeneratedMessage.java.
|
inlinestaticprotected |
Definition at line 305 of file GeneratedMessage.java.
|
inlinestaticprotected |
Definition at line 278 of file GeneratedMessage.java.
|
inlinestaticprotected |
Definition at line 287 of file GeneratedMessage.java.
|
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
Definition at line 3000 of file GeneratedMessage.java.
|
inlinestaticprotected |
Definition at line 3034 of file GeneratedMessage.java.
|
inlinestaticprotected |
Definition at line 3043 of file GeneratedMessage.java.
|
inline |
Serializes the message and writes it to
. This does not flush or close the stream.
Reimplemented from com.google.protobuf.AbstractMessage.
Definition at line 333 of file GeneratedMessage.java.
|
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.
Definition at line 70 of file GeneratedMessage.java.
|
staticprivate |
Definition at line 63 of file GeneratedMessage.java.
|
protected |
For use by generated code only.
Definition at line 73 of file GeneratedMessage.java.