Class DescriptorProtos.SourceCodeInfo.Location.Builder (3.19.4)

public static final class DescriptorProtos.SourceCodeInfo.Location.Builder extends GeneratedMessageV3.Builder<DescriptorProtos.SourceCodeInfo.Location.Builder> implements DescriptorProtos.SourceCodeInfo.LocationOrBuilder

Protobuf type google.protobuf.SourceCodeInfo.Location

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptors.Descriptor

Methods

addAllLeadingDetachedComments(Iterable<String> values)

public DescriptorProtos.SourceCodeInfo.Location.Builder addAllLeadingDetachedComments(Iterable<String> values)

repeated string leading_detached_comments = 6;

Parameter
NameDescription
valuesIterable<String>

The leadingDetachedComments to add.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

addAllPath(Iterable<? extends Integer> values)

public DescriptorProtos.SourceCodeInfo.Location.Builder addAllPath(Iterable<? extends Integer> values)

Identifies which part of the FileDescriptorProto was defined at this location. Each element is a field number or an index. They form a path from the root FileDescriptorProto to the place where the definition. For example, this path: [ 4, 3, 2, 7, 1 ] refers to: file.message_type(3) // 4, 3 .field(7) // 2, 7 .name() // 1 This is because FileDescriptorProto.message_type has field number 4: repeated DescriptorProto message_type = 4; and DescriptorProto.field has field number 2: repeated FieldDescriptorProto field = 2; and FieldDescriptorProto.name has field number 1: optional string name = 1; Thus, the above path gives the location of a field name. If we removed the last element: [ 4, 3, 2, 7 ] this path refers to the whole field declaration (from the beginning of the label to the terminating semicolon).

repeated int32 path = 1 [packed = true];

Parameter
NameDescription
valuesIterable<? extends java.lang.Integer>

The path to add.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

addAllSpan(Iterable<? extends Integer> values)

public DescriptorProtos.SourceCodeInfo.Location.Builder addAllSpan(Iterable<? extends Integer> values)

Always has exactly three or four elements: start line, start column, end line (optional, otherwise assumed same as start line), end column. These are packed into a single field for efficiency. Note that line and column numbers are zero-based -- typically you will want to add 1 to each before displaying to a user.

repeated int32 span = 2 [packed = true];

Parameter
NameDescription
valuesIterable<? extends java.lang.Integer>

The span to add.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

addLeadingDetachedComments(String value)

public DescriptorProtos.SourceCodeInfo.Location.Builder addLeadingDetachedComments(String value)

repeated string leading_detached_comments = 6;

Parameter
NameDescription
valueString

The leadingDetachedComments to add.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

addLeadingDetachedCommentsBytes(ByteString value)

public DescriptorProtos.SourceCodeInfo.Location.Builder addLeadingDetachedCommentsBytes(ByteString value)

repeated string leading_detached_comments = 6;

Parameter
NameDescription
valueByteString

The bytes of the leadingDetachedComments to add.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

addPath(int value)

public DescriptorProtos.SourceCodeInfo.Location.Builder addPath(int value)

Identifies which part of the FileDescriptorProto was defined at this location. Each element is a field number or an index. They form a path from the root FileDescriptorProto to the place where the definition. For example, this path: [ 4, 3, 2, 7, 1 ] refers to: file.message_type(3) // 4, 3 .field(7) // 2, 7 .name() // 1 This is because FileDescriptorProto.message_type has field number 4: repeated DescriptorProto message_type = 4; and DescriptorProto.field has field number 2: repeated FieldDescriptorProto field = 2; and FieldDescriptorProto.name has field number 1: optional string name = 1; Thus, the above path gives the location of a field name. If we removed the last element: [ 4, 3, 2, 7 ] this path refers to the whole field declaration (from the beginning of the label to the terminating semicolon).

repeated int32 path = 1 [packed = true];

Parameter
NameDescription
valueint

