56
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
package org.w3c.dom;
|
|
19 |
|
|
20 |
/**
|
|
21 |
* The Node interface describes generic nodes in an SVG document tree.
|
|
22 |
*
|
|
23 |
* <p>This interface is a subset of the Node interface defined
|
|
24 |
* in the <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html">
|
|
25 |
* DOM Level 3 Core</a>.</p>
|
|
26 |
*
|
|
27 |
*/
|
|
28 |
|
|
29 |
public interface Node
|
|
30 |
{
|
|
31 |
|
|
32 |
|
|
33 |
/**
|
|
34 |
* Returns the namespace URI of the Node.
|
|
35 |
*
|
|
36 |
* @return the namespace URI of the Node.
|
|
37 |
* @throws SecurityException if the application does not have the necessary privilege rights
|
|
38 |
* to access this (SVG) content.
|
|
39 |
*/
|
|
40 |
public String getNamespaceURI();
|
|
41 |
|
|
42 |
/**
|
|
43 |
* Returns the local part of the qualified name of this node. If the node is of type SVGElement, this returns the tag name without a prefix.
|
|
44 |
* But, if the node is of type Document then <code>null</code> is returned.
|
|
45 |
* @return the local part of the qualified name of this node.
|
|
46 |
* @throws SecurityException if the application does not have the necessary privilege rights
|
|
47 |
* to access this (SVG) content.
|
|
48 |
*/
|
|
49 |
|
|
50 |
public String getLocalName();
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Returns the parent <code>Node</code> of this <code>Node</code>.
|
|
54 |
*
|
|
55 |
* @return the parent node or null if there is no parent (i.e. if a node has
|
|
56 |
* just been created and not yet added to the tree, or if it has been removed
|
|
57 |
* from the tree, this is null).
|
|
58 |
* @throws SecurityException if the application does not have the necessary privilege rights
|
|
59 |
* to access this (SVG) content.
|
|
60 |
*/
|
|
61 |
|
|
62 |
public Node getParentNode();
|
|
63 |
|
|
64 |
/**
|
|
65 |
* Appends a child to this <code>Node</code>.
|
|
66 |
*
|
|
67 |
* @param newChild the <code>Node</code> to be appended to this
|
|
68 |
* <code>Node</code>. This is equivalent to insertBefore(newChild,null)
|
|
69 |
* @return the added <code>Node</code>.
|
|
70 |
*
|
|
71 |
* @throws DOMException with error code HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children
|
|
72 |
* of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself,
|
|
73 |
* or if this node is of type Document and the DOM application attempts to append a second Element node.
|
|
74 |
* @throws DOMException with error code WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than
|
|
75 |
* the one that created this node.
|
|
76 |
* @throws DOMException with error code NOT_SUPPORTED_ERR: if the newChild node is a child of the Document node or if the
|
|
77 |
* child is of a type that cannot be created with createElementNS.
|
|
78 |
* @throws DOMException with error code INVALID_STATE_ERR: if the newChild node would cause the document to go into
|
|
79 |
* error, for ex: when the newChild contains a <use> element with an invalid xlink:href attribute.
|
|
80 |
* @throws NullPointerException if <code>newChild</code> is null.
|
|
81 |
* @throws SecurityException if the application does not have the necessary privilege rights
|
|
82 |
* to access this (SVG) content.
|
|
83 |
*/
|
|
84 |
|
|
85 |
public Node appendChild(Node newChild) throws DOMException;
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Removes the specified child associated with this Node. Elements that have ids cannot be
|
|
89 |
* removed from the tree.
|
|
90 |
*
|
|
91 |
* @param oldChild the <code>Node</code> that is to be removed.
|
|
92 |
* @return the node removed.
|
|
93 |
* @throws DOMException with error code NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
|
|
94 |
* @throws DOMException with error code NOT_SUPPORTED_ERR: if this node is of type Document or if the
|
|
95 |
* child, or any of its descendants, is of a type that cannot be created with createElementNS.
|
|
96 |
* @throws DOMException with error code INVALID_ACCESS_ERR: if the element being removed or one of its decendants
|
|
97 |
* have non-null id.
|
|
98 |
* @throws NullPointerException if <code>oldChild</code> is null.
|
|
99 |
* @throws SecurityException if the application does not have the necessary privilege rights
|
|
100 |
* to access this (SVG) content.
|
|
101 |
*/
|
|
102 |
|
|
103 |
public Node removeChild(Node oldChild) throws DOMException;
|
|
104 |
|
|
105 |
/**
|
|
106 |
* Inserts newChild before refChild in the child list for this node. If refChild is null,
|
|
107 |
* newChild is inserted at the end of the list. If the newChild is already part of the
|
|
108 |
* tree, it is first removed.
|
|
109 |
*
|
|
110 |
*
|
|
111 |
* @param newChild the child to add
|
|
112 |
* @param refChild the child before which the new child should be added.
|
|
113 |
* @return the node being inserted.
|
|
114 |
* @throws DOMException with error code HIERARCHY_REQUEST_ERR: if this node is of a type that does not allow children
|
|
115 |
* of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself,
|
|
116 |
* or if this node is of type Document and the DOM application attempts to append a second Element node.
|
|
117 |
* @throws DOMException with error code WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than
|
|
118 |
* the one that created this node.
|
|
119 |
* @throws DOMException with error code NOT_FOUND_ERR: raised if refChild is not a child of this node.
|
|
120 |
* @throws DOMException with error code NOT_SUPPORTED_ERR: if the newChild node is a child of the Document node or if the
|
|
121 |
* child is of a type that cannot be created with createElementNS.
|
|
122 |
* @throws DOMException with error code INVALID_STATE_ERR: if the newChild node would cause the document to go into
|
|
123 |
* error, for ex: when the newChild contains a <use> element with an invalid xlink:href attribute.
|
|
124 |
* @throws NullPointerException if <code>newChild</code> is null.
|
|
125 |
* @throws SecurityException if the application does not have the necessary privilege rights
|
|
126 |
* to access this (SVG) content.
|
|
127 |
*/
|
|
128 |
|
|
129 |
public Node insertBefore(Node newChild, Node refChild) throws DOMException;
|
|
130 |
|
|
131 |
|
|
132 |
}
|