1 /* 2 * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.xml.soap; 27 28 /** 29 * A representation of a node (element) in an XML document. 30 * This interface extnends the standard DOM Node interface with methods for 31 * getting and setting the value of a node, for 32 * getting and setting the parent of a node, and for removing a node. 33 * 34 * @since 1.6 35 */ 36 public interface Node extends org.w3c.dom.Node { 37 /** 38 * Returns the value of this node if this is a {@code Text} node or the 39 * value of the immediate child of this node otherwise. 40 * If there is an immediate child of this {@code Node} that it is a 41 * {@code Text} node then it's value will be returned. If there is 42 * more than one {@code Text} node then the value of the first 43 * {@code Text} Node will be returned. 44 * Otherwise {@code null} is returned. 45 * 46 * @return a {@code String} with the text of this node if this is a 47 * {@code Text} node or the text contained by the first 48 * immediate child of this {@code Node} object that is a 49 * {@code Text} object if such a child exists; 50 * {@code null} otherwise. 51 */ 52 public String getValue(); 53 54 /** 55 * If this is a Text node then this method will set its value, 56 * otherwise it sets the value of the immediate (Text) child of this node. 57 * The value of the immediate child of this node can be set only if, there is 58 * one child node and that node is a {@code Text} node, or if 59 * there are no children in which case a child {@code Text} node will be 60 * created. 61 * 62 * @exception IllegalStateException if the node is not a {@code Text} 63 * node and either has more than one child node or has a child 64 * node that is not a {@code Text} node. 65 * 66 * @since 1.6, SAAJ 1.2 67 */ 68 public void setValue(String value); 69 70 /** 71 * Sets the parent of this {@code Node} object to the given 72 * {@code SOAPElement} object. 73 * 74 * @param parent the {@code SOAPElement} object to be set as 75 * the parent of this {@code Node} object 76 * 77 * @exception SOAPException if there is a problem in setting the 78 * parent to the given element 79 * @see #getParentElement 80 */ 81 public void setParentElement(SOAPElement parent) throws SOAPException; | 1 /* 2 * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.xml.soap; 27 28 /** 29 * A representation of a node (element) in an XML document. 30 * This interface extends the standard DOM Node interface with methods for 31 * getting and setting the value of a node, for 32 * getting and setting the parent of a node, and for removing a node. 33 * 34 * @since 1.6 35 */ 36 public interface Node extends org.w3c.dom.Node { 37 /** 38 * Returns the value of this node if this is a {@code Text} node or the 39 * value of the immediate child of this node otherwise. 40 * If there is an immediate child of this {@code Node} that it is a 41 * {@code Text} node then it's value will be returned. If there is 42 * more than one {@code Text} node then the value of the first 43 * {@code Text} Node will be returned. 44 * Otherwise {@code null} is returned. 45 * 46 * @return a {@code String} with the text of this node if this is a 47 * {@code Text} node or the text contained by the first 48 * immediate child of this {@code Node} object that is a 49 * {@code Text} object if such a child exists; 50 * {@code null} otherwise. 51 */ 52 public String getValue(); 53 54 /** 55 * If this is a Text node then this method will set its value, 56 * otherwise it sets the value of the immediate (Text) child of this node. 57 * The value of the immediate child of this node can be set only if, there is 58 * one child node and that node is a {@code Text} node, or if 59 * there are no children in which case a child {@code Text} node will be 60 * created. 61 * 62 * @param value {@code value} to set on the {@code Text} node 63 * @exception IllegalStateException if the node is not a {@code Text} 64 * node and either has more than one child node or has a child 65 * node that is not a {@code Text} node. 66 * 67 * @since 1.6, SAAJ 1.2 68 */ 69 public void setValue(String value); 70 71 /** 72 * Sets the parent of this {@code Node} object to the given 73 * {@code SOAPElement} object. 74 * 75 * @param parent the {@code SOAPElement} object to be set as 76 * the parent of this {@code Node} object 77 * 78 * @exception SOAPException if there is a problem in setting the 79 * parent to the given element 80 * @see #getParentElement 81 */ 82 public void setParentElement(SOAPElement parent) throws SOAPException; |