01: /* EmptyNamedNodeMap.java
02:
03: {{IS_NOTE
04:
05: Purpose:
06: Description:
07: History:
08: 2001/09/28 11:39:53, Create, Tom M. Yeh.
09: }}IS_NOTE
10:
11: Copyright (C) 2001 Potix Corporation. All Rights Reserved.
12:
13: {{IS_RIGHT
14: This program is distributed under GPL Version 2.0 in the hope that
15: it will be useful, but WITHOUT ANY WARRANTY.
16: }}IS_RIGHT
17: */
18: package org.zkoss.idom.impl;
19:
20: import org.w3c.dom.*;
21:
22: import org.zkoss.idom.*;
23: import org.zkoss.idom.DOMException;
24:
25: /**
26: * An empty NamedNodeMap.
27: *
28: * @author tomyeh
29: */
30: public class EmptyNamedNodeMap implements NamedNodeMap {
31: /** The ONLY instance of EmptyNamedNodeMap.
32: */
33: public static final NamedNodeMap THE = new EmptyNamedNodeMap();
34:
35: protected EmptyNamedNodeMap() {
36: }
37:
38: public int getLength() {
39: return 0;
40: }
41:
42: public Node getNamedItem(String name) {
43: return null;
44: }
45:
46: public Node getNamedItemNS(String namespaceURI, String localName) {
47: return null;
48: }
49:
50: public Node item(int index) {
51: return null;
52: }
53:
54: public Node removeNamedItem(String name) {
55: throw new DOMException(DOMException.NOT_FOUND_ERR);
56: }
57:
58: public Node removeNamedItemNS(String namespaceURI, String localName) {
59: throw new DOMException(DOMException.NOT_FOUND_ERR);
60: }
61:
62: public Node setNamedItem(Node arg) {
63: throw new DOMException(DOMException.INVALID_ACCESS_ERR);
64: }
65:
66: public Node setNamedItemNS(Node arg) {
67: throw new DOMException(DOMException.INVALID_ACCESS_ERR);
68: }
69: }
|