• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RefImageNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.pegdown.ast.RefImageNode的典型用法代码示例。如果您正苦于以下问题:Java RefImageNode类的具体用法?Java RefImageNode怎么用?Java RefImageNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RefImageNode类属于org.pegdown.ast包,在下文中一共展示了RefImageNode类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: process

import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
    RefImageNode refImage = (RefImageNode) node;

    @SuppressWarnings("unchecked")
    TextNode text = (TextNode) lookupChild(refImage.referenceKey, TextNode.class);

    if (text == null) {
        log.warn("Unknown reference image structure... {}", refImage);
        context.processChildren(level, node);
        return;
    }

    References.Ref ref = context.references().lookup(text.getText());
    if (ref != null) {
        Node altNode = refImage.getChildren().get(0);
        context.process(level, new ExpImageNode(ref.title(), ref.url(), altNode));
        return;
    }

    log.warn("Reference not found for image {}", text.getText());
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:23,代码来源:RefImageNodeProcessor.java


示例2: visit

import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override
public void visit(final RefImageNode rin) {

    final ArrayList<String> alt = new ArrayList<String>();
    boolean found = findByClass(rin, TextNode.class, new FindPredicate<TextNode>() {

        @Override
        public boolean f(TextNode node, Node parent, int index) {
            alt.add(node.getText());
            return true;
        }
    });

    if (!found) {
        throw new IllegalStateException("The alt name should be mandatory in Markdown for images. ");
    }

    final SuperNode referenceKey = rin.referenceKey;
    final String ref = getRefString(rin, referenceKey);
    String url = ref;
    String title = null;
    ReferenceNode referenceNode = referenceNodes.get(ref);
    if (referenceNode != null) {
        if (isNotBlank(referenceNode.getUrl())) {
            url = referenceNode.getUrl();
        }
        title = referenceNode.getTitle();
    }

    String titlePart = isNotBlank(title) ? format("|title=\"%s\"", title) : "";
    _buffer.append( format( "!%s|alt=\"%s\"%s!", url, alt.get(0), titlePart));
}
 
开发者ID:bsorrentino,项目名称:maven-confluence-plugin,代码行数:33,代码来源:ToConfluenceSerializer.java


示例3: visit

import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
public void visit(final RefImageNode node) {
}
 
开发者ID:miurahr,项目名称:omegat-markdown-plugin,代码行数:3,代码来源:AbstractMarkdownSerializer.java


示例4: usecase__ancestor_sibling_and_of_type

import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void usecase__ancestor_sibling_and_of_type() throws Exception {
    String mkd = loadResource("image-04-ref.md").trim();

    PegDownPlugins plugins = PegDownPlugins
            .builder()
            .withPlugin(AttributesPlugin.class)
            .build();
    PegDownProcessor processor = new PegDownProcessor(Extensions.ALL, plugins);
    RootNode rootNode = processor.parseMarkdown(mkd.toCharArray());

    TreeNavigation nav;
    nav = new TreeNavigation();
    nav.push(rootNode);
    nav.pushChild(3);
    nav.pushChild();
    nav.pushChild();
    assertThat(nav.peek()).isInstanceOf(RefImageNode.class);

    //
    //
    Optional<TreeNavigation> result1 =
            ancestor(RefImageNode.class, SuperNode.class, ParaNode.class)
                    .query(nav);
    assertThat(result1.isPresent()).isTrue();
    assertThat(result1.get().peek()).isInstanceOf(ParaNode.class);

    //
    //
    Optional<TreeNavigation> result2 =
            ancestor(RefImageNode.class, SuperNode.class, ParaNode.class)
                    .then(siblingBefore())
                    .query(nav);
    assertThat(result2.isPresent()).isTrue();
    assertThat(result2.get().peek()).isInstanceOf(AttributesNode.class);

    //
    //
    Optional<TreeNavigation> result3 =
            firstAncestorOfType(ParaNode.class)
                    .then(siblingBefore())
                    .query(nav);
    assertThat(result3.isPresent()).isTrue();
    assertThat(result3.get().peek()).isInstanceOf(AttributesNode.class);

    //System.out.println("TreeNavigationTest.usecase" + dumpAST(rootNode));
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:49,代码来源:TreeNavigationTest.java


示例5: visit

import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override
public void visit(RefImageNode arg0) {
        // TODO Auto-generated method stub

}
 
开发者ID:daisy,项目名称:pipeline-gui,代码行数:6,代码来源:MarkdownToJavafx.java


示例6: render

import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override
  public Rendering render (final RefImageNode node, final String url, final String title, final String alt) {
return modifyRendering (super.render (node, url, title, alt));
  }
 
开发者ID:IDgis,项目名称:geo-publisher,代码行数:5,代码来源:Docs.java


示例7: visit

import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override public void visit(RefImageNode node) {
  //To change body of implemented methods use File | Settings | File Templates.
}
 
开发者ID:mindsnacks,项目名称:penmanship,代码行数:4,代码来源:BaseVisitor.java


示例8: visit

import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override
public void visit(RefImageNode node) {

}
 
开发者ID:sillelien,项目名称:dollar,代码行数:5,代码来源:DocTestingVisitor.java


示例9: visit

import org.pegdown.ast.RefImageNode; //导入依赖的package包/类
@Override
public void visit(@NotNull RefImageNode node) {

}
 
开发者ID:sillelien,项目名称:dollar,代码行数:5,代码来源:CodeExtractionVisitor.java



注:本文中的org.pegdown.ast.RefImageNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ChannelManager类代码示例发布时间:2022-05-23
下一篇:
Java BasedSequence类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap