FileOptions
class FileOptions extends Message (View source)
Generated from protobuf message google.protobuf.FileOptions
Properties
protected | $java_package | Sets the Java package where classes generated from this .proto will be placed. By default, the proto package is used, but this is often inappropriate because proto packages do not normally start with backwards domain names. |
|
protected | $java_outer_classname | Controls the name of the wrapper Java class generated for the .proto file. |
|
protected | $java_multiple_files | If enabled, then the Java code generator will generate a separate .java file for each top-level message, enum, and service defined in the .proto file. Thus, these types will not be nested inside the wrapper class named by java_outer_classname. However, the wrapper class will still be generated to contain the file's getDescriptor() method as well as any top-level extensions defined in the file. |
|
protected deprecated | $java_generate_equals_and_hash | This option does nothing. |
|
protected | $java_string_check_utf8 | If set true, then the Java2 code generator will generate code that throws an exception whenever an attempt is made to assign a non-UTF-8 byte sequence to a string field. |
|
protected | $optimize_for | Generated from protobuf field |
|
protected | $go_package | Sets the Go package where structs generated from this .proto will be placed. If omitted, the Go package will be derived from the following:
|
|
protected | $cc_generic_services | Should generic services be generated in each language? "Generic" services are not specific to any particular RPC system. They are generated by the main code generators in each language (without additional plugins). |
|
protected | $java_generic_services | Generated from protobuf field |
|
protected | $py_generic_services | Generated from protobuf field |
|
protected | $php_generic_services | Generated from protobuf field |
|
protected | $deprecated | Is this file deprecated? Depending on the target platform, this can emit Deprecated annotations for everything in the file, or it will be completely ignored; in the very least, this is a formalization for deprecating files. |
|
protected | $cc_enable_arenas | Enables the use of arenas for the proto messages in this file. This applies only to generated classes for C++. |
|
protected | $objc_class_prefix | Sets the objective c class prefix which is prepended to all objective c generated classes from this .proto. There is no default. |
|
protected | $csharp_namespace | Namespace for generated classes; defaults to the package. |
|
protected | $swift_prefix | By default Swift generators will take the proto package and CamelCase it replacing '.' with underscore and use that to prefix the types/symbols defined. When this options is provided, they will use this value instead to prefix the types/symbols defined. |
|
protected | $php_class_prefix | Sets the php class prefix which is prepended to all php generated classes from this .proto. Default is empty. |
|
protected | $php_namespace | Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace. |
|
protected | $php_metadata_namespace | Use this option to change the namespace of php generated metadata classes. |
|
protected | $ruby_package | Use this option to change the package of ruby generated classes. Default is empty. When this option is not set, the package name will be used for determining the ruby package. |
Methods
Constructor.
Merges the contents of the specified message into current message.
Parses a json string to protobuf message.
Populates the message from a user-supplied PHP array. Array keys correspond to Message properties and nested message properties.
Sets the Java package where classes generated from this .proto will be placed. By default, the proto package is used, but this is often inappropriate because proto packages do not normally start with backwards domain names.
No description
No description
Sets the Java package where classes generated from this .proto will be placed. By default, the proto package is used, but this is often inappropriate because proto packages do not normally start with backwards domain names.
Controls the name of the wrapper Java class generated for the .proto file.
No description
No description
Controls the name of the wrapper Java class generated for the .proto file.
If enabled, then the Java code generator will generate a separate .java file for each top-level message, enum, and service defined in the .proto file. Thus, these types will not be nested inside the wrapper class named by java_outer_classname. However, the wrapper class will still be generated to contain the file's getDescriptor() method as well as any top-level extensions defined in the file.
No description
No description
If enabled, then the Java code generator will generate a separate .java file for each top-level message, enum, and service defined in the .proto file. Thus, these types will not be nested inside the wrapper class named by java_outer_classname. However, the wrapper class will still be generated to contain the file's getDescriptor() method as well as any top-level extensions defined in the file.
No description
No description
If set true, then the Java2 code generator will generate code that throws an exception whenever an attempt is made to assign a non-UTF-8 byte sequence to a string field.
No description
No description
If set true, then the Java2 code generator will generate code that throws an exception whenever an attempt is made to assign a non-UTF-8 byte sequence to a string field.
Generated from protobuf field optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
No description
No description
Generated from protobuf field optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
Sets the Go package where structs generated from this .proto will be placed. If omitted, the Go package will be derived from the following:
- The basename of the package import path, if provided.
No description
No description
Sets the Go package where structs generated from this .proto will be placed. If omitted, the Go package will be derived from the following:
- The basename of the package import path, if provided.
Should generic services be generated in each language? "Generic" services are not specific to any particular RPC system. They are generated by the main code generators in each language (without additional plugins).
No description
No description
Should generic services be generated in each language? "Generic" services are not specific to any particular RPC system. They are generated by the main code generators in each language (without additional plugins).
Generated from protobuf field optional bool java_generic_services = 17 [default = false];
No description
No description
Generated from protobuf field optional bool java_generic_services = 17 [default = false];
Generated from protobuf field optional bool py_generic_services = 18 [default = false];
No description
No description
Generated from protobuf field optional bool py_generic_services = 18 [default = false];
Generated from protobuf field optional bool php_generic_services = 42 [default = false];
No description
No description
Generated from protobuf field optional bool php_generic_services = 42 [default = false];
Is this file deprecated? Depending on the target platform, this can emit Deprecated annotations for everything in the file, or it will be completely ignored; in the very least, this is a formalization for deprecating files.
No description
No description
Is this file deprecated? Depending on the target platform, this can emit Deprecated annotations for everything in the file, or it will be completely ignored; in the very least, this is a formalization for deprecating files.
Enables the use of arenas for the proto messages in this file. This applies only to generated classes for C++.
No description
No description
Enables the use of arenas for the proto messages in this file. This applies only to generated classes for C++.
Sets the objective c class prefix which is prepended to all objective c generated classes from this .proto. There is no default.
No description
No description
Sets the objective c class prefix which is prepended to all objective c generated classes from this .proto. There is no default.
Namespace for generated classes; defaults to the package.
No description
No description
Namespace for generated classes; defaults to the package.
By default Swift generators will take the proto package and CamelCase it replacing '.' with underscore and use that to prefix the types/symbols defined. When this options is provided, they will use this value instead to prefix the types/symbols defined.
No description
No description
By default Swift generators will take the proto package and CamelCase it replacing '.' with underscore and use that to prefix the types/symbols defined. When this options is provided, they will use this value instead to prefix the types/symbols defined.
Sets the php class prefix which is prepended to all php generated classes from this .proto. Default is empty.
No description
No description
Sets the php class prefix which is prepended to all php generated classes from this .proto. Default is empty.
Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace.
No description
No description
Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace.
Use this option to change the namespace of php generated metadata classes.
No description
No description
Use this option to change the namespace of php generated metadata classes.
Use this option to change the package of ruby generated classes. Default is empty. When this option is not set, the package name will be used for determining the ruby package.
No description
No description
Use this option to change the package of ruby generated classes. Default is empty. When this option is not set, the package name will be used for determining the ruby package.
The parser stores options it doesn't recognize here.
The parser stores options it doesn't recognize here.
Details
__construct($data = NULL)
Constructor.
protected
readWrapperValue($member)
No description
protected
writeWrapperValue($member, $value)
No description
protected
readOneof($number)
No description
protected
hasOneof($number)
No description
protected
writeOneof($number, $value)
No description
protected
whichOneof($oneof_name)
No description
clear()
Clear all containing fields.
discardUnknownFields()
Clear all unknown fields previously parsed.
mergeFrom(object $msg)
Merges the contents of the specified message into current message.
This method merges the contents of the specified message into the current message. Singular fields that are set in the specified message overwrite the corresponding fields in the current message. Repeated fields are appended. Map fields key-value pairs are overwritten. Singular/Oneof sub-messages are recursively merged. All overwritten sub-messages are deep-copied.
mergeFromString(string $data)
Parses a protocol buffer contained in a string.
This function takes a string in the (non-human-readable) binary wire format, matching the encoding output by serializeToString(). See mergeFrom() for merging behavior, if the field is already set in the specified message.
mergeFromJsonString(string $data, $ignore_unknown = false)
Parses a json string to protobuf message.
This function takes a string in the json wire format, matching the encoding output by serializeToJsonString(). See mergeFrom() for merging behavior, if the field is already set in the specified message.
parseFromStream($input)
No description
protected
mergeFromArray(array $array)
Populates the message from a user-supplied PHP array. Array keys correspond to Message properties and nested message properties.
Example:
$message->mergeFromArray([
'name' => 'This is a message name',
'interval' => [
'startTime' => time() - 60,
'endTime' => time(),
]
]);
This method will trigger an error if it is passed data that cannot be converted to the correct type. For example, a StringValue field must receive data that is either a string or a StringValue object.
protected
mergeFromJsonArray($array, $ignore_unknown)
No description
parseFromJsonStream($input, $ignore_unknown)
No description
serializeToStream($output)
No description
serializeToJsonStream($output)
No description
string
serializeToString()
Serialize the message to string.
string
serializeToJsonString()
Serialize the message to json string.
byteSize()
No description
jsonByteSize()
No description
string
getJavaPackage()
Sets the Java package where classes generated from this .proto will be placed. By default, the proto package is used, but this is often inappropriate because proto packages do not normally start with backwards domain names.
Generated from protobuf field optional string java_package = 1;
hasJavaPackage()
No description
clearJavaPackage()
No description
$this
setJavaPackage(string $var)
Sets the Java package where classes generated from this .proto will be placed. By default, the proto package is used, but this is often inappropriate because proto packages do not normally start with backwards domain names.
Generated from protobuf field optional string java_package = 1;
string
getJavaOuterClassname()
Controls the name of the wrapper Java class generated for the .proto file.
That class will always contain the .proto file's getDescriptor() method as well as any top-level extensions defined in the .proto file. If java_multiple_files is disabled, then all the other classes from the .proto file will be nested inside the single wrapper outer class.
Generated from protobuf field optional string java_outer_classname = 8;
hasJavaOuterClassname()
No description
clearJavaOuterClassname()
No description
$this
setJavaOuterClassname(string $var)
Controls the name of the wrapper Java class generated for the .proto file.
That class will always contain the .proto file's getDescriptor() method as well as any top-level extensions defined in the .proto file. If java_multiple_files is disabled, then all the other classes from the .proto file will be nested inside the single wrapper outer class.
Generated from protobuf field optional string java_outer_classname = 8;
bool
getJavaMultipleFiles()
If enabled, then the Java code generator will generate a separate .java file for each top-level message, enum, and service defined in the .proto file. Thus, these types will not be nested inside the wrapper class named by java_outer_classname. However, the wrapper class will still be generated to contain the file's getDescriptor() method as well as any top-level extensions defined in the file.
Generated from protobuf field optional bool java_multiple_files = 10 [default = false];
hasJavaMultipleFiles()
No description
clearJavaMultipleFiles()
No description
$this
setJavaMultipleFiles(bool $var)
If enabled, then the Java code generator will generate a separate .java file for each top-level message, enum, and service defined in the .proto file. Thus, these types will not be nested inside the wrapper class named by java_outer_classname. However, the wrapper class will still be generated to contain the file's getDescriptor() method as well as any top-level extensions defined in the file.
Generated from protobuf field optional bool java_multiple_files = 10 [default = false];
bool
getJavaGenerateEqualsAndHash()
deprecated
deprecated
This option does nothing.
Generated from protobuf field optional bool java_generate_equals_and_hash = 20 [deprecated = true];
hasJavaGenerateEqualsAndHash()
No description
clearJavaGenerateEqualsAndHash()
No description
$this
setJavaGenerateEqualsAndHash(bool $var)
deprecated
deprecated
This option does nothing.
Generated from protobuf field optional bool java_generate_equals_and_hash = 20 [deprecated = true];
bool
getJavaStringCheckUtf8()
If set true, then the Java2 code generator will generate code that throws an exception whenever an attempt is made to assign a non-UTF-8 byte sequence to a string field.
Message reflection will do the same. However, an extension field still accepts non-UTF-8 byte sequences. This option has no effect on when used with the lite runtime.
Generated from protobuf field optional bool java_string_check_utf8 = 27 [default = false];
hasJavaStringCheckUtf8()
No description
clearJavaStringCheckUtf8()
No description
$this
setJavaStringCheckUtf8(bool $var)
If set true, then the Java2 code generator will generate code that throws an exception whenever an attempt is made to assign a non-UTF-8 byte sequence to a string field.
Message reflection will do the same. However, an extension field still accepts non-UTF-8 byte sequences. This option has no effect on when used with the lite runtime.
Generated from protobuf field optional bool java_string_check_utf8 = 27 [default = false];
int
getOptimizeFor()
Generated from protobuf field optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
hasOptimizeFor()
No description
clearOptimizeFor()
No description
$this
setOptimizeFor(int $var)
Generated from protobuf field optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
string
getGoPackage()
Sets the Go package where structs generated from this .proto will be placed. If omitted, the Go package will be derived from the following:
- The basename of the package import path, if provided.
- Otherwise, the package statement in the .proto file, if present.
- Otherwise, the basename of the .proto file, without extension.
Generated from protobuf field optional string go_package = 11;
hasGoPackage()
No description
clearGoPackage()
No description
$this
setGoPackage(string $var)
Sets the Go package where structs generated from this .proto will be placed. If omitted, the Go package will be derived from the following:
- The basename of the package import path, if provided.
- Otherwise, the package statement in the .proto file, if present.
- Otherwise, the basename of the .proto file, without extension.
Generated from protobuf field optional string go_package = 11;
bool
getCcGenericServices()
Should generic services be generated in each language? "Generic" services are not specific to any particular RPC system. They are generated by the main code generators in each language (without additional plugins).
Generic services were the only kind of service generation supported by early versions of google.protobuf. Generic services are now considered deprecated in favor of using plugins that generate code specific to your particular RPC system. Therefore, these default to false. Old code which depends on generic services should explicitly set them to true.
Generated from protobuf field optional bool cc_generic_services = 16 [default = false];
hasCcGenericServices()
No description
clearCcGenericServices()
No description
$this
setCcGenericServices(bool $var)
Should generic services be generated in each language? "Generic" services are not specific to any particular RPC system. They are generated by the main code generators in each language (without additional plugins).
Generic services were the only kind of service generation supported by early versions of google.protobuf. Generic services are now considered deprecated in favor of using plugins that generate code specific to your particular RPC system. Therefore, these default to false. Old code which depends on generic services should explicitly set them to true.
Generated from protobuf field optional bool cc_generic_services = 16 [default = false];
bool
getJavaGenericServices()
Generated from protobuf field optional bool java_generic_services = 17 [default = false];
hasJavaGenericServices()
No description
clearJavaGenericServices()
No description
$this
setJavaGenericServices(bool $var)
Generated from protobuf field optional bool java_generic_services = 17 [default = false];
bool
getPyGenericServices()
Generated from protobuf field optional bool py_generic_services = 18 [default = false];
hasPyGenericServices()
No description
clearPyGenericServices()
No description
$this
setPyGenericServices(bool $var)
Generated from protobuf field optional bool py_generic_services = 18 [default = false];
bool
getPhpGenericServices()
Generated from protobuf field optional bool php_generic_services = 42 [default = false];
hasPhpGenericServices()
No description
clearPhpGenericServices()
No description
$this
setPhpGenericServices(bool $var)
Generated from protobuf field optional bool php_generic_services = 42 [default = false];
bool
getDeprecated()
Is this file deprecated? Depending on the target platform, this can emit Deprecated annotations for everything in the file, or it will be completely ignored; in the very least, this is a formalization for deprecating files.
Generated from protobuf field optional bool deprecated = 23 [default = false];
hasDeprecated()
No description
clearDeprecated()
No description
$this
setDeprecated(bool $var)
Is this file deprecated? Depending on the target platform, this can emit Deprecated annotations for everything in the file, or it will be completely ignored; in the very least, this is a formalization for deprecating files.
Generated from protobuf field optional bool deprecated = 23 [default = false];
bool
getCcEnableArenas()
Enables the use of arenas for the proto messages in this file. This applies only to generated classes for C++.
Generated from protobuf field optional bool cc_enable_arenas = 31 [default = true];
hasCcEnableArenas()
No description
clearCcEnableArenas()
No description
$this
setCcEnableArenas(bool $var)
Enables the use of arenas for the proto messages in this file. This applies only to generated classes for C++.
Generated from protobuf field optional bool cc_enable_arenas = 31 [default = true];
string
getObjcClassPrefix()
Sets the objective c class prefix which is prepended to all objective c generated classes from this .proto. There is no default.
Generated from protobuf field optional string objc_class_prefix = 36;
hasObjcClassPrefix()
No description
clearObjcClassPrefix()
No description
$this
setObjcClassPrefix(string $var)
Sets the objective c class prefix which is prepended to all objective c generated classes from this .proto. There is no default.
Generated from protobuf field optional string objc_class_prefix = 36;
string
getCsharpNamespace()
Namespace for generated classes; defaults to the package.
Generated from protobuf field optional string csharp_namespace = 37;
hasCsharpNamespace()
No description
clearCsharpNamespace()
No description
$this
setCsharpNamespace(string $var)
Namespace for generated classes; defaults to the package.
Generated from protobuf field optional string csharp_namespace = 37;
string
getSwiftPrefix()
By default Swift generators will take the proto package and CamelCase it replacing '.' with underscore and use that to prefix the types/symbols defined. When this options is provided, they will use this value instead to prefix the types/symbols defined.
Generated from protobuf field optional string swift_prefix = 39;
hasSwiftPrefix()
No description
clearSwiftPrefix()
No description
$this
setSwiftPrefix(string $var)
By default Swift generators will take the proto package and CamelCase it replacing '.' with underscore and use that to prefix the types/symbols defined. When this options is provided, they will use this value instead to prefix the types/symbols defined.
Generated from protobuf field optional string swift_prefix = 39;
string
getPhpClassPrefix()
Sets the php class prefix which is prepended to all php generated classes from this .proto. Default is empty.
Generated from protobuf field optional string php_class_prefix = 40;
hasPhpClassPrefix()
No description
clearPhpClassPrefix()
No description
$this
setPhpClassPrefix(string $var)
Sets the php class prefix which is prepended to all php generated classes from this .proto. Default is empty.
Generated from protobuf field optional string php_class_prefix = 40;
string
getPhpNamespace()
Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace.
Generated from protobuf field optional string php_namespace = 41;
hasPhpNamespace()
No description
clearPhpNamespace()
No description
$this
setPhpNamespace(string $var)
Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace.
Generated from protobuf field optional string php_namespace = 41;
string
getPhpMetadataNamespace()
Use this option to change the namespace of php generated metadata classes.
Default is empty. When this option is empty, the proto file name will be used for determining the namespace.
Generated from protobuf field optional string php_metadata_namespace = 44;
hasPhpMetadataNamespace()
No description
clearPhpMetadataNamespace()
No description
$this
setPhpMetadataNamespace(string $var)
Use this option to change the namespace of php generated metadata classes.
Default is empty. When this option is empty, the proto file name will be used for determining the namespace.
Generated from protobuf field optional string php_metadata_namespace = 44;
string
getRubyPackage()
Use this option to change the package of ruby generated classes. Default is empty. When this option is not set, the package name will be used for determining the ruby package.
Generated from protobuf field optional string ruby_package = 45;
hasRubyPackage()
No description
clearRubyPackage()
No description
$this
setRubyPackage(string $var)
Use this option to change the package of ruby generated classes. Default is empty. When this option is not set, the package name will be used for determining the ruby package.
Generated from protobuf field optional string ruby_package = 45;
RepeatedField
getUninterpretedOption()
The parser stores options it doesn't recognize here.
See the documentation for the "Options" section above.
Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
$this
setUninterpretedOption(UninterpretedOption[]|RepeatedField $var)
The parser stores options it doesn't recognize here.
See the documentation for the "Options" section above.
Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;