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

Java TextNode类代码示例

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

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



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

示例1: f

import org.pegdown.ast.TextNode; //导入依赖的package包/类
@Override
public boolean f(TextNode p, Node parent, int index ) {
    if( index != 0 ) return false;

    if( "note:".equalsIgnoreCase(p.getText()) ) {
        element = "note"; // SET ELEMENT TAG
        return true;
    }
    if( "warning:".equalsIgnoreCase(p.getText()) ) {
        element = "warning"; // SET ELEMENT TAG
        return true;
    }
    if( "info:".equalsIgnoreCase(p.getText()) ) {
        element = "info"; // SET ELEMENT TAG
        return true;
    }
    if( "tip:".equalsIgnoreCase(p.getText()) ) {
        element = "tip"; // SET ELEMENT TAG
        return true;
    }


    return false;
}
 
开发者ID:bsorrentino,项目名称:maven-confluence-plugin,代码行数:25,代码来源:ToConfluenceSerializer.java


示例2: visit

import org.pegdown.ast.TextNode; //导入依赖的package包/类
@Override
public void visit(final ExpImageNode ein) {
    // We always have a URL, relative or not

    final ArrayList<String> alt = new ArrayList<String>();
    boolean found = findByClass(ein, 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: " + ein.url);
    }

    String titlePart = isNotBlank(ein.title) ? format("|title=\"%s\"", ein.title) : "";
    _buffer.append( format( "!%s|alt=\"%s\"%s!", ein.url, alt.get(0), titlePart));

}
 
开发者ID:bsorrentino,项目名称:maven-confluence-plugin,代码行数:23,代码来源:ToConfluenceSerializer.java


示例3: BlockRule

