Class DescriptorProtos.SourceCodeInfo.Location

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
TypeDescription
int

LEADING_DETACHED_COMMENTS_FIELD_NUMBER

public static final int LEADING_DETACHED_COMMENTS_FIELD_NUMBER
Field Value
TypeDescription
int

PARSER

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

PATH_FIELD_NUMBER

public static final int PATH_FIELD_NUMBER
Field Value
TypeDescription
int

SPAN_FIELD_NUMBER

public static final int SPAN_FIELD_NUMBER
Field Value
TypeDescription
int

TRAILING_COMMENTS_FIELD_NUMBER

public static final int TRAILING_COMMENTS_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static DescriptorProtos.SourceCodeInfo.Location getDefaultInstance()
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location

getDescriptor()

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

newBuilder()

public static DescriptorProtos.SourceCodeInfo.Location.Builder newBuilder()
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

newBuilder(DescriptorProtos.SourceCodeInfo.Location prototype)

public static DescriptorProtos.SourceCodeInfo.Location.Builder newBuilder(DescriptorProtos.SourceCodeInfo.Location prototype)
Parameter
NameDescription
prototypeDescriptorProtos.SourceCodeInfo.Location
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location.Builder

parseDelimitedFrom(InputStream input)

public static DescriptorProtos.SourceCodeInfo.Location parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.SourceCodeInfo.Location parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.SourceCodeInfo.Location parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.SourceCodeInfo.Location
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<DescriptorProtos.SourceCodeInfo.Location> parser()
Returns
TypeDescription
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
NameDescription
objObject
Returns
TypeDescription
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
TypeDescription
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
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.

getParserForType()

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

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
TypeDescription
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
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.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()

Get the UnknownFieldSet for this message.

Returns
TypeDescription
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
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.

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

newBuilderForType()

public DescriptorProtos.SourceCodeInfo.Location.Builder newBuilderForType()
Returns
TypeDescription
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
NameDescription
parentGeneratedMessageV3.BuilderParent
Returns
TypeDescription
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
NameDescription
unusedGeneratedMessageV3.UnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public DescriptorProtos.SourceCodeInfo.Location.Builder toBuilder()
Returns
TypeDescription
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
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException