Path: blob/master/src/java.xml.crypto/share/classes/javax/xml/crypto/dom/DOMStructure.java
41161 views
/*1* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24/*25* $Id: DOMStructure.java,v 1.6 2005/05/09 18:33:26 mullan Exp $26*/27package javax.xml.crypto.dom;2829import org.w3c.dom.Node;30import javax.xml.crypto.XMLStructure;31import javax.xml.crypto.dsig.XMLSignature;3233/**34* A DOM-specific {@link XMLStructure}. The purpose of this class is to35* allow a DOM node to be used to represent extensible content (any elements36* or mixed content) in XML Signature structures.37*38* <p>If a sequence of nodes is needed, the node contained in the39* <code>DOMStructure</code> is the first node of the sequence and successive40* nodes can be accessed by invoking {@link Node#getNextSibling}.41*42* <p>If the owner document of the <code>DOMStructure</code> is different than43* the target document of an <code>XMLSignature</code>, the44* {@link XMLSignature#sign(XMLSignContext)} method imports the node into the45* target document before generating the signature.46*47* @author Sean Mullan48* @author JSR 105 Expert Group49* @since 1.650*/51public class DOMStructure implements XMLStructure {5253private final Node node;5455/**56* Creates a <code>DOMStructure</code> containing the specified node.57*58* @param node the node59* @throws NullPointerException if <code>node</code> is <code>null</code>60*/61public DOMStructure(Node node) {62if (node == null) {63throw new NullPointerException("node cannot be null");64}65this.node = node;66}6768/**69* Returns the node contained in this <code>DOMStructure</code>.70*71* @return the node72*/73public Node getNode() {74return node;75}7677/**78* @throws NullPointerException {@inheritDoc}79*/80public boolean isFeatureSupported(String feature) {81if (feature == null) {82throw new NullPointerException();83} else {84return false;85}86}87}888990