本文整理汇总了Java中com.sun.source.doctree.LinkTree类的典型用法代码示例。如果您正苦于以下问题:Java LinkTree类的具体用法?Java LinkTree怎么用?Java LinkTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LinkTree类属于com.sun.source.doctree包,在下文中一共展示了LinkTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: matchClass
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
@Override
public Description matchClass(ClassTree tree, final VisitorState state) {
final DCTree.DCDocComment comment =
((JCTree.JCCompilationUnit) state.getPath().getCompilationUnit())
.docComments.getCommentTree((JCTree) tree);
if (comment == null) {
return Description.NO_MATCH;
}
final SuggestedFix.Builder fix = SuggestedFix.builder();
new DocTreePathScanner<Void, Void>() {
@Override
public Void visitLink(LinkTree node, Void aVoid) {
SuggestedFixes.qualifyDocReference(
fix, new DocTreePath(getCurrentPath(), node.getReference()), state);
return null;
}
}.scan(new DocTreePath(state.getPath(), comment), null);
if (fix.isEmpty()) {
return Description.NO_MATCH;
}
return describeMatch(tree, fix.build());
}
示例2: rewriteChildren
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
protected final LinkTree rewriteChildren(LinkTree tree) {
LinkTree value = tree;
List<? extends DocTree> label = translateDoc(tree.getLabel());
ReferenceTree ref = (ReferenceTree) translate(tree.getReference());
if (label != tree.getLabel() || ref != tree.getReference()) {
value = make.Link(ref, label);
}
return value;
}
示例3: visitLink
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
@Override
public Void visitLink(LinkTree node, Void p) {
print("{");
printTagName(node);
print(" ");
doAccept((DCTree)node.getReference());
if (!node.getLabel().isEmpty()) {
print(" ");
for (DocTree docTree : node.getLabel()) {
doAccept((DCTree)docTree);
}
}
print("}");
return null;
}
示例4: visitLink
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
@Override
public Void visitLink(LinkTree tree, Void ignore) {
markEnclosingTag(Flag.HAS_INLINE_TAG);
// simulate inline context on tag stack
HtmlTag t = (tree.getKind() == DocTree.Kind.LINK)
? HtmlTag.CODE : HtmlTag.SPAN;
tagStack.push(new TagStackItem(tree, t));
try {
return super.visitLink(tree, ignore);
} finally {
tagStack.pop();
}
}
示例5: visitLink
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public Object visitLink(LinkTree node, Object p) {
if (!node.getLabel().isEmpty()) {
scan(node.getLabel(), p);
} else {
result.append(node.getReference().getSignature());
}
return null;
}
示例6: visitLink
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitLink(LinkTree tree, Void ignore) {
markEnclosingTag(Flag.HAS_INLINE_TAG);
// simulate inline context on tag stack
HtmlTag t = (tree.getKind() == DocTree.Kind.LINK)
? HtmlTag.CODE : HtmlTag.SPAN;
tagStack.push(new TagStackItem(tree, t));
try {
return super.visitLink(tree, ignore);
} finally {
tagStack.pop();
}
}
示例7: visitLink
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
@Override
public DocTree visitLink(LinkTree tree, Object p) {
return rewriteChildren(tree);
}
示例8: Link
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
public LinkTree Link(ReferenceTree ref, List<? extends DocTree> label) {
return docMake.at(NOPOS).newLinkTree(ref, label);
}
示例9: LinkPlain
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
public LinkTree LinkPlain(ReferenceTree ref, List<? extends DocTree> label) {
return docMake.at(NOPOS).newLinkPlainTree(ref, label);
}
示例10: visitLink
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
/**
* @since 1.47
*/
@Override
public DocTree visitLink(LinkTree node, Element p) {
return docScanner.visitLink(node, p, null);
}
示例11: visitLink
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
@Override
public Void visitLink(LinkTree node, List<ErrorDescription> errors) {
return super.visitLink(node, errors);
}
示例12: visitLink
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
@Override
public Void visitLink(LinkTree tree, Void ignore) {
checkReference(tree.getReference(), tree.getLabel());
return null;
}
示例13: Link
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
/**Creates the DocTree's LinkTree.
*
* @param ref the reference linked by the {@code @link}
* @param label the optional description of the reference
* @return newly created LinkTree
* @since 0.124
*/
public LinkTree Link(ReferenceTree ref, List<? extends DocTree> label) {
return delegate.Link(ref, label);
}
示例14: LinkPlain
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
/**Creates the DocTree's LinkTree for {@code @linkplain}.
*
* @param ref the reference linked by the {@code @link}
* @param label the optional description of the reference
* @return newly created LinkTree
* @since 0.124
*/
public LinkTree LinkPlain(ReferenceTree ref, List<? extends DocTree> label) {
return delegate.LinkPlain(ref, label);
}
示例15: newLinkTree
import com.sun.source.doctree.LinkTree; //导入依赖的package包/类
/**
* Create a new {@code LinkTree} object, to represent a {@code {@link } } tag.
* @param ref the API element being referenced
* @param label an optional label for the link
* @return a {@code LinkTree} object
*/
LinkTree newLinkTree(ReferenceTree ref, List<? extends DocTree> label);