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
Type Description
Descriptors.Descriptor

Methods

addAllLeadingDetachedComments(Iterable<String> values)

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

repeated string leading_detached_comments = 6;

Parameter
Name Description
values Iterable<String>

The leadingDetachedComments to add.

Returns
Type Description
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
Name Description
values Iterable<? extends java.lang.Integer>

The path to add.

Returns
Type Description
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
Name Description
values Iterable<? extends java.lang.Integer>

The span to add.

Returns
Type Description
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
Name Description
value String

The leadingDetachedComments to add.

Returns
Type Description
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
Name Description
value ByteString

The bytes of the leadingDetachedComments to add.

Returns
Type Description
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
Name Description
value int

The path to add.

Returns
Type Description
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
Name Description
field Descriptors.FieldDescriptor
value Object
Returns
Type Description
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
Name Description
value int

The span to add.

Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

build()

public DescriptorProtos.SourceCodeInfo.Location build()
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location

buildPartial()

public DescriptorProtos.SourceCodeInfo.Location buildPartial()
Returns
Type Description
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
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public DescriptorProtos.SourceCodeInfo.Location.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field Descriptors.FieldDescriptor
Returns
Type Description
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
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

clearLeadingDetachedComments()

public DescriptorProtos.SourceCodeInfo.Location.Builder clearLeadingDetachedComments()

repeated string leading_detached_comments = 6;

Returns
Type Description
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
Name Description
oneof Descriptors.OneofDescriptor
Returns
Type Description
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
Type Description
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
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

clearTrailingComments()

public DescriptorProtos.SourceCodeInfo.Location.Builder clearTrailingComments()

optional string trailing_comments = 4;

Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

clone()

public DescriptorProtos.SourceCodeInfo.Location.Builder clone()

Clones the Builder.

Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
ByteString

The bytes for leadingComments.

getLeadingDetachedComments(int index)

public String getLeadingDetachedComments(int index)

repeated string leading_detached_comments = 6;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The leadingDetachedComments at the given index.

getLeadingDetachedCommentsBytes(int index)

public ByteString getLeadingDetachedCommentsBytes(int index)

repeated string leading_detached_comments = 6;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the leadingDetachedComments at the given index.

getLeadingDetachedCommentsCount()

public int getLeadingDetachedCommentsCount()

repeated string leading_detached_comments = 6;

Returns
Type Description
int

The count of leadingDetachedComments.

getLeadingDetachedCommentsList()

public ProtocolStringList getLeadingDetachedCommentsList()

repeated string leading_detached_comments = 6;

Returns
Type Description
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
Name Description
index int

The index of the element to return.

Returns
Type Description
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
Type Description
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
Type Description
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
Name Description
index int

The index of the element to return.

Returns
Type Description
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
Type Description
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
Type Description
List<Integer>

A list containing the span.

getTrailingComments()

public String getTrailingComments()

optional string trailing_comments = 4;

Returns
Type Description
String

The trailingComments.

getTrailingCommentsBytes()

public ByteString getTrailingCommentsBytes()

optional string trailing_comments = 4;

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

Whether the leadingComments field is set.

hasTrailingComments()

public boolean hasTrailingComments()

optional string trailing_comments = 4;

Returns
Type Description
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
Type Description
GeneratedMessageV3.FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()

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

See also: MessageOrBuilder#getInitializationErrorString()

Returns
Type Description
boolean
Overrides

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
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(DescriptorProtos.SourceCodeInfo.Location other)

public DescriptorProtos.SourceCodeInfo.Location.Builder mergeFrom(DescriptorProtos.SourceCodeInfo.Location other)
Parameter
Name Description
other DescriptorProtos.SourceCodeInfo.Location
Returns
Type Description
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
Name Description
other Message
Returns
Type Description
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
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public DescriptorProtos.SourceCodeInfo.Location.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field Descriptors.FieldDescriptor
value Object
Returns
Type Description
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
Name Description
value String

The leadingComments to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for leadingComments to set.

Returns
Type Description
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
Name Description
index int

The index to set the value at.

value String

The leadingDetachedComments to set.

Returns
Type Description
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
Name Description
index int

The index to set the value at.

value int

The path to set.

Returns
Type Description
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
Name Description
field Descriptors.FieldDescriptor
index int
value Object
Returns
Type Description
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
Name Description
index int

The index to set the value at.

value int

The span to set.

Returns
Type Description
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
Name Description
value String

The trailingComments to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for trailingComments to set.

Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final DescriptorProtos.SourceCodeInfo.Location.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides