325N/A/*
325N/A * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
325N/A *
325N/A * This code is free software; you can redistribute it and/or modify it
325N/A * under the terms of the GNU General Public License version 2 only, as
325N/A * published by the Free Software Foundation. Oracle designates this
325N/A * particular file as subject to the "Classpath" exception as provided
325N/A * by Oracle in the LICENSE file that accompanied this code.
325N/A *
325N/A * This code is distributed in the hope that it will be useful, but WITHOUT
325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
325N/A * version 2 for more details (a copy is included in the LICENSE file that
325N/A * accompanied this code).
325N/A *
325N/A * You should have received a copy of the GNU General Public License version
325N/A * 2 along with this work; if not, write to the Free Software Foundation,
325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
325N/A *
325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
325N/A * or visit www.oracle.com if you need additional information or have any
325N/A * questions.
325N/A */
325N/A
325N/Apackage javax.xml.soap;
325N/A
325N/A/**
325N/A * A representation of a node (element) in an XML document.
325N/A * This interface extnends the standard DOM Node interface with methods for
325N/A * getting and setting the value of a node, for
325N/A * getting and setting the parent of a node, and for removing a node.
325N/A */
325N/Apublic interface Node extends org.w3c.dom.Node {
325N/A /**
325N/A * Returns the value of this node if this is a <code>Text</code> node or the
325N/A * value of the immediate child of this node otherwise.
325N/A * If there is an immediate child of this <code>Node</code> that it is a
325N/A * <code>Text</code> node then it's value will be returned. If there is
325N/A * more than one <code>Text</code> node then the value of the first
325N/A * <code>Text</code> Node will be returned.
325N/A * Otherwise <code>null</code> is returned.
325N/A *
325N/A * @return a <code>String</code> with the text of this node if this is a
325N/A * <code>Text</code> node or the text contained by the first
325N/A * immediate child of this <code>Node</code> object that is a
325N/A * <code>Text</code> object if such a child exists;
325N/A * <code>null</code> otherwise.
325N/A */
325N/A public String getValue();
325N/A
325N/A /**
325N/A * If this is a Text node then this method will set its value,
325N/A * otherwise it sets the value of the immediate (Text) child of this node.
325N/A * The value of the immediate child of this node can be set only if, there is
325N/A * one child node and that node is a <code>Text</code> node, or if
325N/A * there are no children in which case a child <code>Text</code> node will be
325N/A * created.
325N/A *
325N/A * @exception IllegalStateException if the node is not a <code>Text</code>
325N/A * node and either has more than one child node or has a child
325N/A * node that is not a <code>Text</code> node.
325N/A *
325N/A * @since SAAJ 1.2
325N/A */
325N/A public void setValue(String value);
325N/A
325N/A /**
325N/A * Sets the parent of this <code>Node</code> object to the given
325N/A * <code>SOAPElement</code> object.
325N/A *
325N/A * @param parent the <code>SOAPElement</code> object to be set as
325N/A * the parent of this <code>Node</code> object
325N/A *
325N/A * @exception SOAPException if there is a problem in setting the
325N/A * parent to the given element
325N/A * @see #getParentElement
325N/A */
325N/A public void setParentElement(SOAPElement parent) throws SOAPException;
325N/A
325N/A /**
325N/A * Returns the parent element of this <code>Node</code> object.
325N/A * This method can throw an <code>UnsupportedOperationException</code>
325N/A * if the tree is not kept in memory.
325N/A *
325N/A * @return the <code>SOAPElement</code> object that is the parent of
325N/A * this <code>Node</code> object or <code>null</code> if this
325N/A * <code>Node</code> object is root
325N/A *
325N/A * @exception UnsupportedOperationException if the whole tree is not
325N/A * kept in memory
325N/A * @see #setParentElement
325N/A */
325N/A public SOAPElement getParentElement();
325N/A
325N/A /**
325N/A * Removes this <code>Node</code> object from the tree.
325N/A */
325N/A public void detachNode();
325N/A
325N/A /**
325N/A * Notifies the implementation that this <code>Node</code>
325N/A * object is no longer being used by the application and that the
325N/A * implementation is free to reuse this object for nodes that may
325N/A * be created later.
325N/A * <P>
325N/A * Calling the method <code>recycleNode</code> implies that the method
325N/A * <code>detachNode</code> has been called previously.
325N/A */
325N/A public void recycleNode();
325N/A
325N/A}