001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.tax.dom;
043:
044: import java.util.Iterator;
045: import org.w3c.dom.*;
046: import org.netbeans.tax.*;
047: import org.netbeans.tax.TreeObjectList;
048:
049: /**
050: *
051: * @author Rich Unger
052: */
053: class DocumentTypeImpl extends NodeImpl implements DocumentType {
054:
055: private final TreeDocumentType peer;
056:
057: /** Creates a new instance of DocumentTypeImpl */
058: public DocumentTypeImpl(TreeDocumentType peer) {
059: this .peer = peer;
060: }
061:
062: public String getName() {
063: return peer.getElementName();
064: }
065:
066: public NamedNodeMap getEntities() {
067: return null;
068: }
069:
070: public NamedNodeMap getNotations() {
071: return null;
072: }
073:
074: public String getPublicId() {
075: return peer.getPublicId();
076: }
077:
078: public String getSystemId() {
079: return peer.getSystemId();
080: }
081:
082: public String getInternalSubset() {
083: return null;
084: }
085:
086: /** The name of this node, depending on its type; see the table above.
087: *
088: */
089: public String getNodeName() {
090: return peer.getElementName();
091: }
092:
093: /** A code representing the type of the underlying object, as defined above.
094: *
095: */
096: public short getNodeType() {
097: return Node.DOCUMENT_TYPE_NODE;
098: }
099:
100: /** The value of this node, depending on its type; see the table above.
101: * When it is defined to be <code>null</code>, setting it has no effect.
102: * @exception DOMException
103: * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
104: * @exception DOMException
105: * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
106: * fit in a <code>DOMString</code> variable on the implementation
107: * platform.
108: *
109: */
110: public String getNodeValue() throws DOMException {
111: return null;
112: }
113:
114: /** The parent of this node. All nodes, except <code>Attr</code>,
115: * <code>Document</code>, <code>DocumentFragment</code>,
116: * <code>Entity</code>, and <code>Notation</code> may have a parent.
117: * However, if a node has just been created and not yet added to the
118: * tree, or if it has been removed from the tree, this is
119: * <code>null</code>.
120: *
121: */
122: public Node getParentNode() {
123: return Wrapper.wrap(peer.getParentNode());
124: }
125:
126: /** The first child of this node. If there is no such node, this returns
127: * <code>null</code>.
128: *
129: */
130: public Node getFirstChild() {
131: return null;
132: }
133:
134: /** The last child of this node. If there is no such node, this returns
135: * <code>null</code>.
136: *
137: */
138: public Node getLastChild() {
139: return null;
140: }
141:
142: /** Returns whether this node has any children.
143: * @return <code>true</code> if this node has any children,
144: * <code>false</code> otherwise.
145: *
146: */
147: public boolean hasChildNodes() {
148: return false;
149: }
150:
151: /** A <code>NodeList</code> that contains all children of this node. If
152: * there are no children, this is a <code>NodeList</code> containing no
153: * nodes.
154: *
155: */
156: public NodeList getChildNodes() {
157: return Wrapper.wrap(peer.getChildNodes());
158: }
159:
160: }
|