public static final class DescriptorProtos.FileDescriptorProto extends GeneratedMessageV3 implements DescriptorProtos.FileDescriptorProtoOrBuilder
Describes a complete .proto file.
Protobuf type google.protobuf.FileDescriptorProto
Static Fields
DEPENDENCY_FIELD_NUMBER
public static final int DEPENDENCY_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
ENUM_TYPE_FIELD_NUMBER
public static final int ENUM_TYPE_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
EXTENSION_FIELD_NUMBER
public static final int EXTENSION_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
MESSAGE_TYPE_FIELD_NUMBER
public static final int MESSAGE_TYPE_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
OPTIONS_FIELD_NUMBER
public static final int OPTIONS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
PACKAGE_FIELD_NUMBER
public static final int PACKAGE_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
PARSER
public static final Parser<DescriptorProtos.FileDescriptorProto> PARSER
PUBLIC_DEPENDENCY_FIELD_NUMBER
public static final int PUBLIC_DEPENDENCY_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
SERVICE_FIELD_NUMBER
public static final int SERVICE_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
SOURCE_CODE_INFO_FIELD_NUMBER
public static final int SOURCE_CODE_INFO_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
SYNTAX_FIELD_NUMBER
public static final int SYNTAX_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
WEAK_DEPENDENCY_FIELD_NUMBER
public static final int WEAK_DEPENDENCY_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
Static Methods
getDefaultInstance()
public static DescriptorProtos.FileDescriptorProto getDefaultInstance()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static DescriptorProtos.FileDescriptorProto.Builder newBuilder()
newBuilder(DescriptorProtos.FileDescriptorProto prototype)
public static DescriptorProtos.FileDescriptorProto.Builder newBuilder(DescriptorProtos.FileDescriptorProto prototype)
public static DescriptorProtos.FileDescriptorProto parseDelimitedFrom(InputStream input)
public static DescriptorProtos.FileDescriptorProto parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static DescriptorProtos.FileDescriptorProto parseFrom(byte[] data)
Parameter |
Name |
Description |
data |
byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static DescriptorProtos.FileDescriptorProto parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static DescriptorProtos.FileDescriptorProto parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static DescriptorProtos.FileDescriptorProto parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static DescriptorProtos.FileDescriptorProto parseFrom(CodedInputStream input)
public static DescriptorProtos.FileDescriptorProto parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static DescriptorProtos.FileDescriptorProto parseFrom(InputStream input)
public static DescriptorProtos.FileDescriptorProto parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static DescriptorProtos.FileDescriptorProto parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static DescriptorProtos.FileDescriptorProto parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<DescriptorProtos.FileDescriptorProto> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Compares the specified object with this message for equality. Returns true
if the given
object is a message of the same type (as defined by getDescriptorForType()
) and has
identical values for all of its fields. Subclasses must implement this; inheriting
Object.equals()
is incorrect.
Parameter |
Name |
Description |
obj |
Object
|
Overrides
getDefaultInstanceForType()
public DescriptorProtos.FileDescriptorProto getDefaultInstanceForType()
Get an instance of the type with no fields set. Because no fields are set, all getters for
singular fields will return default values and repeated fields will appear empty. This may or
may not be a singleton. This differs from the getDefaultInstance()
method of generated
message classes in that this method is an abstract method of the MessageLite
interface
whereas getDefaultInstance()
is a static method of a specific class. They return the
same thing.
getDependency(int index)
public String getDependency(int index)
Names of files imported by this file.
repeated string dependency = 3;
Parameter |
Name |
Description |
index |
int
The index of the element to return.
|
Returns |
Type |
Description |
String |
The dependency at the given index.
|
getDependencyBytes(int index)
public ByteString getDependencyBytes(int index)
Names of files imported by this file.
repeated string dependency = 3;
Parameter |
Name |
Description |
index |
int
The index of the value to return.
|
Returns |
Type |
Description |
ByteString |
The bytes of the dependency at the given index.
|
getDependencyCount()
public int getDependencyCount()
Names of files imported by this file.
repeated string dependency = 3;
Returns |
Type |
Description |
int |
The count of dependency.
|
getDependencyList()
public ProtocolStringList getDependencyList()
Names of files imported by this file.
repeated string dependency = 3;
getEnumType(int index)
public DescriptorProtos.EnumDescriptorProto getEnumType(int index)
repeated .google.protobuf.EnumDescriptorProto enum_type = 5;
Parameter |
Name |
Description |
index |
int
|
getEnumTypeCount()
public int getEnumTypeCount()
repeated .google.protobuf.EnumDescriptorProto enum_type = 5;
Returns |
Type |
Description |
int |
|
getEnumTypeList()
public List<DescriptorProtos.EnumDescriptorProto> getEnumTypeList()
repeated .google.protobuf.EnumDescriptorProto enum_type = 5;
getEnumTypeOrBuilder(int index)
public DescriptorProtos.EnumDescriptorProtoOrBuilder getEnumTypeOrBuilder(int index)
repeated .google.protobuf.EnumDescriptorProto enum_type = 5;
Parameter |
Name |
Description |
index |
int
|
getEnumTypeOrBuilderList()
public List<? extends DescriptorProtos.EnumDescriptorProtoOrBuilder> getEnumTypeOrBuilderList()
repeated .google.protobuf.EnumDescriptorProto enum_type = 5;
Returns |
Type |
Description |
List<? extends com.google.protobuf.DescriptorProtos.EnumDescriptorProtoOrBuilder> |
|
getExtension(int index)
public DescriptorProtos.FieldDescriptorProto getExtension(int index)
repeated .google.protobuf.FieldDescriptorProto extension = 7;
Parameter |
Name |
Description |
index |
int
|
getExtensionCount()
public int getExtensionCount()
repeated .google.protobuf.FieldDescriptorProto extension = 7;
Returns |
Type |
Description |
int |
|
getExtensionList()
public List<DescriptorProtos.FieldDescriptorProto> getExtensionList()
repeated .google.protobuf.FieldDescriptorProto extension = 7;
getExtensionOrBuilder(int index)
public DescriptorProtos.FieldDescriptorProtoOrBuilder getExtensionOrBuilder(int index)
repeated .google.protobuf.FieldDescriptorProto extension = 7;
Parameter |
Name |
Description |
index |
int
|
getExtensionOrBuilderList()
public List<? extends DescriptorProtos.FieldDescriptorProtoOrBuilder> getExtensionOrBuilderList()
repeated .google.protobuf.FieldDescriptorProto extension = 7;
Returns |
Type |
Description |
List<? extends com.google.protobuf.DescriptorProtos.FieldDescriptorProtoOrBuilder> |
|
getMessageType(int index)
public DescriptorProtos.DescriptorProto getMessageType(int index)
All top-level definitions in this file.
repeated .google.protobuf.DescriptorProto message_type = 4;
Parameter |
Name |
Description |
index |
int
|
getMessageTypeCount()
public int getMessageTypeCount()
All top-level definitions in this file.
repeated .google.protobuf.DescriptorProto message_type = 4;
Returns |
Type |
Description |
int |
|
getMessageTypeList()
public List<DescriptorProtos.DescriptorProto> getMessageTypeList()
All top-level definitions in this file.
repeated .google.protobuf.DescriptorProto message_type = 4;
getMessageTypeOrBuilder(int index)
public DescriptorProtos.DescriptorProtoOrBuilder getMessageTypeOrBuilder(int index)
All top-level definitions in this file.
repeated .google.protobuf.DescriptorProto message_type = 4;
Parameter |
Name |
Description |
index |
int
|
getMessageTypeOrBuilderList()
public List<? extends DescriptorProtos.DescriptorProtoOrBuilder> getMessageTypeOrBuilderList()
All top-level definitions in this file.
repeated .google.protobuf.DescriptorProto message_type = 4;
Returns |
Type |
Description |
List<? extends com.google.protobuf.DescriptorProtos.DescriptorProtoOrBuilder> |
|
getName()
file name, relative to root of source tree
optional string name = 1;
Returns |
Type |
Description |
String |
The name.
|
getNameBytes()
public ByteString getNameBytes()
file name, relative to root of source tree
optional string name = 1;
Returns |
Type |
Description |
ByteString |
The bytes for name.
|
getOptions()
public DescriptorProtos.FileOptions getOptions()
optional .google.protobuf.FileOptions options = 8;
getOptionsOrBuilder()
public DescriptorProtos.FileOptionsOrBuilder getOptionsOrBuilder()
optional .google.protobuf.FileOptions options = 8;
getPackage()
public String getPackage()
e.g. "foo", "foo.bar", etc.
optional string package = 2;
Returns |
Type |
Description |
String |
The package.
|
getPackageBytes()
public ByteString getPackageBytes()
e.g. "foo", "foo.bar", etc.
optional string package = 2;
Returns |
Type |
Description |
ByteString |
The bytes for package.
|
getParserForType()
public Parser<DescriptorProtos.FileDescriptorProto> getParserForType()
Overrides
getPublicDependency(int index)
public int getPublicDependency(int index)
Indexes of the public imported files in the dependency list above.
repeated int32 public_dependency = 10;
Parameter |
Name |
Description |
index |
int
The index of the element to return.
|
Returns |
Type |
Description |
int |
The publicDependency at the given index.
|
getPublicDependencyCount()
public int getPublicDependencyCount()
Indexes of the public imported files in the dependency list above.
repeated int32 public_dependency = 10;
Returns |
Type |
Description |
int |
The count of publicDependency.
|
getPublicDependencyList()
public List<Integer> getPublicDependencyList()
Indexes of the public imported files in the dependency list above.
repeated int32 public_dependency = 10;
Returns |
Type |
Description |
List<Integer> |
A list containing the publicDependency.
|
getSerializedSize()
public int getSerializedSize()
Get the number of bytes required to encode this message. The result is only computed on the
first call and memoized after that.
If this message requires more than Integer.MAX_VALUE bytes to encode, the return value will
be smaller than the actual number of bytes required and might be negative.
Returns |
Type |
Description |
int |
|
Overrides
getService(int index)
public DescriptorProtos.ServiceDescriptorProto getService(int index)
repeated .google.protobuf.ServiceDescriptorProto service = 6;
Parameter |
Name |
Description |
index |
int
|
getServiceCount()
public int getServiceCount()
repeated .google.protobuf.ServiceDescriptorProto service = 6;
Returns |
Type |
Description |
int |
|
getServiceList()
public List<DescriptorProtos.ServiceDescriptorProto> getServiceList()
repeated .google.protobuf.ServiceDescriptorProto service = 6;
getServiceOrBuilder(int index)
public DescriptorProtos.ServiceDescriptorProtoOrBuilder getServiceOrBuilder(int index)
repeated .google.protobuf.ServiceDescriptorProto service = 6;
Parameter |
Name |
Description |
index |
int
|
getServiceOrBuilderList()
public List<? extends DescriptorProtos.ServiceDescriptorProtoOrBuilder> getServiceOrBuilderList()
repeated .google.protobuf.ServiceDescriptorProto service = 6;
Returns |
Type |
Description |
List<? extends com.google.protobuf.DescriptorProtos.ServiceDescriptorProtoOrBuilder> |
|
getSourceCodeInfo()
public DescriptorProtos.SourceCodeInfo getSourceCodeInfo()
This field contains optional information about the original source code.
You may safely remove this entire field without harming runtime
functionality of the descriptors -- the information is needed only by
development tools.
optional .google.protobuf.SourceCodeInfo source_code_info = 9;
getSourceCodeInfoOrBuilder()
public DescriptorProtos.SourceCodeInfoOrBuilder getSourceCodeInfoOrBuilder()
This field contains optional information about the original source code.
You may safely remove this entire field without harming runtime
functionality of the descriptors -- the information is needed only by
development tools.
optional .google.protobuf.SourceCodeInfo source_code_info = 9;
getSyntax()
public String getSyntax()
The syntax of the proto file.
The supported values are "proto2" and "proto3".
optional string syntax = 12;
Returns |
Type |
Description |
String |
The syntax.
|
getSyntaxBytes()
public ByteString getSyntaxBytes()
The syntax of the proto file.
The supported values are "proto2" and "proto3".
optional string syntax = 12;
Returns |
Type |
Description |
ByteString |
The bytes for syntax.
|
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Overrides
getWeakDependency(int index)
public int getWeakDependency(int index)
Indexes of the weak imported files in the dependency list.
For Google-internal migration only. Do not use.
repeated int32 weak_dependency = 11;
Parameter |
Name |
Description |
index |
int
The index of the element to return.
|
Returns |
Type |
Description |
int |
The weakDependency at the given index.
|
getWeakDependencyCount()
public int getWeakDependencyCount()
Indexes of the weak imported files in the dependency list.
For Google-internal migration only. Do not use.
repeated int32 weak_dependency = 11;
Returns |
Type |
Description |
int |
The count of weakDependency.
|
getWeakDependencyList()
public List<Integer> getWeakDependencyList()
Indexes of the weak imported files in the dependency list.
For Google-internal migration only. Do not use.
repeated int32 weak_dependency = 11;
Returns |
Type |
Description |
List<Integer> |
A list containing the weakDependency.
|
hasName()
file name, relative to root of source tree
optional string name = 1;
Returns |
Type |
Description |
boolean |
Whether the name field is set.
|
hasOptions()
public boolean hasOptions()
optional .google.protobuf.FileOptions options = 8;
Returns |
Type |
Description |
boolean |
Whether the options field is set.
|
hasPackage()
public boolean hasPackage()
e.g. "foo", "foo.bar", etc.
optional string package = 2;
Returns |
Type |
Description |
boolean |
Whether the package field is set.
|
hasSourceCodeInfo()
public boolean hasSourceCodeInfo()
This field contains optional information about the original source code.
You may safely remove this entire field without harming runtime
functionality of the descriptors -- the information is needed only by
development tools.
optional .google.protobuf.SourceCodeInfo source_code_info = 9;
Returns |
Type |
Description |
boolean |
Whether the sourceCodeInfo field is set.
|
hasSyntax()
public boolean hasSyntax()
The syntax of the proto file.
The supported values are "proto2" and "proto3".
optional string syntax = 12;
Returns |
Type |
Description |
boolean |
Whether the syntax field is set.
|
hashCode()
Returns the hash code value for this message. The hash code of a message should mix the
message's type (object identity of the descriptor) with its contents (known and unknown field
values). Subclasses must implement this; inheriting Object.hashCode()
is incorrect.
Returns |
Type |
Description |
int |
|
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
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.
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public DescriptorProtos.FileDescriptorProto.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected DescriptorProtos.FileDescriptorProto.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
TODO(xiaofeng): remove this together with GeneratedMessageV3.BuilderParent.
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Creates a new instance of this message type. Overridden in the generated code.
Returns |
Type |
Description |
Object |
|
Overrides
toBuilder()
public DescriptorProtos.FileDescriptorProto.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Serializes the message and writes it to output
. This does not flush or close the
stream.
Overrides