home *** CD-ROM | disk | FTP | other *** search
- package com.sun.xml.tree;
-
- import java.io.IOException;
- import java.util.Locale;
- import org.w3c.dom.Attr;
- import org.w3c.dom.DOMException;
- import org.w3c.dom.Document;
- import org.w3c.dom.NamedNodeMap;
- import org.w3c.dom.Node;
- import org.w3c.dom.NodeList;
-
- abstract class NodeBase implements Node, NodeEx, NodeList, XmlWritable {
- private ParentNode parent;
- private int parentIndex = -1;
- XmlDocument ownerDocument;
- boolean readonly;
-
- public Node appendChild(Node var1) throws DOMException {
- throw new DomEx((short)3);
- }
-
- public abstract Node cloneNode(boolean var1);
-
- public NamedNodeMap getAttributes() {
- return null;
- }
-
- public NodeList getChildNodes() {
- return this;
- }
-
- public Node getFirstChild() {
- return null;
- }
-
- public int getIndexOf(Node var1) {
- return -1;
- }
-
- public String getInheritedAttribute(String var1) {
- Object var2 = this;
- Attr var3 = null;
-
- do {
- if (var2 instanceof ElementNode) {
- ElementNode var4 = (ElementNode)var2;
- if ((var3 = var4.getAttributeNode(var1)) != null) {
- break;
- }
- }
-
- var2 = ((NodeBase)var2).getParentImpl();
- } while(var2 != null);
-
- return var3 != null ? var3.getValue() : null;
- }
-
- public String getInheritedAttribute(String var1, String var2) {
- Object var3 = this;
- Attr var4 = null;
-
- do {
- if (var3 instanceof ElementNode) {
- ElementNode var5 = (ElementNode)var3;
- if ((var4 = var5.getAttributeNode(var1, var2)) != null) {
- break;
- }
- }
-
- var3 = ((NodeBase)var3).getParentImpl();
- } while(var3 != null);
-
- return var4 != null ? var4.getValue() : null;
- }
-
- public String getLanguage() {
- return this.getInheritedAttribute("xml:lang");
- }
-
- public Node getLastChild() {
- return null;
- }
-
- public int getLength() {
- return 0;
- }
-
- String getMessage(String var1) {
- return this.getMessage(var1, (Object[])null);
- }
-
- String getMessage(String var1, Object[] var2) {
- Locale var3;
- if (this instanceof XmlDocument) {
- var3 = ((XmlDocument)this).getLocale();
- } else if (this.ownerDocument == null) {
- var3 = Locale.getDefault();
- } else {
- var3 = this.ownerDocument.getLocale();
- }
-
- return XmlDocument.catalog.getMessage(var3, var1, var2);
- }
-
- public Node getNextSibling() {
- if (this.parent == null) {
- return null;
- } else {
- if (this.parentIndex < 0 || this.parent.item(this.parentIndex) != this) {
- this.parentIndex = this.parent.getIndexOf(this);
- }
-
- return this.parent.item(this.parentIndex + 1);
- }
- }
-
- public abstract String getNodeName();
-
- public abstract short getNodeType();
-
- public String getNodeValue() {
- return null;
- }
-
- public Document getOwnerDocument() {
- return this.ownerDocument;
- }
-
- ParentNode getParentImpl() {
- return this.parent;
- }
-
- public Node getParentNode() {
- return this.parent;
- }
-
- public Node getPreviousSibling() {
- if (this.parent == null) {
- return null;
- } else {
- if (this.parentIndex < 0 || this.parent.item(this.parentIndex) != this) {
- this.parentIndex = this.parent.getIndexOf(this);
- }
-
- return this.parent.item(this.parentIndex - 1);
- }
- }
-
- public boolean hasChildNodes() {
- return false;
- }
-
- public Node insertBefore(Node var1, Node var2) throws DOMException {
- throw new DomEx((short)3);
- }
-
- public boolean isReadonly() {
- return this.readonly;
- }
-
- public Node item(int var1) {
- return null;
- }
-
- public Node removeChild(Node var1) throws DOMException {
- throw new DomEx((short)3);
- }
-
- public Node replaceChild(Node var1, Node var2) throws DOMException {
- throw new DomEx((short)3);
- }
-
- public void setNodeValue(String var1) {
- if (this.readonly) {
- throw new DomEx((short)7);
- }
- }
-
- void setOwnerDocument(XmlDocument var1) {
- this.ownerDocument = var1;
- }
-
- void setParentNode(ParentNode var1, int var2) throws DOMException {
- if (this.parent != null && var1 != null) {
- this.parent.removeChild(this);
- }
-
- this.parent = var1;
- this.parentIndex = var2;
- }
-
- public void setReadonly(boolean var1) {
- this.readonly = true;
- if (var1) {
- TreeWalker var2 = new TreeWalker(this);
-
- Node var3;
- while((var3 = var2.getNext()) != null) {
- ((NodeBase)var3).setReadonly(false);
- }
- }
-
- }
-
- public void writeChildrenXml(XmlWriteContext var1) throws IOException {
- }
-
- public abstract void writeXml(XmlWriteContext var1) throws IOException;
- }
-