0N/A/*
2362N/A * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A/*
0N/A * $Id: DOMStructure.java,v 1.6 2005/05/09 18:33:26 mullan Exp $
0N/A */
0N/Apackage javax.xml.crypto.dom;
0N/A
0N/Aimport org.w3c.dom.Node;
0N/Aimport javax.xml.crypto.XMLStructure;
0N/Aimport javax.xml.crypto.dsig.XMLSignature;
0N/A
0N/A/**
0N/A * A DOM-specific {@link XMLStructure}. The purpose of this class is to
0N/A * allow a DOM node to be used to represent extensible content (any elements
0N/A * or mixed content) in XML Signature structures.
0N/A *
0N/A * <p>If a sequence of nodes is needed, the node contained in the
0N/A * <code>DOMStructure</code> is the first node of the sequence and successive
0N/A * nodes can be accessed by invoking {@link Node#getNextSibling}.
0N/A *
0N/A * <p>If the owner document of the <code>DOMStructure</code> is different than
0N/A * the target document of an <code>XMLSignature</code>, the
0N/A * {@link XMLSignature#sign(XMLSignContext)} method imports the node into the
0N/A * target document before generating the signature.
0N/A *
0N/A * @author Sean Mullan
0N/A * @author JSR 105 Expert Group
0N/A * @since 1.6
0N/A */
0N/Apublic class DOMStructure implements XMLStructure {
0N/A
0N/A private final Node node;
0N/A
0N/A /**
0N/A * Creates a <code>DOMStructure</code> containing the specified node.
0N/A *
0N/A * @param node the node
0N/A * @throws NullPointerException if <code>node</code> is <code>null</code>
0N/A */
0N/A public DOMStructure(Node node) {
0N/A if (node == null) {
0N/A throw new NullPointerException("node cannot be null");
0N/A }
0N/A this.node = node;
0N/A }
0N/A
0N/A /**
0N/A * Returns the node contained in this <code>DOMStructure</code>.
0N/A *
0N/A * @return the node
0N/A */
0N/A public Node getNode() {
0N/A return node;
0N/A }
0N/A
0N/A /**
0N/A * @throws NullPointerException {@inheritDoc}
0N/A */
0N/A public boolean isFeatureSupported(String feature) {
0N/A if (feature == null) {
0N/A throw new NullPointerException();
0N/A } else {
0N/A return false;
0N/A }
0N/A }
0N/A}