public class DocumentationUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
asJsonString(java.lang.String text)
Given a documentation string, escape it such that it can be represented as a JSON string.
|
static java.lang.String |
filter(DiagCollector collector,
java.util.Set<java.lang.String> visibilityLabels,
Location location,
java.lang.String source)
Performs comment filtering.
|
static java.lang.String |
getDeprecationDescription(ProtoElement element)
Given an ProtoElement, returns its associated deprecation description.
|
static java.lang.String |
getDescription(ProtoElement element)
Given an ProtoElement, returns its associated description.
|
static java.lang.String |
getDescription(ProtoElement element,
java.lang.String defaultText)
Given a proto element, returns its associated description.
|
static java.lang.String |
getDocumentationRootUrl(Model model)
Given a model, returns its associated documentation root url based on documentation and
legacy configuration.
|
static java.lang.String |
getScopedDescription(ProtoElement element)
Get the description of the element scoped to the visibility as currently set in the model.
|
static java.lang.String |
getScopedDescription(ProtoElement element,
boolean reportWarning) |
static java.util.List<com.google.api.Page> |
getScopedToplevelPages(Model model)
Get the documentation pages scoped to the visibility as currently set in the model.
|
static java.util.List<com.google.api.Page> |
getToplevelPages(Model model)
Get the documentation pages from given model.
|
static java.lang.String |
removeCrossReference(java.lang.String text)
Given a documentation string, replace the cross reference links with reference text.
|
static java.lang.String |
rpcToRest(SymbolTable symbolTable,
java.lang.String description)
Given a string, searches for unqualified references to message fields and to method names and
converts them from RPC-style to REST-style.
|
public static java.util.List<com.google.api.Page> getToplevelPages(Model model)
public static java.util.List<com.google.api.Page> getScopedToplevelPages(Model model)
public static java.lang.String getDeprecationDescription(ProtoElement element)
public static java.lang.String getDescription(ProtoElement element)
public static java.lang.String getScopedDescription(ProtoElement element)
public static java.lang.String getScopedDescription(ProtoElement element, boolean reportWarning)
public static java.lang.String getDescription(ProtoElement element, java.lang.String defaultText)
defaultText
if no description is available.public static java.lang.String rpcToRest(SymbolTable symbolTable, java.lang.String description)
public static java.lang.String getDocumentationRootUrl(Model model)
public static java.lang.String asJsonString(java.lang.String text)
public static java.lang.String removeCrossReference(java.lang.String text)
public static java.lang.String filter(DiagCollector collector, @Nullable java.util.Set<java.lang.String> visibilityLabels, Location location, @Nullable java.lang.String source)
"Foo (-- internal --) foo" will be returned as "Foo foo"Except, if internal comment is at the beginning of the line, no space will be inserted. For example:
"(-- internal --) foo" will be returned as "foo"
"Foo (-- internal --) (-- internal --) (-- internal2 --) Foo" will be returned as "Foo Foo"