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

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

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

Node.getDocument介绍

[英]getDocument returns the Document that this Node is part of if this node supports the parent relationship.

This method is an optional feature and may not be supported for all Node implementations.
[中]getDocument如果此节点支持父关系,则返回此Node所属的Document
此方法是可选功能,可能不支持所有Node实现。

代码示例

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

@Override
Object getDocument(Object node) {
  return ((Node) node).getDocument();
}

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

public Object getDocumentNode(Object contextNode)
{
  if ( contextNode instanceof Document ) 
  {
    return contextNode;
  }
  else if ( contextNode instanceof Node ) 
  {
    Node node = (Node) contextNode;
    return node.getDocument();
  }
  return null;
}

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

public Object getParentNode(Object contextNode)
{
  if ( contextNode instanceof Node ) 
  {
    Node node = (Node) contextNode;
    Object answer = node.getParent();
    if ( answer == null ) 
    {
      answer = node.getDocument();
      if (answer == contextNode) {
        return null;
      }
    }
    return answer;            
  }
  return null;
}

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

public Iterator getParentAxisIterator(Object contextNode)
{
  if ( contextNode instanceof Document )
  {
    return JaxenConstants.EMPTY_ITERATOR;
  }
  Node node = (Node) contextNode;
  Object parent = node.getParent();
  if ( parent == null )
  {
    parent = node.getDocument();
  }
  
  return new SingleObjectIterator( parent );
}

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

Node messageNode = findMessageNode(messageCollectionList, query, "messages.xml missing BugPattern element for type "
    + type);
Node bugsUrlNode = messageNode.getDocument().selectSingleNode("/MessageCollection/Plugin/"+(experimental?"AllBugsUrl":"BugsUrl"));

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

/**
 * Creates a JAXP {@link SAXSource}for the given {@link Node}.
 * 
 * @param node
 *            DOCUMENT ME!
 */
public DocumentSource(Node node) {
  setDocument(node.getDocument());
}

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

public static org.w3c.dom.Document getOwnerDocument(Node node) {
  return asDOMDocument(node.getDocument());
}

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

protected void addNode(int index, Node node) {
  if (node != null) {
    Document document = node.getDocument();
    if ((document != null) && (document != this)) {
      // XXX: could clone here
      String message = "The Node already has an existing document: "
          + document;
      throw new IllegalAddException(this, node, message);
    }
    contentList().add(index, node);
    childAdded(node);
  }
}

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

protected void addNode(Node node) {
  if (node != null) {
    Document document = node.getDocument();
    if ((document != null) && (document != this)) {
      // XXX: could clone here
      String message = "The Node already has an existing document: "
          + document;
      throw new IllegalAddException(this, node, message);
    }
    contentList().add(node);
    childAdded(node);
  }
}

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

Document doc = node.getDocument();

代码示例来源:origin: org.freemarker/freemarker-gae

@Override
Object getDocument(Object node) {
  return ((Node) node).getDocument();
}

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

/**
 * Creates a JAXP {@link SAXSource}for the given {@link Node}.
 * 
 * @param node
 *            DOCUMENT ME!
 */
public DocumentSource(Node node) {
  setDocument(node.getDocument());
}

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

/**
 * Creates a JAXP {@link SAXSource}for the given {@link Node}.
 * 
 * @param node
 *            DOCUMENT ME!
 */
public DocumentSource(Node node) {
  setDocument(node.getDocument());
}

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

/**
 * Creates a JAXP {@link SAXSource}for the given {@link Node}.
 * 
 * @param node
 *            DOCUMENT ME!
 */
public DocumentSource(Node node) {
  setDocument(node.getDocument());
}

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

/**
 * Creates a JAXP {@link SAXSource}for the given {@link Node}.
 * 
 * @param node
 *            DOCUMENT ME!
 */
public DocumentSource(Node node) {
  setDocument(node.getDocument());
}

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

/**
 * Creates a JAXP {@link SAXSource}for the given {@link Node}.
 * 
 * @param node
 *            DOCUMENT ME!
 */
public DocumentSource(Node node) {
  setDocument(node.getDocument());
}

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

/**
 * Creates a JAXP {@link SAXSource}for the given {@link Node}.
 * 
 * @param node
 *            DOCUMENT ME!
 */
public DocumentSource(Node node) {
  setDocument(node.getDocument());
}

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

/**
 * Creates a JAXP {@link SAXSource}for the given {@link Node}.
 * 
 * @param node
 *            DOCUMENT ME!
 */
public DocumentSource(Node node) {
  setDocument(node.getDocument());
}

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

protected void addNode(Node node) {
  if (node != null) {
    Document document = node.getDocument();
    if ((document != null) && (document != this)) {
      // XXX: could clone here
      String message = "The Node already has an existing document: "
          + document;
      throw new IllegalAddException(this, node, message);
    }
    contentList().add(node);
    childAdded(node);
  }
}

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

protected void addNode(Node node) {
  if (node != null) {
    Document document = node.getDocument();
    if ((document != null) && (document != this)) {
      // XXX: could clone here
      String message = "The Node already has an existing document: "
          + document;
      throw new IllegalAddException(this, node, message);
    }
    contentList().add(node);
    childAdded(node);
  }
}

相关文章