本文整理汇总了Java中org.pegdown.ast.RefLinkNode类的典型用法代码示例。如果您正苦于以下问题:Java RefLinkNode类的具体用法?Java RefLinkNode怎么用?Java RefLinkNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RefLinkNode类属于org.pegdown.ast包,在下文中一共展示了RefLinkNode类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import org.pegdown.ast.RefLinkNode; //导入依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
RefLinkNode refLink = (RefLinkNode) node;
@SuppressWarnings("unchecked")
TextNode text = (TextNode) lookupChild(refLink.referenceKey, TextNode.class);
if (text == null) {
log.warn("Unknown reference link structure... {}", refLink);
context.processChildren(level, node);
return;
}
References.Ref ref = context.references().lookup(text.getText());
if (ref != null) {
Node altNode = refLink.getChildren().get(0);
context.process(level, new ExpLinkNode(ref.title(), ref.url(), altNode));
return;
}
log.warn("Reference not found for link {}", text.getText());
}
示例2: visit
import org.pegdown.ast.RefLinkNode; //导入依赖的package包/类
public void visit(final RefLinkNode node) {
handler.putMark("[");
visitChildren(node);
handler.putMark("]");
if (node.referenceKey != null) {
if (node.separatorSpace != null) {
handler.putMark(node.separatorSpace);
}
handler.putMark("[");
visitChildren(node.referenceKey);
handler.putMark("]");
}
}
示例3: visit
import org.pegdown.ast.RefLinkNode; //导入依赖的package包/类
@Override
public void visit(final RefLinkNode rln) {
_buffer.append( '[' );
visitChildren(rln);
_buffer.append('|');
final String ref = getRefString(rln, rln.referenceKey);
final String parentPageTitle = getHomePageTitle();
String url = ref;
ReferenceNode referenceNode = referenceNodes.get(ref);
if (referenceNode != null && referenceNode.getUrl() != null && url.length() > 0) {
url = referenceNode.getUrl();
}
// If URL is a relative URL, we will create a link to the project
try {
new URL(url);
} catch (MalformedURLException e) {
// not a valid URL (hence a relative link)
if( parentPageTitle != null && !url.startsWith(parentPageTitle)) {
_buffer.append(parentPageTitle).append(" - ");
}
}
_buffer.append(url);
if (referenceNode != null && referenceNode.getTitle() != null) {
_buffer.append('|').append(referenceNode.getTitle());
}
_buffer.append( ']' );
}
示例4: f
import org.pegdown.ast.RefLinkNode; //导入依赖的package包/类
@Override
public void f(RefLinkNode node) {
System.out.printf( " separatorSpace=[%s]", node.separatorSpace);
if( node.referenceKey != null ) {
System.out.println();
node.referenceKey.accept(newVisitor(4));
}
}
示例5: visit
import org.pegdown.ast.RefLinkNode; //导入依赖的package包/类
public void visit(final RefLinkNode node) {
visitChildren(node);
}
示例6: render
import org.pegdown.ast.RefLinkNode; //导入依赖的package包/类
@Override
public Rendering render(RefLinkNode node, String url, String title, String text) {
Rendering rendering = new Rendering(MarkdownLinkResolver.resolveLink(url), text);
return StringUtils.isEmpty(title) ? rendering : rendering.withAttribute("title", encode(title));
}
示例7: render
import org.pegdown.ast.RefLinkNode; //导入依赖的package包/类
@Override
public Rendering render (final RefLinkNode node, final String url, final String title, final String text) {
return modifyRendering (super.render (node, url, title, text));
}
示例8: visit
import org.pegdown.ast.RefLinkNode; //导入依赖的package包/类
@Override public void visit(RefLinkNode node) {
//To change body of implemented methods use File | Settings | File Templates.
}
示例9: visit
import org.pegdown.ast.RefLinkNode; //导入依赖的package包/类
@Override
public void visit(RefLinkNode node) {
@SuppressWarnings("unused")
Hyperlink link = new Hyperlink();
}
示例10: visit
import org.pegdown.ast.RefLinkNode; //导入依赖的package包/类
@Override
public void visit(RefLinkNode node) {
}
示例11: visit
import org.pegdown.ast.RefLinkNode; //导入依赖的package包/类
@Override
public void visit(@NotNull RefLinkNode node) {
}