org.dom4j.Node.setParent()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(207)

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

Node.setParent介绍

[英]setParent sets the parent relationship of this node if the parent relationship is supported or does nothing if the parent relationship is not supported.

This method should only be called from inside an Element implementation method and is not intended for general use.
[中]setParent如果支持父关系,则设置此节点的父关系;如果不支持父关系,则不执行任何操作。
此方法只能从Element实现方法内部调用,不适用于一般用途。

代码示例

代码示例来源:origin: org.dom4j/dom4j

  1. /**
  2. * Called when a new child node is added to create any parent relationships
  3. *
  4. * @param node DOCUMENT ME!
  5. */
  6. protected void childAdded(Node node) {
  7. if (node != null) {
  8. node.setParent(this);
  9. }
  10. }

代码示例来源:origin: org.dom4j/dom4j

  1. protected void childRemoved(Node node) {
  2. if (node != null) {
  3. node.setParent(null);
  4. node.setDocument(null);
  5. }
  6. }

代码示例来源:origin: org.dom4j/dom4j

  1. public Object clone() {
  2. if (isReadOnly()) {
  3. return this;
  4. } else {
  5. try {
  6. Node answer = (Node) super.clone();
  7. answer.setParent(null);
  8. answer.setDocument(null);
  9. return answer;
  10. } catch (CloneNotSupportedException e) {
  11. // should never happen
  12. throw new RuntimeException("This should never happen. Caught: "
  13. + e);
  14. }
  15. }
  16. }

代码示例来源:origin: dom4j/dom4j

  1. /**
  2. * Called when a new child node is added to create any parent relationships
  3. *
  4. * @param node DOCUMENT ME!
  5. */
  6. protected void childAdded(Node node) {
  7. if (node != null) {
  8. node.setParent(this);
  9. }
  10. }

代码示例来源:origin: org.dom4j/com.springsource.org.dom4j

  1. /**
  2. * Called when a new child node is added to create any parent relationships
  3. *
  4. * @param node
  5. * DOCUMENT ME!
  6. */
  7. protected void childAdded(Node node) {
  8. if (node != null) {
  9. node.setParent(this);
  10. }
  11. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j

  1. /**
  2. * Called when a new child node is added to create any parent relationships
  3. *
  4. * @param node
  5. * DOCUMENT ME!
  6. */
  7. protected void childAdded(Node node) {
  8. if (node != null) {
  9. node.setParent(this);
  10. }
  11. }

代码示例来源:origin: maven/dom4j

  1. /**
  2. * Called when a new child node is added to create any parent relationships
  3. *
  4. * @param node
  5. * DOCUMENT ME!
  6. */
  7. protected void childAdded(Node node) {
  8. if (node != null) {
  9. node.setParent(this);
  10. }
  11. }

代码示例来源:origin: org.jenkins-ci.dom4j/dom4j

  1. /**
  2. * Called when a new child node is added to create any parent relationships
  3. *
  4. * @param node
  5. * DOCUMENT ME!
  6. */
  7. protected void childAdded(Node node) {
  8. if (node != null) {
  9. node.setParent(this);
  10. }
  11. }

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

  1. /**
  2. * Called when a new child node is added to create any parent relationships
  3. *
  4. * @param node
  5. * DOCUMENT ME!
  6. */
  7. protected void childAdded(Node node) {
  8. if (node != null) {
  9. node.setParent(this);
  10. }
  11. }

代码示例来源:origin: org.dom4j/org.motechproject.org.dom4j

  1. /**
  2. * Called when a new child node is added to create any parent relationships
  3. *
  4. * @param node
  5. * DOCUMENT ME!
  6. */
  7. protected void childAdded(Node node) {
  8. if (node != null) {
  9. node.setParent(this);
  10. }
  11. }

代码示例来源:origin: apache/servicemix-bundles

  1. /**
  2. * Called when a new child node is added to create any parent relationships
  3. *
  4. * @param node DOCUMENT ME!
  5. */
  6. protected void childAdded(Node node) {
  7. if (node != null) {
  8. node.setParent(this);
  9. }
  10. }

代码示例来源:origin: maven/dom4j

  1. protected void childRemoved(Node node) {
  2. if (node != null) {
  3. node.setParent(null);
  4. node.setDocument(null);
  5. }
  6. }

代码示例来源:origin: dom4j/dom4j

  1. protected void childRemoved(Node node) {
  2. if (node != null) {
  3. node.setParent(null);
  4. node.setDocument(null);
  5. }
  6. }

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

  1. protected void childRemoved(Node node) {
  2. if (node != null) {
  3. node.setParent(null);
  4. node.setDocument(null);
  5. }
  6. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j

  1. protected void childRemoved(Node node) {
  2. if (node != null) {
  3. node.setParent(null);
  4. node.setDocument(null);
  5. }
  6. }

代码示例来源:origin: org.dom4j/com.springsource.org.dom4j

  1. protected void childRemoved(Node node) {
  2. if (node != null) {
  3. node.setParent(null);
  4. node.setDocument(null);
  5. }
  6. }

代码示例来源:origin: apache/servicemix-bundles

  1. protected void childRemoved(Node node) {
  2. if (node != null) {
  3. node.setParent(null);
  4. node.setDocument(null);
  5. }
  6. }

代码示例来源:origin: org.dom4j/org.motechproject.org.dom4j

  1. protected void childRemoved(Node node) {
  2. if (node != null) {
  3. node.setParent(null);
  4. node.setDocument(null);
  5. }
  6. }

代码示例来源:origin: org.jenkins-ci.dom4j/dom4j

  1. protected void childRemoved(Node node) {
  2. if (node != null) {
  3. node.setParent(null);
  4. node.setDocument(null);
  5. }
  6. }

代码示例来源:origin: stackoverflow.com

  1. int depth = current.getDepth() + 1;
  2. ArrayList<Node> succesors = current.getSuccessors(depth);
  3. for (Node node : succesors) {
  4. if (!closed.contains(node) && !open.contains(node)) {
  5. node.setH(this.heuristic.calculate(node, goal));
  6. node.setG(current.getG() + 1);
  7. node.setParent(current);
  8. open.add(node);
  9. }
  10. }

相关文章