public class SourceCodeInfoParser extends Object
In order to make this work, the descriptors need to be produced using the flag --include_source_info. Note that descriptors taken from the generated java code have source info
stripped, and won't work with this class.
This class uses internal caches to speed up access to the source info. It is not thread safe. If you think you need this functionality in a thread-safe context, feel free to suggest a refactor.
| Constructor and Description |
|---|
SourceCodeInfoParser() |
| Modifier and Type | Method and Description |
|---|---|
SourceCodeInfoLocation |
getLocation(com.google.protobuf.Descriptors.Descriptor message)
Gets the location of a message, if available.
|
SourceCodeInfoLocation |
getLocation(com.google.protobuf.Descriptors.EnumDescriptor enumType)
Gets the location of an enum type, if available.
|
SourceCodeInfoLocation |
getLocation(com.google.protobuf.Descriptors.EnumValueDescriptor enumValue)
Gets the location of an enum value, if available.
|
SourceCodeInfoLocation |
getLocation(com.google.protobuf.Descriptors.FieldDescriptor field)
Gets the location of a field, if available.
|
SourceCodeInfoLocation |
getLocation(com.google.protobuf.Descriptors.MethodDescriptor method)
Gets the location of a method, if available.
|
SourceCodeInfoLocation |
getLocation(com.google.protobuf.Descriptors.OneofDescriptor oneof)
Gets the location of a oneof, if available.
|
SourceCodeInfoLocation |
getLocation(com.google.protobuf.Descriptors.ServiceDescriptor service)
Gets the location of a service, if available.
|
@Nullable public SourceCodeInfoLocation getLocation(com.google.protobuf.Descriptors.Descriptor message)
@Nullable public SourceCodeInfoLocation getLocation(com.google.protobuf.Descriptors.FieldDescriptor field)
@Nullable public SourceCodeInfoLocation getLocation(com.google.protobuf.Descriptors.ServiceDescriptor service)
@Nullable public SourceCodeInfoLocation getLocation(com.google.protobuf.Descriptors.MethodDescriptor method)
@Nullable public SourceCodeInfoLocation getLocation(com.google.protobuf.Descriptors.EnumDescriptor enumType)
@Nullable public SourceCodeInfoLocation getLocation(com.google.protobuf.Descriptors.EnumValueDescriptor enumValue)
@Nullable public SourceCodeInfoLocation getLocation(com.google.protobuf.Descriptors.OneofDescriptor oneof)
Copyright © 2022 Google LLC. All rights reserved.