public static final class DescriptorProtos.SourceCodeInfo.Location extends GeneratedMessageV3 implements DescriptorProtos.SourceCodeInfo.LocationOrBuilder
Protobuf type google.protobuf.SourceCodeInfo.Location
Static Fields
public static final int LEADING_COMMENTS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
public static final int LEADING_DETACHED_COMMENTS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
PARSER
public static final Parser<DescriptorProtos.SourceCodeInfo.Location> PARSER
PATH_FIELD_NUMBER
public static final int PATH_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
SPAN_FIELD_NUMBER
public static final int SPAN_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
public static final int TRAILING_COMMENTS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
Static Methods
getDefaultInstance()
public static DescriptorProtos.SourceCodeInfo.Location getDefaultInstance()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static DescriptorProtos.SourceCodeInfo.Location.Builder newBuilder()
newBuilder(DescriptorProtos.SourceCodeInfo.Location prototype)
public static DescriptorProtos.SourceCodeInfo.Location.Builder newBuilder(DescriptorProtos.SourceCodeInfo.Location prototype)
public static DescriptorProtos.SourceCodeInfo.Location parseDelimitedFrom(InputStream input)
public static DescriptorProtos.SourceCodeInfo.Location parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static DescriptorProtos.SourceCodeInfo.Location parseFrom(byte[] data)
Parameter |
Name |
Description |
data |
byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static DescriptorProtos.SourceCodeInfo.Location parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static DescriptorProtos.SourceCodeInfo.Location parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static DescriptorProtos.SourceCodeInfo.Location parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static DescriptorProtos.SourceCodeInfo.Location parseFrom(CodedInputStream input)
public static DescriptorProtos.SourceCodeInfo.Location parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static DescriptorProtos.SourceCodeInfo.Location parseFrom(InputStream input)
public static DescriptorProtos.SourceCodeInfo.Location parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static DescriptorProtos.SourceCodeInfo.Location parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static DescriptorProtos.SourceCodeInfo.Location parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<DescriptorProtos.SourceCodeInfo.Location> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Compares the specified object with this message for equality. Returns true
if the given
object is a message of the same type (as defined by getDescriptorForType()
) and has
identical values for all of its fields. Subclasses must implement this; inheriting
Object.equals()
is incorrect.
Parameter |
Name |
Description |
obj |
Object
|
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.
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.
|
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.
|
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.
|
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.
|
public int getLeadingDetachedCommentsCount()
repeated string leading_detached_comments = 6;
Returns |
Type |
Description |
int |
The count of leadingDetachedComments.
|
public ProtocolStringList getLeadingDetachedCommentsList()
repeated string leading_detached_comments = 6;
Returns |
Type |
Description |
ProtocolStringList |
A list containing the leadingDetachedComments.
|
getParserForType()
public Parser<DescriptorProtos.SourceCodeInfo.Location> getParserForType()
Overrides
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.
|
getSerializedSize()
public int getSerializedSize()
Get the number of bytes required to encode this message. The result is only computed on the
first call and memoized after that.
If this message requires more than Integer.MAX_VALUE bytes to encode, the return value will
be smaller than the actual number of bytes required and might be negative.
Returns |
Type |
Description |
int |
|
Overrides
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.
|
public String getTrailingComments()
optional string trailing_comments = 4;
Returns |
Type |
Description |
String |
The trailingComments.
|
public ByteString getTrailingCommentsBytes()
optional string trailing_comments = 4;
Returns |
Type |
Description |
ByteString |
The bytes for trailingComments.
|
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Overrides
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.
|
public boolean hasTrailingComments()
optional string trailing_comments = 4;
Returns |
Type |
Description |
boolean |
Whether the trailingComments field is set.
|
hashCode()
Returns the hash code value for this message. The hash code of a message should mix the
message's type (object identity of the descriptor) with its contents (known and unknown field
values). Subclasses must implement this; inheriting Object.hashCode()
is incorrect.
Returns |
Type |
Description |
int |
|
Overrides
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.
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public DescriptorProtos.SourceCodeInfo.Location.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected DescriptorProtos.SourceCodeInfo.Location.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
TODO(xiaofeng): remove this together with GeneratedMessageV3.BuilderParent.
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Creates a new instance of this message type. Overridden in the generated code.
Returns |
Type |
Description |
Object |
|
Overrides
toBuilder()
public DescriptorProtos.SourceCodeInfo.Location.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Serializes the message and writes it to output
. This does not flush or close the
stream.
Overrides