Class PluginProtos.CodeGeneratorRequest.Builder (3.19.4)

publicstaticfinalclass PluginProtos.CodeGeneratorRequest.BuilderextendsGeneratedMessageV3.Builder<PluginProtos.CodeGeneratorRequest.Builder>implementsPluginProtos.CodeGeneratorRequestOrBuilder

An encoded CodeGeneratorRequest is written to the plugin's stdin.

Protobuf type google.protobuf.compiler.CodeGeneratorRequest

Inherited Members

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptors.Descriptor

Methods

addAllFileToGenerate(Iterable<String> values)

publicPluginProtos.CodeGeneratorRequest.BuilderaddAllFileToGenerate(Iterable<String>values)

The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.

repeated string file_to_generate = 1;

Parameter
Name Description
values Iterable<String>

The fileToGenerate to add.

Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

This builder for chaining.

addAllProtoFile(Iterable<? extends DescriptorProtos.FileDescriptorProto> values)

publicPluginProtos.CodeGeneratorRequest.BuilderaddAllProtoFile(Iterable<?extendsDescriptorProtos.FileDescriptorProto>values)

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Parameter
Name Description
values Iterable<? extends com.google.protobuf.DescriptorProtos.FileDescriptorProto>
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

addFileToGenerate(String value)

publicPluginProtos.CodeGeneratorRequest.BuilderaddFileToGenerate(Stringvalue)

The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.

repeated string file_to_generate = 1;

Parameter
Name Description
value String

The fileToGenerate to add.

Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

This builder for chaining.

addFileToGenerateBytes(ByteString value)

publicPluginProtos.CodeGeneratorRequest.BuilderaddFileToGenerateBytes(ByteStringvalue)

The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.

repeated string file_to_generate = 1;

Parameter
Name Description
value ByteString

The bytes of the fileToGenerate to add.

Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

This builder for chaining.

addProtoFile(DescriptorProtos.FileDescriptorProto value)

publicPluginProtos.CodeGeneratorRequest.BuilderaddProtoFile(DescriptorProtos.FileDescriptorProtovalue)

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Parameter
Name Description
value DescriptorProtos.FileDescriptorProto
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

addProtoFile(DescriptorProtos.FileDescriptorProto.Builder builderForValue)

publicPluginProtos.CodeGeneratorRequest.BuilderaddProtoFile(DescriptorProtos.FileDescriptorProto.BuilderbuilderForValue)

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Parameter
Name Description
builderForValue DescriptorProtos.FileDescriptorProto.Builder
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

addProtoFile(int index, DescriptorProtos.FileDescriptorProto value)

publicPluginProtos.CodeGeneratorRequest.BuilderaddProtoFile(intindex,DescriptorProtos.FileDescriptorProtovalue)

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Parameters
Name Description
index int
value DescriptorProtos.FileDescriptorProto
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

addProtoFile(int index, DescriptorProtos.FileDescriptorProto.Builder builderForValue)

publicPluginProtos.CodeGeneratorRequest.BuilderaddProtoFile(intindex,DescriptorProtos.FileDescriptorProto.BuilderbuilderForValue)

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Parameters
Name Description
index int
builderForValue DescriptorProtos.FileDescriptorProto.Builder
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

addProtoFileBuilder()

publicDescriptorProtos.FileDescriptorProto.BuilderaddProtoFileBuilder()

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Returns
Type Description
DescriptorProtos.FileDescriptorProto.Builder

addProtoFileBuilder(int index)

publicDescriptorProtos.FileDescriptorProto.BuilderaddProtoFileBuilder(intindex)

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.FileDescriptorProto.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicPluginProtos.CodeGeneratorRequest.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field Descriptors.FieldDescriptor
value Object
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder
Overrides

build()

publicPluginProtos.CodeGeneratorRequestbuild()
Returns
Type Description
PluginProtos.CodeGeneratorRequest

buildPartial()

publicPluginProtos.CodeGeneratorRequestbuildPartial()
Returns
Type Description
PluginProtos.CodeGeneratorRequest

clear()

publicPluginProtos.CodeGeneratorRequest.Builderclear()

Called by the initialization and clear code paths to allow subclasses to reset any of their builtin fields back to the initial values.

Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder
Overrides

clearCompilerVersion()

publicPluginProtos.CodeGeneratorRequest.BuilderclearCompilerVersion()

The version number of protocol compiler.

optional .google.protobuf.compiler.Version compiler_version = 3;

Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

clearField(Descriptors.FieldDescriptor field)

publicPluginProtos.CodeGeneratorRequest.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field Descriptors.FieldDescriptor
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder
Overrides

clearFileToGenerate()

publicPluginProtos.CodeGeneratorRequest.BuilderclearFileToGenerate()

The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.

repeated string file_to_generate = 1;

Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

publicPluginProtos.CodeGeneratorRequest.BuilderclearOneof(Descriptors.OneofDescriptoroneof)

TODO(jieluo): Clear it when all subclasses have implemented this method.

Parameter
Name Description
oneof Descriptors.OneofDescriptor
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder
Overrides

clearParameter()

publicPluginProtos.CodeGeneratorRequest.BuilderclearParameter()

The generator parameter passed on the command-line.

optional string parameter = 2;

Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

This builder for chaining.

clearProtoFile()

publicPluginProtos.CodeGeneratorRequest.BuilderclearProtoFile()

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

clone()

publicPluginProtos.CodeGeneratorRequest.Builderclone()

Clones the Builder.

Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder
Overrides

getCompilerVersion()

publicPluginProtos.VersiongetCompilerVersion()

The version number of protocol compiler.

optional .google.protobuf.compiler.Version compiler_version = 3;

Returns
Type Description
PluginProtos.Version

The compilerVersion.

getCompilerVersionBuilder()

publicPluginProtos.Version.BuildergetCompilerVersionBuilder()

The version number of protocol compiler.

optional .google.protobuf.compiler.Version compiler_version = 3;

Returns
Type Description
PluginProtos.Version.Builder

getCompilerVersionOrBuilder()

publicPluginProtos.VersionOrBuildergetCompilerVersionOrBuilder()

The version number of protocol compiler.

optional .google.protobuf.compiler.Version compiler_version = 3;

Returns
Type Description
PluginProtos.VersionOrBuilder

getDefaultInstanceForType()

publicPluginProtos.CodeGeneratorRequestgetDefaultInstanceForType()

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
PluginProtos.CodeGeneratorRequest

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()

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 Message interface whereas getDescriptor() is a static method of a specific class. They return the same thing.

Returns
Type Description
Descriptors.Descriptor
Overrides

getFileToGenerate(int index)

publicStringgetFileToGenerate(intindex)

The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.

repeated string file_to_generate = 1;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The fileToGenerate at the given index.

getFileToGenerateBytes(int index)

publicByteStringgetFileToGenerateBytes(intindex)

The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.

repeated string file_to_generate = 1;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the fileToGenerate at the given index.

getFileToGenerateCount()

publicintgetFileToGenerateCount()

The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.

repeated string file_to_generate = 1;

Returns
Type Description
int

The count of fileToGenerate.

getFileToGenerateList()

publicProtocolStringListgetFileToGenerateList()

The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.

repeated string file_to_generate = 1;

Returns
Type Description
ProtocolStringList

A list containing the fileToGenerate.

getParameter()

publicStringgetParameter()

The generator parameter passed on the command-line.

optional string parameter = 2;

Returns
Type Description
String

The parameter.

getParameterBytes()

publicByteStringgetParameterBytes()

The generator parameter passed on the command-line.

optional string parameter = 2;

Returns
Type Description
ByteString

The bytes for parameter.

getProtoFile(int index)

publicDescriptorProtos.FileDescriptorProtogetProtoFile(intindex)

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.FileDescriptorProto

getProtoFileBuilder(int index)

publicDescriptorProtos.FileDescriptorProto.BuildergetProtoFileBuilder(intindex)

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.FileDescriptorProto.Builder

getProtoFileBuilderList()

publicList<DescriptorProtos.FileDescriptorProto.Builder>getProtoFileBuilderList()

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Returns
Type Description
List<Builder>

getProtoFileCount()

publicintgetProtoFileCount()

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Returns
Type Description
int

getProtoFileList()

publicList<DescriptorProtos.FileDescriptorProto>getProtoFileList()

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Returns
Type Description
List<FileDescriptorProto>

getProtoFileOrBuilder(int index)

publicDescriptorProtos.FileDescriptorProtoOrBuildergetProtoFileOrBuilder(intindex)

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.FileDescriptorProtoOrBuilder

getProtoFileOrBuilderList()

publicList<?extendsDescriptorProtos.FileDescriptorProtoOrBuilder>getProtoFileOrBuilderList()

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Returns
Type Description
List<? extends com.google.protobuf.DescriptorProtos.FileDescriptorProtoOrBuilder>

hasCompilerVersion()

publicbooleanhasCompilerVersion()

The version number of protocol compiler.

optional .google.protobuf.compiler.Version compiler_version = 3;

Returns
Type Description
boolean

Whether the compilerVersion field is set.

hasParameter()

publicbooleanhasParameter()

The generator parameter passed on the command-line.

optional string parameter = 2;

Returns
Type Description
boolean

Whether the parameter field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()

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

publicfinalbooleanisInitialized()

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

mergeCompilerVersion(PluginProtos.Version value)

