Class DescriptorProtos.SourceCodeInfo.Location (3.19.4)

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

Protobuf type google.protobuf.SourceCodeInfo.Location

Inheritance

Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > DescriptorProtos.SourceCodeInfo.Location

Static Fields

LEADING_COMMENTS_FIELD_NUMBER

public static final int LEADING_COMMENTS_FIELD_NUMBER
Field Value
Type Description
int

LEADING_DETACHED_COMMENTS_FIELD_NUMBER

public static final int LEADING_DETACHED_COMMENTS_FIELD_NUMBER
Field Value
Type Description
int

PARSER

public static final Parser<DescriptorProtos.SourceCodeInfo.Location> PARSER
Field Value
Type Description
Parser<Location>

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

TRAILING_COMMENTS_FIELD_NUMBER

public static final int TRAILING_COMMENTS_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static DescriptorProtos.SourceCodeInfo.Location getDefaultInstance()
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptors.Descriptor

newBuilder()

public static DescriptorProtos.SourceCodeInfo.Location.Builder newBuilder()
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder

newBuilder(DescriptorProtos.SourceCodeInfo.Location prototype)

public static DescriptorProtos.SourceCodeInfo.Location.Builder newBuilder(DescriptorProtos.SourceCodeInfo.Location prototype)
Parameter
Name Description
prototype DescriptorProtos.SourceCodeInfo.Location
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder

parseDelimitedFrom(InputStream input)

public static DescriptorProtos.SourceCodeInfo.Location parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.SourceCodeInfo.Location parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<DescriptorProtos.SourceCodeInfo.Location> parser()
Returns
Type Description
Parser<Location>

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

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.

getParserForType()

public Parser<DescriptorProtos.SourceCodeInfo.Location> getParserForType()
Returns
Type Description
Parser<Location>
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.

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.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()

Get the UnknownFieldSet for this message.

Returns
Type Description
UnknownFieldSet
Overrides

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.

hashCode()

public int 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.

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

newBuilderForType()

public DescriptorProtos.SourceCodeInfo.Location.Builder newBuilderForType()
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected DescriptorProtos.SourceCodeInfo.Location.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)

TODO(xiaofeng): remove this together with GeneratedMessageV3.BuilderParent.

Parameter
Name Description
parent GeneratedMessageV3.BuilderParent
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

Creates a new instance of this message type. Overridden in the generated code.

Parameter
Name Description
unused GeneratedMessageV3.UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public DescriptorProtos.SourceCodeInfo.Location.Builder toBuilder()
Returns
Type Description
DescriptorProtos.SourceCodeInfo.Location.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)

Serializes the message and writes it to output. This does not flush or close the stream.

Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException