public static final class Descriptors.FileDescriptor extends Descriptors.GenericDescriptor
.proto file, including everything defined within. That includes, in particular, descriptors for all the messages and file descriptors for all other imported
.proto files (dependencies).
| Modifier and Type | Class and Description |
|---|---|
static interface |
Descriptors
This class should be used by generated code only.
|
| Modifier and Type | Method and Description |
|---|---|
static Descriptors |
buildFrom(DescriptorProtos
Construct a
FileDescriptor.
|
Descriptors |
findEnumTypeByName(String
Find an enum type in the file by name.
|
Descriptors |
findExtensionByName(String
Find an extension in the file by name.
|
Descriptors |
findMessageTypeByName(String
Find a message type in the file by name.
|
Descriptors |
findServiceByName(String
Find a service type in the file by name.
|
List |
getDependencies()
Get a list of this file's dependencies (imports).
|
List |
getEnumTypes()
Get a list of top-level enum types declared in this file.
|
List |
getExtensions()
Get a list of top-level extensions declared in this file.
|
Descriptors |
getFile()
Returns this object.
|
String |
getFullName()
Returns the same as getName().
|
List |
getMessageTypes()
Get a list of top-level message types declared in this file.
|
String |
getName()
Get the file name.
|
DescriptorProtos |
getOptions()
Get the
FileOptions, defined in
descriptor.proto.
|
String |
getPackage()
Get the proto package name.
|
List |
getPublicDependencies()
Get a list of this file's public dependencies (public imports).
|
List |
getServices()
Get a list of top-level services declared in this file.
|
static void |
internalBuildGeneratedFileFrom(String
This method is to be called by generated code only.
|
static void |
internalBuildGeneratedFileFrom(String
This method is to be called by generated code only.
|
static void |
internalUpdateFileDescriptor(Descriptors
This method is to be called by generated code only.
|
DescriptorProtos |
toProto()
Convert the descriptor to its protocol message representation.
|
public DescriptorProtos.FileDescriptorProto toProto()
public StringgetName()
public Descriptors.FileDescriptor getFile()
public StringgetFullName()
public StringgetPackage()
package statement in the
.proto file, which differs from the Java package.
public DescriptorProtos.FileOptions getOptions()
FileOptions, defined in
descriptor.proto.
public List<Descriptors .Descriptor > getMessageTypes()
public List<Descriptors .EnumDescriptor > getEnumTypes()
public List<Descriptors .ServiceDescriptor > getServices()
public List<Descriptors .FieldDescriptor > getExtensions()
public List<Descriptors .FileDescriptor > getDependencies()
public List<Descriptors .FileDescriptor > getPublicDependencies()
public Descriptors.Descriptor findMessageTypeByName(String name)
name - The unqualified type name to look for.
null if not found.
public Descriptors.EnumDescriptor findEnumTypeByName(String name)
name - The unqualified type name to look for.
null if not found.
public Descriptors.ServiceDescriptor findServiceByName(String name)
name - The unqualified type name to look for.
null if not found.
public Descriptors.FieldDescriptor findExtensionByName(String name)
name - The unqualified extension name to look for.
null if not found.
public static Descriptors.FileDescriptor buildFrom(DescriptorProtos .FileDescriptorProto proto, Descriptors .FileDescriptor [] dependencies) throws Descriptors .DescriptorValidationException
FileDescriptor.
proto - The protocol message form of the FileDescriptor.
dependencies -
FileDescriptors corresponding to all of the file's dependencies.
Descriptors.DescriptorValidationException -
proto is not a valid descriptor. This can occur for a number of reasons, e.g. because a field has an undefined type or because two messages were defined with the same name.
public static void internalBuildGeneratedFileFrom(String[] descriptorDataParts, Descriptors .FileDescriptor [] dependencies, Descriptors .FileDescriptor .InternalDescriptorAssigner descriptorAssigner)
buildFrom except that the
FileDescriptorProto is encoded in protocol buffer wire format.
public static void internalBuildGeneratedFileFrom(String[] descriptorDataParts, Class <?> descriptorOuterClass, String [] dependencies, String [] dependencyFileNames, Descriptors .FileDescriptor .InternalDescriptorAssigner descriptorAssigner)
public static void internalUpdateFileDescriptor(Descriptors.FileDescriptor descriptor, ExtensionRegistry registry)