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 public interface Node extends org.w3c.dom.Node {
35 /**
36 * Returns the value of this node if this is a <code>Text</code> node or the
37 * value of the immediate child of this node otherwise.
38 * If there is an immediate child of this <code>Node</code> that it is a
39 * <code>Text</code> node then it's value will be returned. If there is
40 * more than one <code>Text</code> node then the value of the first
41 * <code>Text</code> Node will be returned.
42 * Otherwise <code>null</code> is returned.
43 *
44 * @return a <code>String</code> with the text of this node if this is a
45 * <code>Text</code> node or the text contained by the first
46 * immediate child of this <code>Node</code> object that is a
47 * <code>Text</code> object if such a child exists;
48 * <code>null</code> otherwise.
49 */
50 public String getValue();
51
52 /**
53 * If this is a Text node then this method will set its value,
54 * otherwise it sets the value of the immediate (Text) child of this node.
55 * The value of the immediate child of this node can be set only if, there is
56 * one child node and that node is a <code>Text</code> node, or if
57 * there are no children in which case a child <code>Text</code> node will be
58 * created.
59 *
60 * @exception IllegalStateException if the node is not a <code>Text</code>
61 * node and either has more than one child node or has a child
62 * node that is not a <code>Text</code> node.
63 *
64 * @since SAAJ 1.2
65 */
66 public void setValue(String value);
67
68 /**
69 * Sets the parent of this <code>Node</code> object to the given
70 * <code>SOAPElement</code> object.
71 *
72 * @param parent the <code>SOAPElement</code> object to be set as
73 * the parent of this <code>Node</code> object
74 *
75 * @exception SOAPException if there is a problem in setting the
76 * parent to the given element
77 * @see #getParentElement
78 */
79 public void setParentElement(SOAPElement parent) throws SOAPException;
80
81 /**
82 * Returns the parent element of this <code>Node</code> object.
83 * This method can throw an <code>UnsupportedOperationException</code>
84 * if the tree is not kept in memory.
|
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</code> node or the
39 * value of the immediate child of this node otherwise.
40 * If there is an immediate child of this <code>Node</code> that it is a
41 * <code>Text</code> node then it's value will be returned. If there is
42 * more than one <code>Text</code> node then the value of the first
43 * <code>Text</code> Node will be returned.
44 * Otherwise <code>null</code> is returned.
45 *
46 * @return a <code>String</code> with the text of this node if this is a
47 * <code>Text</code> node or the text contained by the first
48 * immediate child of this <code>Node</code> object that is a
49 * <code>Text</code> object if such a child exists;
50 * <code>null</code> 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</code> node, or if
59 * there are no children in which case a child <code>Text</code> node will be
60 * created.
61 *
62 * @exception IllegalStateException if the node is not a <code>Text</code>
63 * node and either has more than one child node or has a child
64 * node that is not a <code>Text</code> 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</code> object to the given
72 * <code>SOAPElement</code> object.
73 *
74 * @param parent the <code>SOAPElement</code> object to be set as
75 * the parent of this <code>Node</code> 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;
82
83 /**
84 * Returns the parent element of this <code>Node</code> object.
85 * This method can throw an <code>UnsupportedOperationException</code>
86 * if the tree is not kept in memory.
|