001: package com.rimfaxe.xml.compatibility;
002:
003: import org.w3c.dom.Node;
004: import org.w3c.dom.UserDataHandler;
005:
006: /**
007: * Standard wrapper around spartan Node.
008:
009: <blockquote><small> Copyright (C) 2002 Hewlett-Packard Company.
010: This file is part of Sparta, an XML Parser, DOM, and XPath library.
011: This library is free software; you can redistribute it and/or
012: modify it under the terms of the <a href="doc-files/LGPL.txt">GNU
013: Lesser General Public License</a> as published by the Free Software
014: Foundation; either version 2.1 of the License, or (at your option)
015: any later version. This library is distributed in the hope that it
016: will be useful, but WITHOUT ANY WARRANTY; without even the implied
017: warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
018: PURPOSE. </small></blockquote>
019: @version $Date: 2002/11/06 02:59:55 $ $Revision: 1.2 $
020: @author Eamonn O'Brien-Strain
021: */
022:
023: public abstract class NodeImpl implements Node {
024:
025: public org.w3c.dom.Document getOwnerDocument() {
026: return doc_;
027: }
028:
029: public boolean equals(Object obj) {
030: if (obj instanceof NodeImpl) {
031: NodeImpl that = (NodeImpl) obj;
032: return this .spartan_.equals(that.spartan_);
033: } else
034: return false;
035: }
036:
037: public org.w3c.dom.Node getNextSibling() {
038: return spartan_.getNextSibling() == null ? null : doc_
039: .wrapper(spartan_.getNextSibling());
040: }
041:
042: public org.w3c.dom.Node getPreviousSibling() {
043: /**@todo: Implement this org.w3c.dom.Node method*/
044: throw new Error("getPreviousSibling not yet implemented");
045: }
046:
047: //////////////////////////////////////////////////////////////
048: // BEGIN DOM 3
049:
050: public String getBaseURI() {
051: throw new Error("not implemented");
052: }
053:
054: public short compareTreePosition(Node other) {
055: throw new Error("not implemented");
056: }
057:
058: public String getTextContent() throws org.w3c.dom.DOMException {
059: throw new Error("not implemented");
060: }
061:
062: public void setTextContent(String textContent)
063: throws org.w3c.dom.DOMException {
064: throw new Error("not implemented");
065: }
066:
067: public boolean isSameNode(Node other) {
068: throw new Error("not implemented");
069: }
070:
071: public String lookupNamespacePrefix(String namespaceURI) {
072: throw new Error("not implemented");
073: }
074:
075: public String lookupNamespaceURI(String prefix) {
076: throw new Error("not implemented");
077: }
078:
079: public boolean isEqualNode(Node arg, boolean deep) {
080: throw new Error("not implemented");
081: }
082:
083: public Node getInterface(String feature) {
084: throw new Error("not implemented");
085: }
086:
087: public Object setUserData(String key, Object data,
088: UserDataHandler handler) {
089: throw new Error("not implemented");
090: }
091:
092: public Object getUserData(String key) {
093: throw new Error("not implemented");
094: }
095:
096: //END DOM 3
097: //////////////////////////////////////////////////////////////////
098:
099: protected NodeImpl(DocumentImpl doc,
100: com.rimfaxe.xml.xmlreader.Node spartan) {
101: spartan_ = spartan;
102: doc_ = doc;
103: }
104:
105: com.rimfaxe.xml.xmlreader.Node getSpartan() {
106: return spartan_;
107: }
108:
109: /**
110: * @link aggregation
111: * @label spartan
112: */
113: private final com.rimfaxe.xml.xmlreader.Node spartan_;
114: private final DocumentImpl doc_;
115:
116: /////////////////////////////////////////////////
117:
118: /*
119: static NodeImpl wrapper(
120: DocumentImpl doc,
121: com.rimfaxe.xml.xmlreader.Node spartan
122: )
123: {
124: NodeImpl result = (NodeImpl)spartan.getAnnotation();
125: if( result == null ){
126: result = new NodeImpl(doc,spartan);
127: spartan.setAnnotation(result);
128: }
129: return result;
130: }*/
131: }
132:
133: // $Log: NodeImpl.java,v $
134: // Revision 1.2 2002/11/06 02:59:55 eobrain
135: // Organize imputs to removed unused imports. Remove some unused local variables.
136: //
137: // Revision 1.1.1.1 2002/08/19 05:04:14 eobrain
138: // import from HP Labs internal CVS
139: //
140: // Revision 1.5 2002/08/18 05:46:04 eob
141: // Add copyright and other formatting and commenting in preparation for
142: // release to SourceForge.
143: //
144: // Revision 1.4 2002/06/21 00:33:29 eob
145: // Make work with old JDK 1.1.*
146: //
147: // Revision 1.3 2002/02/08 20:33:43 eob
148: // Added extra DOM3 stuff.
149: //
150: // Revision 1.2 2002/02/01 22:01:30 eob
151: // Comment change only.
152: //
153: // Revision 1.1 2002/01/05 07:33:59 eob
154: // initial
|