publicPluginProtos.CodeGeneratorRequest.BuildermergeCompilerVersion(PluginProtos.Versionvalue)

The version number of protocol compiler.

optional .google.protobuf.compiler.Version compiler_version = 3;

Parameter
Name Description
value PluginProtos.Version
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicPluginProtos.CodeGeneratorRequest.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)

Like Builder#mergeFrom(CodedInputStream), but also parses extensions. The extensions that you want to be able to parse must be registered in extensionRegistry. Extensions not in the registry will be treated as unknown fields.

Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicPluginProtos.CodeGeneratorRequest.BuildermergeFrom(Messageother)

Merge other into the message being built. other must have the exact same type as this (i.e. getDescriptorForType() == other.getDescriptorForType()).

Merging occurs as follows. For each field:

  • For singular primitive fields, if the field is set in other, then other's value overwrites the value in this message.
  • For singular message fields, if the field is set in other, it is merged into the corresponding sub-message of this message using the same merging rules.
  • For repeated fields, the elements in other are concatenated with the elements in this message.
  • For oneof groups, if the other message has one of the fields set, the group of this message is cleared and replaced by the field of the other message, so that the oneof constraint is preserved.

    This is equivalent to the Message::MergeFrom method in C++.

Parameter
Name Description
other Message
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder
Overrides

mergeFrom(PluginProtos.CodeGeneratorRequest other)

publicPluginProtos.CodeGeneratorRequest.BuildermergeFrom(PluginProtos.CodeGeneratorRequestother)
Parameter
Name Description
other PluginProtos.CodeGeneratorRequest
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalPluginProtos.CodeGeneratorRequest.BuildermergeUnknownFields(UnknownFieldSetunknownFields)

Merge some unknown fields into the UnknownFieldSet for this message.

Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder
Overrides

removeProtoFile(int index)

publicPluginProtos.CodeGeneratorRequest.BuilderremoveProtoFile(intindex)

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Parameter
Name Description
index int
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

setCompilerVersion(PluginProtos.Version value)

publicPluginProtos.CodeGeneratorRequest.BuildersetCompilerVersion(PluginProtos.Versionvalue)

The version number of protocol compiler.

optional .google.protobuf.compiler.Version compiler_version = 3;

Parameter
Name Description
value PluginProtos.Version
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

setCompilerVersion(PluginProtos.Version.Builder builderForValue)

publicPluginProtos.CodeGeneratorRequest.BuildersetCompilerVersion(PluginProtos.Version.BuilderbuilderForValue)

The version number of protocol compiler.

optional .google.protobuf.compiler.Version compiler_version = 3;

Parameter
Name Description
builderForValue PluginProtos.Version.Builder
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

setField(Descriptors.FieldDescriptor field, Object value)

publicPluginProtos.CodeGeneratorRequest.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field Descriptors.FieldDescriptor
value Object
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder
Overrides

setFileToGenerate(int index, String value)

publicPluginProtos.CodeGeneratorRequest.BuildersetFileToGenerate(intindex,Stringvalue)

The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.

repeated string file_to_generate = 1;

Parameters
Name Description
index int

The index to set the value at.

value String

The fileToGenerate to set.

Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

This builder for chaining.

setParameter(String value)

publicPluginProtos.CodeGeneratorRequest.BuildersetParameter(Stringvalue)

The generator parameter passed on the command-line.

optional string parameter = 2;

Parameter
Name Description
value String

The parameter to set.

Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

This builder for chaining.

setParameterBytes(ByteString value)

publicPluginProtos.CodeGeneratorRequest.BuildersetParameterBytes(ByteStringvalue)

The generator parameter passed on the command-line.

optional string parameter = 2;

Parameter
Name Description
value ByteString

The bytes for parameter to set.

Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

This builder for chaining.

setProtoFile(int index, DescriptorProtos.FileDescriptorProto value)

publicPluginProtos.CodeGeneratorRequest.BuildersetProtoFile(intindex,DescriptorProtos.FileDescriptorProtovalue)

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Parameters
Name Description
index int
value DescriptorProtos.FileDescriptorProto
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

setProtoFile(int index, DescriptorProtos.FileDescriptorProto.Builder builderForValue)

publicPluginProtos.CodeGeneratorRequest.BuildersetProtoFile(intindex,DescriptorProtos.FileDescriptorProto.BuilderbuilderForValue)

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

repeated .google.protobuf.FileDescriptorProto proto_file = 15;

Parameters
Name Description
index int
builderForValue DescriptorProtos.FileDescriptorProto.Builder
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

publicPluginProtos.CodeGeneratorRequest.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field Descriptors.FieldDescriptor
index int
value Object
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalPluginProtos.CodeGeneratorRequest.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
PluginProtos.CodeGeneratorRequest.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.