001: /*
002: * Java HTML Tidy - JTidy
003: * HTML parser and pretty printer
004: *
005: * Copyright (c) 1998-2000 World Wide Web Consortium (Massachusetts
006: * Institute of Technology, Institut National de Recherche en
007: * Informatique et en Automatique, Keio University). All Rights
008: * Reserved.
009: *
010: * Contributing Author(s):
011: *
012: * Dave Raggett <dsr@w3.org>
013: * Andy Quick <ac.quick@sympatico.ca> (translation to Java)
014: * Gary L Peskin <garyp@firstech.com> (Java development)
015: * Sami Lempinen <sami@lempinen.net> (release management)
016: * Fabrizio Giustina <fgiust at users.sourceforge.net>
017: *
018: * The contributing author(s) would like to thank all those who
019: * helped with testing, bug fixes, and patience. This wouldn't
020: * have been possible without all of you.
021: *
022: * COPYRIGHT NOTICE:
023: *
024: * This software and documentation is provided "as is," and
025: * the copyright holders and contributing author(s) make no
026: * representations or warranties, express or implied, including
027: * but not limited to, warranties of merchantability or fitness
028: * for any particular purpose or that the use of the software or
029: * documentation will not infringe any third party patents,
030: * copyrights, trademarks or other rights.
031: *
032: * The copyright holders and contributing author(s) will not be
033: * liable for any direct, indirect, special or consequential damages
034: * arising out of any use of the software or documentation, even if
035: * advised of the possibility of such damage.
036: *
037: * Permission is hereby granted to use, copy, modify, and distribute
038: * this source code, or portions hereof, documentation and executables,
039: * for any purpose, without fee, subject to the following restrictions:
040: *
041: * 1. The origin of this source code must not be misrepresented.
042: * 2. Altered versions must be plainly marked as such and must
043: * not be misrepresented as being the original source.
044: * 3. This Copyright notice may not be removed or altered from any
045: * source or altered source distribution.
046: *
047: * The copyright holders and contributing author(s) specifically
048: * permit, without fee, and encourage the use of this source code
049: * as a component for supporting the Hypertext Markup Language in
050: * commercial products. If you use this source code in a product,
051: * acknowledgment is not required but would be appreciated.
052: *
053: */
054:
055: package org.w3c.tidy;
056:
057: /**
058: * DOMDocumentTypeImpl.
059: * @author Dave Raggett <a href="mailto:dsr@w3.org">dsr@w3.org </a>
060: * @author Andy Quick <a href="mailto:ac.quick@sympatico.ca">ac.quick@sympatico.ca </a> (translation to Java)
061: * @author Fabrizio Giustina
062: * @version $Revision: 1.8 $ ($Author: fgiust $)
063: */
064: public class DOMDocumentTypeImpl extends DOMNodeImpl implements
065: org.w3c.dom.DocumentType {
066:
067: /**
068: * Instantiates a new DOM document type.
069: * @param adaptee Tidy Node
070: */
071: protected DOMDocumentTypeImpl(Node adaptee) {
072: super (adaptee);
073: }
074:
075: /**
076: * @see org.w3c.dom.Node#getNodeType
077: */
078: public short getNodeType() {
079: return org.w3c.dom.Node.DOCUMENT_TYPE_NODE;
080: }
081:
082: /**
083: * @see org.w3c.dom.Node#getNodeName
084: */
085: public String getNodeName() {
086: return getName();
087: }
088:
089: /**
090: * @see org.w3c.dom.DocumentType#getName
091: */
092: public String getName() {
093: String value = null;
094: if (adaptee.type == Node.DOCTYPE_TAG) {
095:
096: if (adaptee.textarray != null
097: && adaptee.start < adaptee.end) {
098: value = TidyUtils.getString(adaptee.textarray,
099: adaptee.start, adaptee.end - adaptee.start);
100: }
101: }
102: return value;
103: }
104:
105: /**
106: * @todo DOM level 2 getEntities() Not implemented. Returns null.
107: * @see org.w3c.dom.DocumentType#getEntities()
108: */
109: public org.w3c.dom.NamedNodeMap getEntities() {
110: return null;
111: }
112:
113: /**
114: * @todo DOM level 2 getNotations() Not implemented. Returns null.
115: * @see org.w3c.dom.DocumentType#getNotations()
116: */
117: public org.w3c.dom.NamedNodeMap getNotations() {
118: return null;
119: }
120:
121: /**
122: * @todo DOM level 2 getPublicId() Not implemented. Returns null.
123: * @see org.w3c.dom.DocumentType#getPublicId()
124: */
125: public String getPublicId() {
126: return null;
127: }
128:
129: /**
130: * @todo DOM level 2 getSystemId() Not implemented. Returns null.
131: * @see org.w3c.dom.DocumentType#getSystemId()
132: */
133: public String getSystemId() {
134: return null;
135: }
136:
137: /**
138: * @todo DOM level 2 getInternalSubset() Not implemented. Returns null.
139: * @see org.w3c.dom.DocumentType#getInternalSubset()
140: */
141: public String getInternalSubset() {
142: return null;
143: }
144:
145: }
|