01: /* EntityReference.java
02:
03: {{IS_NOTE
04:
05: Purpose:
06: Description:
07: History:
08: 2001/10/22 20:51:27, 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;
19:
20: import org.zkoss.lang.Objects;
21: import org.zkoss.idom.impl.*;
22:
23: /**
24: * The iDOM entity reference.
25: *
26: * @author tomyeh
27: */
28: public class EntityReference extends AbstractGroup implements
29: org.w3c.dom.EntityReference {
30: /** The name. */
31: protected String _name;
32:
33: /** Constructor.
34: */
35: public EntityReference(String name) {
36: setName(name);
37: }
38:
39: /** Constructor.
40: */
41: protected EntityReference() {
42: }
43:
44: //-- Item --//
45: public final String getName() {
46: return _name;
47: }
48:
49: public final void setName(String name) {
50: checkWritable();
51: if (!Objects.equals(_name, name)) {
52: Verifier.checkXMLName(name, getLocator());
53: _name = name;
54: setModified();
55: }
56: }
57:
58: //-- Node --//
59: public final short getNodeType() {
60: return ENTITY_REFERENCE_NODE;
61: }
62:
63: //-- Object --//
64: public String toString() {
65: return "[EntityReference: &" + _name + ";]";
66: }
67: }
|