org.commonmark.node.Node.getFirstChild()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中org.commonmark.node.Node.getFirstChild()方法的一些代码示例,展示了Node.getFirstChild()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getFirstChild()方法的具体详情如下:
包路径:org.commonmark.node.Node
类名称:Node
方法名:getFirstChild

Node.getFirstChild介绍

暂无

代码示例

代码示例来源:origin: atlassian/commonmark-java

  1. private void mergeChildTextNodes(Node node) {
  2. // No children or just one child node, no need for merging
  3. if (node.getFirstChild() == node.getLastChild()) {
  4. return;
  5. }
  6. mergeTextNodesInclusive(node.getFirstChild(), node.getLastChild());
  7. }

代码示例来源:origin: atlassian/commonmark-java

  1. private void renderChildren(Node parent) {
  2. Node node = parent.getFirstChild();
  3. while (node != null) {
  4. Node next = node.getNext();
  5. context.render(node);
  6. node = next;
  7. }
  8. }
  9. }

代码示例来源:origin: atlassian/commonmark-java

  1. @Override
  2. protected void visitChildren(Node parent) {
  3. Node node = parent.getFirstChild();
  4. while (node != null) {
  5. Node next = node.getNext();
  6. context.render(node);
  7. node = next;
  8. }
  9. }

代码示例来源:origin: atlassian/commonmark-java

  1. @Override
  2. protected void visitChildren(Node parent) {
  3. Node node = parent.getFirstChild();
  4. while (node != null) {
  5. Node next = node.getNext();
  6. context.render(node);
  7. node = next;
  8. }
  9. }

代码示例来源:origin: atlassian/commonmark-java

  1. private void renderChildren(Node parent) {
  2. Node node = parent.getFirstChild();
  3. while (node != null) {
  4. Node next = node.getNext();
  5. context.render(node);
  6. node = next;
  7. }
  8. }
  9. }

代码示例来源:origin: atlassian/commonmark-java

  1. private void renderChildren(Node parent) {
  2. Node node = parent.getFirstChild();
  3. while (node != null) {
  4. Node next = node.getNext();
  5. context.render(node);
  6. node = next;
  7. }
  8. }
  9. }

代码示例来源:origin: atlassian/commonmark-java

  1. private void renderChildren(Node parent) {
  2. Node node = parent.getFirstChild();
  3. while (node != null) {
  4. Node next = node.getNext();
  5. context.render(node);
  6. node = next;
  7. }
  8. }
  9. }

代码示例来源:origin: atlassian/commonmark-java

  1. /**
  2. * Visit the child nodes.
  3. *
  4. * @param parent the parent node whose children should be visited
  5. */
  6. protected void visitChildren(Node parent) {
  7. Node node = parent.getFirstChild();
  8. while (node != null) {
  9. // A subclass of this visitor might modify the node, resulting in getNext returning a different node or no
  10. // node after visiting it. So get the next node before visiting.
  11. Node next = node.getNext();
  12. node.accept(this);
  13. node = next;
  14. }
  15. }
  16. }

代码示例来源:origin: atlassian/commonmark-java

  1. private void renderChildren(Node parent) {
  2. Node node = parent.getFirstChild();
  3. while (node != null) {
  4. Node next = node.getNext();
  5. // For last cell in row, we dont render the delimiter.
  6. if (node instanceof TableCell && next == null) {
  7. renderLastCell((TableCell) node);
  8. } else {
  9. context.render(node);
  10. }
  11. node = next;
  12. }
  13. }
  14. }

代码示例来源:origin: atlassian/commonmark-java

  1. private void writeLink(Node node, String title, String destination) {
  2. boolean hasChild = node.getFirstChild() != null;
  3. boolean hasTitle = title != null && !title.equals(destination);
  4. boolean hasDestination = destination != null && !destination.equals("");
  5. if (hasChild) {
  6. textContent.write('"');
  7. visitChildren(node);
  8. textContent.write('"');
  9. if (hasTitle || hasDestination) {
  10. textContent.whitespace();
  11. textContent.write('(');
  12. }
  13. }
  14. if (hasTitle) {
  15. textContent.write(title);
  16. if (hasDestination) {
  17. textContent.colon();
  18. textContent.whitespace();
  19. }
  20. }
  21. if (hasDestination) {
  22. textContent.write(destination);
  23. }
  24. if (hasChild && (hasTitle || hasDestination)) {
  25. textContent.write(')');
  26. }
  27. }

