public class CommentReferenceResolver
extends java.lang.Object
Markdown comments in proto files could contain references to other proto elements. These references could be relative meaning that user doesn't have to specify the full name to address an element. An example of such reference in markdown syntax is:
package protiary. test . comment_refs;
message Foo {
optional string field;
}
// display text relative name
// [field of Foo][Foo.field]
message Bar {
}
As can be seen in the above example the reference to field of Foo is relative without having to specify the full name of the package containing Foo.
This class will act as one of the processors in documentation aspect and will be run before other processors. It will replace all the relative names with their respective resolved full name in the comment. In case where it cannot make a resolution, it will not change or replace the text.
| Modifier and Type | Field and Description |
|---|---|
static java.util.regex.Pattern |
MARKDOWN_LINK_REGEX |
| Constructor and Description |
|---|
CommentReferenceResolver(Model model) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
process(java.lang.String comment,
Location sourceLocation,
Element element)
Runs the processor for the given source.
|
public CommentReferenceResolver(Model model)
public java.lang.String process(java.lang.String comment,
Location sourceLocation,
Element element)
comment - the documentation source to be processed.sourceLocation - the location of the documentation source.element - the element for which the documentation source is being processed