01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.core;
15:
16: import org.w3c.dom.Node;
17:
18: /**
19: * Is a wrapper of an <code>org.w3c.dom.Node</code>. Use this interface to identify when an
20: * <code>org.w3c.dom.Node</code> instance is an ItsNat wrapper or the original Xerces node.
21: *
22: * <p>An ItsNatNode <code>node</code> object must satisfy the following rules:</p>
23: *
24: * <ol>
25: * <li><code>node.equals(node.getNode())</code> is ever true.</li>
26: * <li><code>node.hashCode() == node.getNode().hashCode()</code> is ever true.</li>
27: * </ol>
28: *
29: * <p>Current implementations can be casted to <code>org.w3c.dom.Node</code> and
30: * <code>org.w3c.dom.events.EventTarget</code>. Can be casted to
31: * <code>org.w3c.dom.Element</code> and
32: * <code>org.w3c.dom.css.ElementCSSInlineStyle</code> if the original node is an
33: * <code>org.w3c.dom.Element</code>.
34: *
35: * <p><code>org.w3c.dom.events.EventTarget</code> methods are not the original Xerces methods, they are shortcuts
36: * to {@link ItsNatDocument#addEventListener(org.w3c.dom.events.EventTarget,String,EventListener,boolean useCapture)},
37: * {@link ItsNatDocument#removeEventListener(org.w3c.dom.events.EventTarget,String,EventListener,boolean useCapture)}
38: * and {@link ItsNatDocument#dispatchEvent(org.w3c.dom.events.EventTarget,org.w3c.dom.events.Event)} methods.
39: * </p>
40: *
41: * @see ItsNatDocument#getItsNatNode(org.w3c.dom.Node)
42: */
43: public interface ItsNatNode {
44: /**
45: * Returns the wrapped node.
46: *
47: * @return the wrapped node. Never is null.
48: */
49: public Node getNode();
50: }
|