Home | History | Annotate | Download | only in dom

Lines Matching refs:node

23 import org.w3c.dom.Node;
28 * <p>If no output DOM source is set, the transformation will create a Document node as the holder for the result of the transformation,
45 * <p><code>node</code>,
57 * <p>Use a DOM node to create a new output target.</p>
59 * <p>In practice, the node should be
60 * a {@link org.w3c.dom.Document} node,
61 * a {@link org.w3c.dom.DocumentFragment} node, or
62 * a {@link org.w3c.dom.Element} node.
63 * In other words, a node that accepts children.</p>
69 * @param node The DOM node that will contain the result tree.
71 public DOMResult(Node node) {
72 setNode(node);
78 * <p>Use a DOM node to create a new output target with the specified System ID.<p>
80 * <p>In practice, the node should be
81 * a {@link org.w3c.dom.Document} node,
82 * a {@link org.w3c.dom.DocumentFragment} node, or
83 * a {@link org.w3c.dom.Element} node.
84 * In other words, a node that accepts children.</p>
88 * @param node The DOM node that will contain the result tree.
89 * @param systemId The system identifier which may be used in association with this node.
91 public DOMResult(Node node, String systemId) {
92 setNode(node);
98 * <p>Use a DOM node to create a new output target specifying the child node where the result nodes should be inserted before.</p>
100 * <p>In practice, <code>node</code> and <code>nextSibling</code> should be
101 * a {@link org.w3c.dom.Document} node,
102 * a {@link org.w3c.dom.DocumentFragment} node, or
103 * a {@link org.w3c.dom.Element} node.
104 * In other words, a node that accepts children.</p>
106 * <p>Use <code>nextSibling</code> to specify the child node
108 * If <code>nextSibling</code> is not a sibling of <code>node</code>,
110 * If <code>node</code> is <code>null</code> and <code>nextSibling</code> is not <code>null</code>,
113 * then the behavior is the same as calling {@link #DOMResult(Node node)},
114 * i.e. append the result nodes as the last child of the specified <code>node</code>.</p>
118 * @param node The DOM node that will contain the result tree.
119 * @param nextSibling The child node where the result nodes should be inserted before.
121 * @throws IllegalArgumentException If <code>nextSibling</code> is not a sibling of <code>node</code>.
122 * @throws IllegalArgumentException If <code>node</code> is <code>null</code> and <code>nextSibling</code> is not <code>null</code>.
126 public DOMResult(Node node, Node nextSibling) {
130 // cannot be a sibling of a null node
131 if (node == null) {
132 throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
135 // nextSibling contained by node?
136 if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
137 throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
141 setNode(node);
147 * <p>Use a DOM node to create a new output target specifying the child node where the result nodes should be inserted before and
150 * <p>In practice, <code>node</code> and <code>nextSibling</code> should be
151 * a {@link org.w3c.dom.Document} node,
152 * a {@link org.w3c.dom.DocumentFragment} node, or a
153 * {@link org.w3c.dom.Element} node.
154 * In other words, a node that accepts children.</p>
156 * <p>Use <code>nextSibling</code> to specify the child node
158 * If <code>nextSibling</code> is not a sibling of <code>node</code>,
160 * If <code>node</code> is <code>null</code> and <code>nextSibling</code> is not <code>null</code>,
163 * then the behavior is the same as calling {@link #DOMResult(Node node, String systemId)},
164 * i.e. append the result nodes as the last child of the specified node and use the specified System ID.</p>
166 * @param node The DOM node that will contain the result tree.
167 * @param nextSibling The child node where the result nodes should be inserted before.
168 * @param systemId The system identifier which may be used in association with this node.
170 * @throws IllegalArgumentException If <code>nextSibling</code> is not a sibling of <code>node</code>.
171 * @throws IllegalArgumentException If <code>node</code> is <code>null</code> and <code>nextSibling</code> is not <code>null</code>.
175 public DOMResult(Node node, Node nextSibling, String systemId) {
179 // cannot be a sibling of a null node
180 if (node == null) {
181 throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
184 // nextSibling contained by node?
185 if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
186 throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
190 setNode(node);
196 * <p>Set the node that will contain the result DOM tree.<p>
198 * <p>In practice, the node should be
199 * a {@link org.w3c.dom.Document} node,
200 * a {@link org.w3c.dom.DocumentFragment} node, or
201 * a {@link org.w3c.dom.Element} node.
202 * In other words, a node that accepts children.</p>
205 * <code>node</code> is not a parent of <code>nextSibling</code>.
206 * An <code>IllegalStateException</code> is thrown if <code>node</code> is <code>null</code> and
209 * @param node The node to which the transformation will be appended.
212 * <code>nextSibling</code> is not a child of <code>node</code>.
213 * @throws IllegalStateException If <code>node</code> is <code>null</code> and
216 public void setNode(Node node) {
219 // cannot be a sibling of a null node
220 if (node == null) {
221 throw new IllegalStateException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
224 // nextSibling contained by node?
225 if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
226 throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
230 this.node = node;
234 * <p>Get the node that will contain the result DOM tree.</p>
236 * <p>If no node was set via
237 * {@link #DOMResult(Node node)},
238 * {@link #DOMResult(Node node, String systeId)},
239 * {@link #DOMResult(Node node, Node nextSibling)},
240 * {@link #DOMResult(Node node, Node nextSibling, String systemId)} or
241 * {@link #setNode(Node node)},
242 * then the node will be set by the transformation, and may be obtained from this method once the transformation is complete.
245 * @return The node to which the transformation will be appended.
247 public Node getNode() {
248 return node;
252 * <p>Set the child node before which the result nodes will be inserted.</p>
254 * <p>Use <code>nextSibling</code> to specify the child node
256 * If <code>nextSibling</code> is not a descendant of <code>node</code>,
258 * If <code>node</code> is <code>null</code> and <code>nextSibling</code> is not <code>null</code>,
261 * then the behavior is the same as calling {@link #DOMResult(Node node)},
262 * i.e. append the result nodes as the last child of the specified <code>node</code>.</p>
264 * @param nextSibling The child node before which the result nodes will be inserted.
266 * @throws IllegalArgumentException If <code>nextSibling</code> is not a descendant of <code>node</code>.
267 * @throws IllegalStateException If <code>node</code> is <code>null</code> and <code>nextSibling</code> is not <code>null</code>.
271 public void setNextSibling(Node nextSibling) {
275 // cannot be a sibling of a null node
276 if (node == null) {
277 throw new IllegalStateException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
280 // nextSibling contained by node?
281 if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
282 throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
290 * <p>Get the child node before which the result nodes will be inserted.</p>
292 * <p>If no node was set via
293 * {@link #DOMResult(Node node, Node nextSibling)},
294 * {@link #DOMResult(Node node, Node nextSibling, String systemId)} or
295 * {@link #setNextSibling(Node nextSibling)},
298 * @return The child node before which the result nodes will be inserted.
302 public Node getNextSibling() {
307 * <p>Set the systemId that may be used in association with the node.</p>
319 * {@link #DOMResult(Node node, String systemId)},
320 * {@link #DOMResult(Node node, Node nextSibling, String systemId)} or
335 * <p>The node to which the transformation will be appended.</p>
337 private Node node = null;
340 * <p>The child node before which the result nodes will be inserted.</p>
344 private Node nextSibling = null;
347 * <p>The System ID that may be used in association with the node.</p>