Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxws/src/share/jaxws_classes/javax/xml/soap/Node.java
38890 views
/*1* Copyright (c) 2004, 2012, 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*/2425package javax.xml.soap;2627/**28* A representation of a node (element) in an XML document.29* This interface extnends the standard DOM Node interface with methods for30* getting and setting the value of a node, for31* getting and setting the parent of a node, and for removing a node.32*/33public interface Node extends org.w3c.dom.Node {34/**35* Returns the value of this node if this is a <code>Text</code> node or the36* value of the immediate child of this node otherwise.37* If there is an immediate child of this <code>Node</code> that it is a38* <code>Text</code> node then it's value will be returned. If there is39* more than one <code>Text</code> node then the value of the first40* <code>Text</code> Node will be returned.41* Otherwise <code>null</code> is returned.42*43* @return a <code>String</code> with the text of this node if this is a44* <code>Text</code> node or the text contained by the first45* immediate child of this <code>Node</code> object that is a46* <code>Text</code> object if such a child exists;47* <code>null</code> otherwise.48*/49public String getValue();5051/**52* If this is a Text node then this method will set its value,53* otherwise it sets the value of the immediate (Text) child of this node.54* The value of the immediate child of this node can be set only if, there is55* one child node and that node is a <code>Text</code> node, or if56* there are no children in which case a child <code>Text</code> node will be57* created.58*59* @exception IllegalStateException if the node is not a <code>Text</code>60* node and either has more than one child node or has a child61* node that is not a <code>Text</code> node.62*63* @since SAAJ 1.264*/65public void setValue(String value);6667/**68* Sets the parent of this <code>Node</code> object to the given69* <code>SOAPElement</code> object.70*71* @param parent the <code>SOAPElement</code> object to be set as72* the parent of this <code>Node</code> object73*74* @exception SOAPException if there is a problem in setting the75* parent to the given element76* @see #getParentElement77*/78public void setParentElement(SOAPElement parent) throws SOAPException;7980/**81* Returns the parent element of this <code>Node</code> object.82* This method can throw an <code>UnsupportedOperationException</code>83* if the tree is not kept in memory.84*85* @return the <code>SOAPElement</code> object that is the parent of86* this <code>Node</code> object or <code>null</code> if this87* <code>Node</code> object is root88*89* @exception UnsupportedOperationException if the whole tree is not90* kept in memory91* @see #setParentElement92*/93public SOAPElement getParentElement();9495/**96* Removes this <code>Node</code> object from the tree.97*/98public void detachNode();99100/**101* Notifies the implementation that this <code>Node</code>102* object is no longer being used by the application and that the103* implementation is free to reuse this object for nodes that may104* be created later.105* <P>106* Calling the method <code>recycleNode</code> implies that the method107* <code>detachNode</code> has been called previously.108*/109public void recycleNode();110111}112113114