代码示例来源:origin: com.atlassian.commonmark/commonmark

  1. private void mergeChildTextNodes(Node node) {
  2. // No children or just one child node, no need for merging
  3. if (node.getFirstChild() == node.getLastChild()) {
  4. return;
  5. }
  6. mergeTextNodesInclusive(node.getFirstChild(), node.getLastChild());
  7. }

代码示例来源:origin: com.atlassian.commonmark/commonmark

  1. @Override
  2. protected void visitChildren(Node parent) {
  3. Node node = parent.getFirstChild();
  4. while (node != null) {
  5. Node next = node.getNext();
  6. context.render(node);
  7. node = next;
  8. }
  9. }

代码示例来源:origin: com.atlassian.commonmark/commonmark

  1. @Override
  2. protected void visitChildren(Node parent) {
  3. Node node = parent.getFirstChild();
  4. while (node != null) {
  5. Node next = node.getNext();
  6. context.render(node);
  7. node = next;
  8. }
  9. }

代码示例来源:origin: com.atlassian.commonmark/commonmark-ext-gfm-tables

  1. private void renderChildren(Node parent) {
  2. Node node = parent.getFirstChild();
  3. while (node != null) {
  4. Node next = node.getNext();
  5. context.render(node);
  6. node = next;
  7. }
  8. }
  9. }

代码示例来源:origin: com.atlassian.commonmark/commonmark-ext-gfm-strikethrough

  1. private void renderChildren(Node parent) {
  2. Node node = parent.getFirstChild();
  3. while (node != null) {
  4. Node next = node.getNext();
  5. context.render(node);
  6. node = next;
  7. }
  8. }
  9. }

代码示例来源:origin: com.atlassian.commonmark/commonmark-ext-gfm-strikethrough

  1. private void renderChildren(Node parent) {
  2. Node node = parent.getFirstChild();
  3. while (node != null) {
  4. Node next = node.getNext();
  5. context.render(node);
  6. node = next;
  7. }
  8. }
  9. }

代码示例来源:origin: googleapis/gapic-generator

  1. protected void visitChildren(Node node) {
  2. Node child = node.getFirstChild();
  3. while (child != null) {
  4. Node next = child.getNext();
  5. child.accept(this);
  6. child = next;
  7. }
  8. }
  9. }

代码示例来源:origin: com.atlassian.commonmark/commonmark

  1. /**
  2. * Visit the child nodes.
  3. *
  4. * @param parent the parent node whose children should be visited
  5. */
  6. protected void visitChildren(Node parent) {
  7. Node node = parent.getFirstChild();
  8. while (node != null) {
  9. // A subclass of this visitor might modify the node, resulting in getNext returning a different node or no
  10. // node after visiting it. So get the next node before visiting.
  11. Node next = node.getNext();
  12. node.accept(this);
  13. node = next;
  14. }
  15. }
  16. }

代码示例来源:origin: synchrony/smsn

  1. private void visitChildren(final Node node) {
  2. if (verbose) {
  3. echo(node);
  4. }
  5. currentDepth++;
  6. Node child = node.getFirstChild();
  7. while (null != child) {
  8. child.accept(this);
  9. child = child.getNext();
  10. }
  11. currentDepth--;
  12. }

代码示例来源:origin: com.atlassian.commonmark/commonmark-ext-gfm-tables

  1. private void renderChildren(Node parent) {
  2. Node node = parent.getFirstChild();
  3. while (node != null) {
  4. Node next = node.getNext();
  5. // For last cell in row, we dont render the delimiter.
  6. if (node instanceof TableCell && next == null) {
  7. renderLastCell((TableCell) node);
  8. } else {
  9. context.render(node);
  10. }
  11. node = next;
  12. }
  13. }
  14. }

相关文章