The path to add.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public DescriptorProtos.SourceCodeInfo.Location.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
valueObject
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides

addSpan(int value)

public DescriptorProtos.SourceCodeInfo.Location.Builder addSpan(int value)

Always has exactly three or four elements: start line, start column, end line (optional, otherwise assumed same as start line), end column. These are packed into a single field for efficiency. Note that line and column numbers are zero-based -- typically you will want to add 1 to each before displaying to a user.

repeated int32 span = 2 [packed = true];

Parameter
NameDescription
valueint

The span to add.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

build()

public DescriptorProtos.SourceCodeInfo.Location build()
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location

buildPartial()

public DescriptorProtos.SourceCodeInfo.Location buildPartial()
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location

clear()

public DescriptorProtos.SourceCodeInfo.Location.Builder clear()

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

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public DescriptorProtos.SourceCodeInfo.Location.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldDescriptors.FieldDescriptor
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides

clearLeadingComments()

public DescriptorProtos.SourceCodeInfo.Location.Builder clearLeadingComments()

If this SourceCodeInfo represents a complete declaration, these are any comments appearing before and after the declaration which appear to be attached to the declaration. A series of line comments appearing on consecutive lines, with no other tokens appearing on those lines, will be treated as a single comment. leading_detached_comments will keep paragraphs of comments that appear before (but not connected to) the current element. Each paragraph, separated by empty lines, will be one comment element in the repeated field. Only the comment content is provided; comment markers (e.g. //) are stripped out. For block comments, leading whitespace and an asterisk will be stripped from the beginning of each line other than the first. Newlines are included in the output. Examples: optional int32 foo = 1; // Comment attached to foo. // Comment attached to bar. optional int32 bar = 2; optional string baz = 3; // Comment attached to baz. // Another line attached to baz. // Comment attached to qux. // // Another line attached to qux. optional double qux = 4; // Detached comment for corge. This is not leading or trailing comments // to qux or corge because there are blank lines separating it from // both. // Detached comment for corge paragraph 2. optional string corge = 5; /* Block comment attached

  • to corge. Leading asterisks
  • will be removed. */ /* Block comment attached to
  • grault. */ optional int32 grault = 6; // ignored detached comments.

optional string leading_comments = 3;

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

clearLeadingDetachedComments()

public DescriptorProtos.SourceCodeInfo.Location.Builder clearLeadingDetachedComments()

repeated string leading_detached_comments = 6;

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public DescriptorProtos.SourceCodeInfo.Location.Builder clearOneof(Descriptors.OneofDescriptor oneof)

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

Parameter
NameDescription
oneofDescriptors.OneofDescriptor
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides

clearPath()

public DescriptorProtos.SourceCodeInfo.Location.Builder clearPath()

Identifies which part of the FileDescriptorProto was defined at this location. Each element is a field number or an index. They form a path from the root FileDescriptorProto to the place where the definition. For example, this path: [ 4, 3, 2, 7, 1 ] refers to: file.message_type(3) // 4, 3 .field(7) // 2, 7 .name() // 1 This is because FileDescriptorProto.message_type has field number 4: repeated DescriptorProto message_type = 4; and DescriptorProto.field has field number 2: repeated FieldDescriptorProto field = 2; and FieldDescriptorProto.name has field number 1: optional string name = 1; Thus, the above path gives the location of a field name. If we removed the last element: [ 4, 3, 2, 7 ] this path refers to the whole field declaration (from the beginning of the label to the terminating semicolon).

repeated int32 path = 1 [packed = true];

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

clearSpan()

public DescriptorProtos.SourceCodeInfo.Location.Builder clearSpan()

Always has exactly three or four elements: start line, start column, end line (optional, otherwise assumed same as start line), end column. These are packed into a single field for efficiency. Note that line and column numbers are zero-based -- typically you will want to add 1 to each before displaying to a user.

repeated int32 span = 2 [packed = true];

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

clearTrailingComments()

public DescriptorProtos.SourceCodeInfo.Location.Builder clearTrailingComments()

optional string trailing_comments = 4;

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

clone()

public DescriptorProtos.SourceCodeInfo.Location.Builder clone()

Clones the Builder.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides

getDefaultInstanceForType()

public DescriptorProtos.SourceCodeInfo.Location 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
TypeDescription
DescriptorProtos.SourceCodeInfo.Location

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()

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
TypeDescription
Descriptors.Descriptor
Overrides

getLeadingComments()

public String getLeadingComments()

If this SourceCodeInfo represents a complete declaration, these are any comments appearing before and after the declaration which appear to be attached to the declaration. A series of line comments appearing on consecutive lines, with no other tokens appearing on those lines, will be treated as a single comment. leading_detached_comments will keep paragraphs of comments that appear before (but not connected to) the current element. Each paragraph, separated by empty lines, will be one comment element in the repeated field. Only the comment content is provided; comment markers (e.g. //) are stripped out. For block comments, leading whitespace and an asterisk will be stripped from the beginning of each line other than the first. Newlines are included in the output. Examples: optional int32 foo = 1; // Comment attached to foo. // Comment attached to bar. optional int32 bar = 2; optional string baz = 3; // Comment attached to baz. // Another line attached to baz. // Comment attached to qux. // // Another line attached to qux. optional double qux = 4; // Detached comment for corge. This is not leading or trailing comments // to qux or corge because there are blank lines separating it from // both. // Detached comment for corge paragraph 2. optional string corge = 5; /* Block comment attached

  • to corge. Leading asterisks
  • will be removed. */ /* Block comment attached to
  • grault. */ optional int32 grault = 6; // ignored detached comments.

optional string leading_comments = 3;

Returns
TypeDescription
String

The leadingComments.

getLeadingCommentsBytes()

public ByteString getLeadingCommentsBytes()

If this SourceCodeInfo represents a complete declaration, these are any comments appearing before and after the declaration which appear to be attached to the declaration. A series of line comments appearing on consecutive lines, with no other tokens appearing on those lines, will be treated as a single comment. leading_detached_comments will keep paragraphs of comments that appear before (but not connected to) the current element. Each paragraph, separated by empty lines, will be one comment element in the repeated field. Only the comment content is provided; comment markers (e.g. //) are stripped out. For block comments, leading whitespace and an asterisk will be stripped from the beginning of each line other than the first. Newlines are included in the output. Examples: optional int32 foo = 1; // Comment attached to foo. // Comment attached to bar. optional int32 bar = 2; optional string baz = 3; // Comment attached to baz. // Another line attached to baz. // Comment attached to qux. // // Another line attached to qux. optional double qux = 4; // Detached comment for corge. This is not leading or trailing comments // to qux or corge because there are blank lines separating it from // both. // Detached comment for corge paragraph 2. optional string corge = 5; /* Block comment attached

  • to corge. Leading asterisks
  • will be removed. */ /* Block comment attached to
  • grault. */ optional int32 grault = 6; // ignored detached comments.

optional string leading_comments = 3;

Returns
TypeDescription
ByteString

The bytes for leadingComments.

getLeadingDetachedComments(int index)

public String getLeadingDetachedComments(int index)

repeated string leading_detached_comments = 6;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The leadingDetachedComments at the given index.

getLeadingDetachedCommentsBytes(int index)

public ByteString getLeadingDetachedCommentsBytes(int index)

repeated string leading_detached_comments = 6;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the leadingDetachedComments at the given index.

getLeadingDetachedCommentsCount()

public int getLeadingDetachedCommentsCount()

repeated string leading_detached_comments = 6;

Returns
TypeDescription
int

The count of leadingDetachedComments.

getLeadingDetachedCommentsList()

public ProtocolStringList getLeadingDetachedCommentsList()

repeated string leading_detached_comments = 6;

Returns
TypeDescription
ProtocolStringList

A list containing the leadingDetachedComments.

getPath(int index)

public int getPath(int index)

Identifies which part of the FileDescriptorProto was defined at this location. Each element is a field number or an index. They form a path from the root FileDescriptorProto to the place where the definition. For example, this path: [ 4, 3, 2, 7, 1 ] refers to: file.message_type(3) // 4, 3 .field(7) // 2, 7 .name() // 1 This is because FileDescriptorProto.message_type has field number 4: repeated DescriptorProto message_type = 4; and DescriptorProto.field has field number 2: repeated FieldDescriptorProto field = 2; and FieldDescriptorProto.name has field number 1: optional string name = 1; Thus, the above path gives the location of a field name. If we removed the last element: [ 4, 3, 2, 7 ] this path refers to the whole field declaration (from the beginning of the label to the terminating semicolon).

repeated int32 path = 1 [packed = true];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
int

The path at the given index.

getPathCount()

public int getPathCount()

Identifies which part of the FileDescriptorProto was defined at this location. Each element is a field number or an index. They form a path from the root FileDescriptorProto to the place where the definition. For example, this path: [ 4, 3, 2, 7, 1 ] refers to: file.message_type(3) // 4, 3 .field(7) // 2, 7 .name() // 1 This is because FileDescriptorProto.message_type has field number 4: repeated DescriptorProto message_type = 4; and DescriptorProto.field has field number 2: repeated FieldDescriptorProto field = 2; and FieldDescriptorProto.name has field number 1: optional string name = 1; Thus, the above path gives the location of a field name. If we removed the last element: [ 4, 3, 2, 7 ] this path refers to the whole field declaration (from the beginning of the label to the terminating semicolon).

repeated int32 path = 1 [packed = true];

Returns
TypeDescription
int

The count of path.

getPathList()

public List<Integer> getPathList()

Identifies which part of the FileDescriptorProto was defined at this location. Each element is a field number or an index. They form a path from the root FileDescriptorProto to the place where the definition. For example, this path: [ 4, 3, 2, 7, 1 ] refers to: file.message_type(3) // 4, 3 .field(7) // 2, 7 .name() // 1 This is because FileDescriptorProto.message_type has field number 4: repeated DescriptorProto message_type = 4; and DescriptorProto.field has field number 2: repeated FieldDescriptorProto field = 2; and FieldDescriptorProto.name has field number 1: optional string name = 1; Thus, the above path gives the location of a field name. If we removed the last element: [ 4, 3, 2, 7 ] this path refers to the whole field declaration (from the beginning of the label to the terminating semicolon).

repeated int32 path = 1 [packed = true];

Returns
TypeDescription
List<Integer>

A list containing the path.

getSpan(int index)

public int getSpan(int index)

Always has exactly three or four elements: start line, start column, end line (optional, otherwise assumed same as start line), end column. These are packed into a single field for efficiency. Note that line and column numbers are zero-based -- typically you will want to add 1 to each before displaying to a user.

repeated int32 span = 2 [packed = true];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
int

The span at the given index.

getSpanCount()

public int getSpanCount()

Always has exactly three or four elements: start line, start column, end line (optional, otherwise assumed same as start line), end column. These are packed into a single field for efficiency. Note that line and column numbers are zero-based -- typically you will want to add 1 to each before displaying to a user.

repeated int32 span = 2 [packed = true];

Returns
TypeDescription
int

The count of span.

getSpanList()

public List<Integer> getSpanList()

Always has exactly three or four elements: start line, start column, end line (optional, otherwise assumed same as start line), end column. These are packed into a single field for efficiency. Note that line and column numbers are zero-based -- typically you will want to add 1 to each before displaying to a user.

repeated int32 span = 2 [packed = true];

Returns
TypeDescription
List<Integer>

A list containing the span.

getTrailingComments()

public String getTrailingComments()

optional string trailing_comments = 4;

Returns
TypeDescription
String

The trailingComments.

getTrailingCommentsBytes()

public ByteString getTrailingCommentsBytes()

optional string trailing_comments = 4;

Returns
TypeDescription
ByteString

The bytes for trailingComments.

hasLeadingComments()

public boolean hasLeadingComments()

If this SourceCodeInfo represents a complete declaration, these are any comments appearing before and after the declaration which appear to be attached to the declaration. A series of line comments appearing on consecutive lines, with no other tokens appearing on those lines, will be treated as a single comment. leading_detached_comments will keep paragraphs of comments that appear before (but not connected to) the current element. Each paragraph, separated by empty lines, will be one comment element in the repeated field. Only the comment content is provided; comment markers (e.g. //) are stripped out. For block comments, leading whitespace and an asterisk will be stripped from the beginning of each line other than the first. Newlines are included in the output. Examples: optional int32 foo = 1; // Comment attached to foo. // Comment attached to bar. optional int32 bar = 2; optional string baz = 3; // Comment attached to baz. // Another line attached to baz. // Comment attached to qux. // // Another line attached to qux. optional double qux = 4; // Detached comment for corge. This is not leading or trailing comments // to qux or corge because there are blank lines separating it from // both. // Detached comment for corge paragraph 2. optional string corge = 5; /* Block comment attached

  • to corge. Leading asterisks
  • will be removed. */ /* Block comment attached to
  • grault. */ optional int32 grault = 6; // ignored detached comments.

optional string leading_comments = 3;

Returns
TypeDescription
boolean

Whether the leadingComments field is set.

hasTrailingComments()

public boolean hasTrailingComments()

optional string trailing_comments = 4;

Returns
TypeDescription
boolean

Whether the trailingComments field is set.

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
TypeDescription
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
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public DescriptorProtos.SourceCodeInfo.Location.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(DescriptorProtos.SourceCodeInfo.Location other)

public DescriptorProtos.SourceCodeInfo.Location.Builder mergeFrom(DescriptorProtos.SourceCodeInfo.Location other)
Parameter
NameDescription
otherDescriptorProtos.SourceCodeInfo.Location
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

mergeFrom(Message other)

public DescriptorProtos.SourceCodeInfo.Location.Builder mergeFrom(Message other)

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
NameDescription
otherMessage
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final DescriptorProtos.SourceCodeInfo.Location.Builder mergeUnknownFields(UnknownFieldSet unknownFields)

Merge some unknown fields into the UnknownFieldSet for this message.

Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public DescriptorProtos.SourceCodeInfo.Location.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
valueObject
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides

setLeadingComments(String value)

public DescriptorProtos.SourceCodeInfo.Location.Builder setLeadingComments(String value)

If this SourceCodeInfo represents a complete declaration, these are any comments appearing before and after the declaration which appear to be attached to the declaration. A series of line comments appearing on consecutive lines, with no other tokens appearing on those lines, will be treated as a single comment. leading_detached_comments will keep paragraphs of comments that appear before (but not connected to) the current element. Each paragraph, separated by empty lines, will be one comment element in the repeated field. Only the comment content is provided; comment markers (e.g. //) are stripped out. For block comments, leading whitespace and an asterisk will be stripped from the beginning of each line other than the first. Newlines are included in the output. Examples: optional int32 foo = 1; // Comment attached to foo. // Comment attached to bar. optional int32 bar = 2; optional string baz = 3; // Comment attached to baz. // Another line attached to baz. // Comment attached to qux. // // Another line attached to qux. optional double qux = 4; // Detached comment for corge. This is not leading or trailing comments // to qux or corge because there are blank lines separating it from // both. // Detached comment for corge paragraph 2. optional string corge = 5; /* Block comment attached

  • to corge. Leading asterisks
  • will be removed. */ /* Block comment attached to
  • grault. */ optional int32 grault = 6; // ignored detached comments.

optional string leading_comments = 3;

Parameter
NameDescription
valueString

The leadingComments to set.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

setLeadingCommentsBytes(ByteString value)

public DescriptorProtos.SourceCodeInfo.Location.Builder setLeadingCommentsBytes(ByteString value)

If this SourceCodeInfo represents a complete declaration, these are any comments appearing before and after the declaration which appear to be attached to the declaration. A series of line comments appearing on consecutive lines, with no other tokens appearing on those lines, will be treated as a single comment. leading_detached_comments will keep paragraphs of comments that appear before (but not connected to) the current element. Each paragraph, separated by empty lines, will be one comment element in the repeated field. Only the comment content is provided; comment markers (e.g. //) are stripped out. For block comments, leading whitespace and an asterisk will be stripped from the beginning of each line other than the first. Newlines are included in the output. Examples: optional int32 foo = 1; // Comment attached to foo. // Comment attached to bar. optional int32 bar = 2; optional string baz = 3; // Comment attached to baz. // Another line attached to baz. // Comment attached to qux. // // Another line attached to qux. optional double qux = 4; // Detached comment for corge. This is not leading or trailing comments // to qux or corge because there are blank lines separating it from // both. // Detached comment for corge paragraph 2. optional string corge = 5; /* Block comment attached

  • to corge. Leading asterisks
  • will be removed. */ /* Block comment attached to
  • grault. */ optional int32 grault = 6; // ignored detached comments.

optional string leading_comments = 3;

Parameter
NameDescription
valueByteString

The bytes for leadingComments to set.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

setLeadingDetachedComments(int index, String value)

public DescriptorProtos.SourceCodeInfo.Location.Builder setLeadingDetachedComments(int index, String value)

repeated string leading_detached_comments = 6;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The leadingDetachedComments to set.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

setPath(int index, int value)

public DescriptorProtos.SourceCodeInfo.Location.Builder setPath(int index, int value)

Identifies which part of the FileDescriptorProto was defined at this location. Each element is a field number or an index. They form a path from the root FileDescriptorProto to the place where the definition. For example, this path: [ 4, 3, 2, 7, 1 ] refers to: file.message_type(3) // 4, 3 .field(7) // 2, 7 .name() // 1 This is because FileDescriptorProto.message_type has field number 4: repeated DescriptorProto message_type = 4; and DescriptorProto.field has field number 2: repeated FieldDescriptorProto field = 2; and FieldDescriptorProto.name has field number 1: optional string name = 1; Thus, the above path gives the location of a field name. If we removed the last element: [ 4, 3, 2, 7 ] this path refers to the whole field declaration (from the beginning of the label to the terminating semicolon).

repeated int32 path = 1 [packed = true];

Parameters
NameDescription
indexint

The index to set the value at.

valueint

The path to set.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

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

public DescriptorProtos.SourceCodeInfo.Location.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
indexint
valueObject
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides

setSpan(int index, int value)

public DescriptorProtos.SourceCodeInfo.Location.Builder setSpan(int index, int value)

Always has exactly three or four elements: start line, start column, end line (optional, otherwise assumed same as start line), end column. These are packed into a single field for efficiency. Note that line and column numbers are zero-based -- typically you will want to add 1 to each before displaying to a user.

repeated int32 span = 2 [packed = true];

Parameters
NameDescription
indexint

The index to set the value at.

valueint

The span to set.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

setTrailingComments(String value)

public DescriptorProtos.SourceCodeInfo.Location.Builder setTrailingComments(String value)

optional string trailing_comments = 4;

Parameter
NameDescription
valueString

The trailingComments to set.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

setTrailingCommentsBytes(ByteString value)

public DescriptorProtos.SourceCodeInfo.Location.Builder setTrailingCommentsBytes(ByteString value)

optional string trailing_comments = 4;

Parameter
NameDescription
valueByteString

The bytes for trailingComments to set.

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final DescriptorProtos.SourceCodeInfo.Location.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides