当前位置: 首页>>代码示例>>Java>>正文


Java Node.DOCUMENT_POSITION_CONTAINED_BY属性代码示例

本文整理汇总了Java中org.w3c.dom.Node.DOCUMENT_POSITION_CONTAINED_BY属性的典型用法代码示例。如果您正苦于以下问题:Java Node.DOCUMENT_POSITION_CONTAINED_BY属性的具体用法?Java Node.DOCUMENT_POSITION_CONTAINED_BY怎么用?Java Node.DOCUMENT_POSITION_CONTAINED_BY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.w3c.dom.Node的用法示例。


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

示例1: setNode

/**
 * Set the node that will contain the result DOM tree.
 *
 * <p>In practice, the node should be
 * a {@link org.w3c.dom.Document} node,
 * a {@link org.w3c.dom.DocumentFragment} node, or
 * a {@link org.w3c.dom.Element} node.
 * In other words, a node that accepts children.
 *
 * <p>An {@code IllegalStateException} is thrown if
 * {@code nextSibling} is not {@code null} and
 * {@code node} is not a parent of {@code nextSibling}.
 * An {@code IllegalStateException} is thrown if {@code node} is {@code null} and
 * {@code nextSibling} is not {@code null}.
 *
 * @param node The node to which the transformation will be appended.
 *
 * @throws IllegalStateException If {@code nextSibling} is not
 *   {@code null} and
 *   {@code nextSibling} is not a child of {@code node} or
 *   {@code node} is {@code null} and
 *   {@code nextSibling} is not {@code null}.
 */
public void setNode(Node node) {
    // does the corrent parent/child relationship exist?
    if (nextSibling != null) {
        // cannot be a sibling of a null node
        if (node == null) {
            throw new IllegalStateException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
        }

        // nextSibling contained by node?
        if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
            throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
        }
    }

    this.node = node;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:39,代码来源:DOMResult.java

示例2: setNextSibling

/**
 * Set the child node before which the result nodes will be inserted.
 *
 * <p>Use {@code nextSibling} to specify the child node
 * before which the result nodes should be inserted.
 * If {@code nextSibling} is not a descendant of {@code node},
 * then an {@code IllegalArgumentException} is thrown.
 * If {@code node} is {@code null} and {@code nextSibling} is not {@code null},
 * then an {@code IllegalStateException} is thrown.
 * If {@code nextSibling} is {@code null},
 * then the behavior is the same as calling {@link #DOMResult(Node node)},
 * i.e. append the result nodes as the last child of the specified {@code node}.
 *
 * @param nextSibling The child node before which the result nodes will be inserted.
 *
 * @throws IllegalArgumentException If {@code nextSibling} is not a
 *   descendant of {@code node}.
 * @throws IllegalStateException If {@code node} is {@code null}
 *   and {@code nextSibling} is not {@code null}.
 *
 * @since 1.5
 */
public void setNextSibling(Node nextSibling) {

    // does the corrent parent/child relationship exist?
    if (nextSibling != null) {
        // cannot be a sibling of a null node
        if (node == null) {
            throw new IllegalStateException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
        }

        // nextSibling contained by node?
        if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
            throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
        }
    }

    this.nextSibling = nextSibling;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:39,代码来源:DOMResult.java

示例3: DOMResult

/**
 * <p>Use a DOM node to create a new output target specifying the child node where the result nodes should be inserted before.</p>
 *
 * <p>In practice, <code>node</code> and <code>nextSibling</code> should be
 * a {@link org.w3c.dom.Document} node,
 * a {@link org.w3c.dom.DocumentFragment} node, or
 * a {@link org.w3c.dom.Element} node.
 * In other words, a node that accepts children.</p>
 *
 * <p>Use <code>nextSibling</code> to specify the child node
 * where the result nodes should be inserted before.
 * If <code>nextSibling</code> is not a sibling of <code>node</code>,
 * then an <code>IllegalArgumentException</code> is thrown.
 * If <code>node</code> is <code>null</code> and <code>nextSibling</code> is not <code>null</code>,
 * then an <code>IllegalArgumentException</code> is thrown.
 * If <code>nextSibling</code> is <code>null</code>,
 * then the behavior is the same as calling {@link #DOMResult(Node node)},
 * i.e. append the result nodes as the last child of the specified <code>node</code>.</p>
 *
 * <p><code>systemId</code> will be set to <code>null</code>.</p>
 *
 * @param node The DOM node that will contain the result tree.
 * @param nextSibling The child node where the result nodes should be inserted before.
 *
 * @throws IllegalArgumentException If <code>nextSibling</code> is not a sibling of <code>node</code> or
 *   <code>node</code> is <code>null</code> and <code>nextSibling</code>
 *   is not <code>null</code>.
 *
 * @since 1.5
 */
public DOMResult(Node node, Node nextSibling) {

    // does the corrent parent/child relationship exist?
    if (nextSibling != null) {
        // cannot be a sibling of a null node
        if (node == null) {
            throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
        }

        // nextSibling contained by node?
        if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
            throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
        }
    }

    setNode(node);
    setNextSibling(nextSibling);
    setSystemId(null);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:49,代码来源:DOMResult.java

示例4: setNode

/**
 * <p>Set the node that will contain the result DOM tree.<p>
 *
 * <p>In practice, the node should be
 * a {@link org.w3c.dom.Document} node,
 * a {@link org.w3c.dom.DocumentFragment} node, or
 * a {@link org.w3c.dom.Element} node.
 * In other words, a node that accepts children.</p>
 *
 * <p>An <code>IllegalStateException</code> is thrown if
 * <code>nextSibling</code> is not <code>null</code> and
 * <code>node</code> is not a parent of <code>nextSibling</code>.
 * An <code>IllegalStateException</code> is thrown if <code>node</code> is <code>null</code> and
 * <code>nextSibling</code> is not <code>null</code>.</p>
 *
 * @param node The node to which the transformation will be appended.
 *
 * @throws IllegalStateException If <code>nextSibling</code> is not
 *   <code>null</code> and
 *   <code>nextSibling</code> is not a child of <code>node</code> or
 *   <code>node</code> is <code>null</code> and
 *   <code>nextSibling</code> is not <code>null</code>.
 */
public void setNode(Node node) {
    // does the corrent parent/child relationship exist?
    if (nextSibling != null) {
        // cannot be a sibling of a null node
        if (node == null) {
            throw new IllegalStateException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
        }

        // nextSibling contained by node?
        if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
            throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
        }
    }

    this.node = node;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:DOMResult.java

示例5: setNextSibling

/**
 * <p>Set the child node before which the result nodes will be inserted.</p>
 *
 * <p>Use <code>nextSibling</code> to specify the child node
 * before which the result nodes should be inserted.
 * If <code>nextSibling</code> is not a descendant of <code>node</code>,
 * then an <code>IllegalArgumentException</code> is thrown.
 * If <code>node</code> is <code>null</code> and <code>nextSibling</code> is not <code>null</code>,
 * then an <code>IllegalStateException</code> is thrown.
 * If <code>nextSibling</code> is <code>null</code>,
 * then the behavior is the same as calling {@link #DOMResult(Node node)},
 * i.e. append the result nodes as the last child of the specified <code>node</code>.</p>
 *
 * @param nextSibling The child node before which the result nodes will be inserted.
 *
 * @throws IllegalArgumentException If <code>nextSibling</code> is not a
 *   descendant of <code>node</code>.
 * @throws IllegalStateException If <code>node</code> is <code>null</code>
 *   and <code>nextSibling</code> is not <code>null</code>.
 *
 * @since 1.5
 */
public void setNextSibling(Node nextSibling) {

    // does the corrent parent/child relationship exist?
    if (nextSibling != null) {
        // cannot be a sibling of a null node
        if (node == null) {
            throw new IllegalStateException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
        }

        // nextSibling contained by node?
        if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
            throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
        }
    }

    this.nextSibling = nextSibling;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:DOMResult.java

示例6: DOMResult

/**
 * Use a DOM node to create a new output target specifying
 * the child node where the result nodes should be inserted before.
 *
 * <p>In practice, {@code node} and {@code nextSibling} should be
 * a {@link org.w3c.dom.Document} node,
 * a {@link org.w3c.dom.DocumentFragment} node, or
 * a {@link org.w3c.dom.Element} node.
 * In other words, a node that accepts children.
 *
 * <p>Use {@code nextSibling} to specify the child node
 * where the result nodes should be inserted before.
 * If {@code nextSibling} is not a sibling of {@code node},
 * then an {@code IllegalArgumentException} is thrown.
 * If {@code node} is {@code null} and {@code nextSibling} is not {@code null},
 * then an {@code IllegalArgumentException} is thrown.
 * If {@code nextSibling} is {@code null},
 * then the behavior is the same as calling {@link #DOMResult(Node node)},
 * i.e. append the result nodes as the last child of the specified {@code node}.
 *
 * <p>{@code systemId} will be set to {@code null}.
 *
 * @param node The DOM node that will contain the result tree.
 * @param nextSibling The child node where the result nodes should be inserted before.
 *
 * @throws IllegalArgumentException If {@code nextSibling} is not a sibling of {@code node} or
 *   {@code node} is {@code null} and {@code nextSibling}
 *   is not {@code null}.
 *
 * @since 1.5
 */
public DOMResult(Node node, Node nextSibling) {

    // does the corrent parent/child relationship exist?
    if (nextSibling != null) {
        // cannot be a sibling of a null node
        if (node == null) {
            throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
        }

        // nextSibling contained by node?
        if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
            throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
        }
    }

    setNode(node);
    setNextSibling(nextSibling);
    setSystemId(null);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:50,代码来源:DOMResult.java


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