import org.pegdown.ast.TextNode; //导入依赖的package包/类
Rule BlockRule() {
  StringBuilderVar style = new StringBuilderVar();
  StringBuilderVar body = new StringBuilderVar();

  return NodeSequence(
      StartMarker(),
      Optional(
          String("style="),
          Sequence(OneOrMore(Letter()), style.append(match()), Spn1())),
      Sequence(Body(), body.append(match())),
      EndMarker(),
      push(
          new ExpImageNode("title",
              createWebsequenceUrl(style.getString(), body.getString()),
              new TextNode("")))
  );
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:18,代码来源:PegdownWebSequencelPlugin.java


示例4: BlockRule

import org.pegdown.ast.TextNode; //导入依赖的package包/类
Rule BlockRule() {
  ParamVar<String, String> params = new ParamVar<String, String>();
  StringBuilderVar name = new StringBuilderVar();
  StringBuilderVar value = new StringBuilderVar();
  StringBuilderVar body = new StringBuilderVar();

  return NodeSequence(
      StartMarker(),
      ZeroOrMore(
          Sequence(
              ParameterName(), name.append(match()),
              String("="),
              OneOrMore(Alphanumeric()), value.append(match())),
          Sp(),
          params.put(name.getString(), value.getString()),
          name.clear(), value.clear()),
      Body(),
      body.append(match()),
      EndMarker(),
      push(
          new ExpImageNode(
              "title", createYumlUrl(params.get(), body.getString()), new TextNode("")))
  );
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:25,代码来源:PegdownYumlPlugin.java


示例5: process

import org.pegdown.ast.TextNode; //导入依赖的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());

}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:25,代码来源:RefLinkNodeProcessor.java


示例6: process

import org.pegdown.ast.TextNode; //导入依赖的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


示例7: summary

import org.pegdown.ast.TextNode; //导入依赖的package包/类
public static String summary(final Node node) {
    final List<String> tokens = new ArrayList<>();
    tokens.add(typeCode(node));
    if (node instanceof TextNode) {
        tokens.add("'" + ((TextNode)node).getText() + "'");
    }
    if (node instanceof SuperNode) {
        final List<Node> children = ((SuperNode)node).getChildren();
        if (!children.isEmpty()) {
            for (Node n : children) {
                tokens.add(summary(n));
            }
        } else {
            tokens.add("()");
        }
    }
    return "(" + StringUtils.join(tokens, " ") + ")";
}
 
开发者ID:redpen-cc,项目名称:redpen,代码行数:19,代码来源:Tools.java


示例8: declareReference

import org.pegdown.ast.TextNode; //导入依赖的package包/类
private void declareReference(ReferenceNode node) {
    TextNode text = (TextNode) node.getChildren().get(0).getChildren().get(0);
    String title = node.getTitle();
    String url = node.getUrl();
    String key = text.getText();
    Ref ref = new Ref(key, url, title);
    references.put(key, ref);
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:9,代码来源:References.java


示例9: process

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

    RichText text = new RichText(tNode.getText(), context.peekFont());

    ITextContext iTextContext = context.iTextContext();
    iTextContext.emit(text);
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:10,代码来源:TextNodeProcessor.java


示例10: visit

import org.pegdown.ast.TextNode; //导入依赖的package包/类
@Override
public void visit(TextNode text) {
        Text elem =new Text(text.getText());
        for(String style :this.styles){
                elem.getStyleClass().add(style);
        }

        this.styles.clear();
        this.parent.addChild(elem);

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


示例11: printChildren

import org.pegdown.ast.TextNode; //导入依赖的package包/类
private void printChildren(StringBuffer buff, ExpLinkNode node) {
        //this is ugly as it can get, but again this parser is quite restricted
        //so this is an adhoc method for printing links
        if (node.getChildren().size() > 0 && node.getChildren().get(0).getChildren().size() >0){
                Node textNode = node.getChildren().get(0).getChildren().get(0);
                //she sells shells ...
                if(textNode instanceof TextNode){
                        buff.append(((TextNode)textNode).getText());
                }

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


示例12: collectChildrensText

import org.pegdown.ast.TextNode; //导入依赖的package包/类
@Override
public void collectChildrensText(SuperNode node, AnchorNodeInfo nodeInfo) {
    for (Node child : node.getChildren()) {
        // accumulate all the text
        if (child instanceof TextNode) {
            nodeInfo.text.append(((TextNode) child).getText());
            if (nodeInfo.startIndex == 0) {
                nodeInfo.startIndex = child.getStartIndex();
            }
            nodeInfo.endIndex = child.getEndIndex();
        } else if (child instanceof SuperNode) {
            collectChildrensText((SuperNode) child, nodeInfo);
        }
    }
}
 
开发者ID:voostindie,项目名称:magisto,代码行数:16,代码来源:CustomMarkdownParser.java


示例13: visit

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


示例14: putEntry

import org.pegdown.ast.TextNode; //导入依赖的package包/类
/**
 * Functions called from Serializer.
 *
 * @param node PegDown's TextNode node.
 */
void putEntry(final TextNode node) {
    String text = node.getText();
    putEntry(text);
    currentBufPosition = node.getEndIndex();
}
 
开发者ID:miurahr,项目名称:omegat-markdown-plugin,代码行数:11,代码来源:EntryHandler.java


示例15: printTag

import org.pegdown.ast.TextNode; //导入依赖的package包/类
@Override
protected void printTag(TextNode node, String tag) {
      	String pre = "";
   	String post = "";
   	switch (tag.toLowerCase()) {
   	case "b":
   	case "strong":
   		pre = post = "*";
   		break;
   	case "i":
   	case "em":
   		pre = post = "_";
   		break;
   	case "p":
   		post = "\n\n";
   		break;
   	case "br":
   		post = "\n";
   		break;
   	case "code":
   		pre = post = "`";
   		break;
   	case "pre":
   		pre = post = "```\n";
   		break;
   	case "blockquote":
   		pre = "> ";
   		break;
   	case "ul":
   	case "ol":
   		pre = post = "\n";
   		break;
   	case "li":
   		pre = " - ";
   		post = "\n";
   		break;
   	default:
   		// unsupported transform type
   		log.warn("Slack does not offer a markup substitute for tag {}", tag);
   		pre = String.format("<%s>", tag);
   		post = String.format("</%s>", tag);
   	}

   	printer.print(pre);
       printer.printEncoded(node.getText());
       printer.print(post);
   }
 
开发者ID:gitblit,项目名称:gitblit-slack-plugin,代码行数:48,代码来源:SlackMarkupSerializer.java


示例16: process

import org.pegdown.ast.TextNode; //导入依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
    TextNode tNode = (TextNode) node;
    context.append(new Chunk(tNode.getText(), context.peekFont()));
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:6,代码来源:AnchorLinkNodeProcessor.java


示例17: visit

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


示例18: visit

import org.pegdown.ast.TextNode; //导入依赖的package包/类
/**
 * Accept text node.
 * <p>
 *     put literals to translation entry.
 * @param node text node.
 */
@Override
public void visit(final TextNode node) {
    handler.putEntry(node);
}
 
开发者ID:miurahr,项目名称:omegat-markdown-plugin,代码行数:11,代码来源:MarkdownSerializer.java


示例19: visit

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

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


示例20: visit

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

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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