Class DescriptorProtos.FileDescriptorProto (3.19.4)

public static final class DescriptorProtos.FileDescriptorProto extends GeneratedMessageV3 implements DescriptorProtos.FileDescriptorProtoOrBuilder

Describes a complete .proto file.

Protobuf type google.protobuf.FileDescriptorProto

Inheritance

Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > DescriptorProtos.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
Field Value
Type Description
Parser<FileDescriptorProto>

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()
Returns
Type Description
DescriptorProtos.FileDescriptorProto

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptors.Descriptor

newBuilder()

public static DescriptorProtos.FileDescriptorProto.Builder newBuilder()
Returns
Type Description
DescriptorProtos.FileDescriptorProto.Builder

newBuilder(DescriptorProtos.FileDescriptorProto prototype)

public static DescriptorProtos.FileDescriptorProto.Builder newBuilder(DescriptorProtos.FileDescriptorProto prototype)
Parameter
Name Description
prototype DescriptorProtos.FileDescriptorProto
Returns
Type Description
DescriptorProtos.FileDescriptorProto.Builder

parseDelimitedFrom(InputStream input)

public static DescriptorProtos.FileDescriptorProto parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
DescriptorProtos.FileDescriptorProto
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.FileDescriptorProto parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.FileDescriptorProto
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static DescriptorProtos.FileDescriptorProto parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
DescriptorProtos.FileDescriptorProto
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.FileDescriptorProto parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.FileDescriptorProto
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static DescriptorProtos.FileDescriptorProto parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
DescriptorProtos.FileDescriptorProto
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.FileDescriptorProto parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.FileDescriptorProto
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static DescriptorProtos.FileDescriptorProto parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
DescriptorProtos.FileDescriptorProto
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.FileDescriptorProto parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.FileDescriptorProto
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static DescriptorProtos.FileDescriptorProto parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
DescriptorProtos.FileDescriptorProto
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.FileDescriptorProto parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.FileDescriptorProto
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static DescriptorProtos.FileDescriptorProto parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
DescriptorProtos.FileDescriptorProto
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.FileDescriptorProto parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.FileDescriptorProto
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<DescriptorProtos.FileDescriptorProto> parser()
Returns
Type Description
Parser<FileDescriptorProto>

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
Returns
Type Description
boolean
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.

Returns
Type Description
DescriptorProtos.FileDescriptorProto

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;

Returns
Type Description
ProtocolStringList

A list containing the dependency.

getEnumType(int index)

public DescriptorProtos.EnumDescriptorProto getEnumType(int index)

repeated .google.protobuf.EnumDescriptorProto enum_type = 5;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.EnumDescriptorProto

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;

Returns
Type Description
List<EnumDescriptorProto>

getEnumTypeOrBuilder(int index)

public DescriptorProtos.EnumDescriptorProtoOrBuilder getEnumTypeOrBuilder(int index)

repeated .google.protobuf.EnumDescriptorProto enum_type = 5;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.EnumDescriptorProtoOrBuilder

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
Returns
Type Description
DescriptorProtos.FieldDescriptorProto

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;

Returns
Type Description
List<FieldDescriptorProto>

getExtensionOrBuilder(int index)

public DescriptorProtos.FieldDescriptorProtoOrBuilder getExtensionOrBuilder(int index)

repeated .google.protobuf.FieldDescriptorProto extension = 7;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.FieldDescriptorProtoOrBuilder

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
Returns
Type Description
DescriptorProtos.DescriptorProto

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;

Returns
Type Description
List<DescriptorProto>

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
Returns
Type Description
DescriptorProtos.DescriptorProtoOrBuilder

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()

public String 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;

Returns
Type Description
DescriptorProtos.FileOptions

The options.

getOptionsOrBuilder()

public DescriptorProtos.FileOptionsOrBuilder getOptionsOrBuilder()

optional .google.protobuf.FileOptions options = 8;

Returns
Type Description
DescriptorProtos.FileOptionsOrBuilder

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()
Returns
Type Description
Parser<FileDescriptorProto>
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
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto

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;

Returns
Type Description
List<ServiceDescriptorProto>

getServiceOrBuilder(int index)

public DescriptorProtos.ServiceDescriptorProtoOrBuilder getServiceOrBuilder(int index)

repeated .google.protobuf.ServiceDescriptorProto service = 6;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.ServiceDescriptorProtoOrBuilder

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;

Returns
Type Description
DescriptorProtos.SourceCodeInfo

The sourceCodeInfo.

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;

Returns
Type Description
DescriptorProtos.SourceCodeInfoOrBuilder

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()

Get the UnknownFieldSet for this message.

Returns
Type Description
UnknownFieldSet
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()

public boolean 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()

public int 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.

Returns
Type Description
GeneratedMessageV3.FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()

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

See also: MessageOrBuilder#getInitializationErrorString()

Returns
Type Description
boolean
Overrides

newBuilderForType()

public DescriptorProtos.FileDescriptorProto.Builder newBuilderForType()
Returns
Type Description
DescriptorProtos.FileDescriptorProto.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected DescriptorProtos.FileDescriptorProto.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)

TODO(xiaofeng): remove this together with GeneratedMessageV3.BuilderParent.

Parameter
Name Description
parent GeneratedMessageV3.BuilderParent
Returns
Type Description
DescriptorProtos.FileDescriptorProto.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

Creates a new instance of this message type. Overridden in the generated code.

Parameter
Name Description
unused GeneratedMessageV3.UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public DescriptorProtos.FileDescriptorProto.Builder toBuilder()
Returns
Type Description
DescriptorProtos.FileDescriptorProto.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)

Serializes the message and writes it to output. This does not flush or close the stream.

Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException