home *** CD-ROM | disk | FTP | other *** search
- package com.ibm.xml.parser;
-
- import com.ibm.xml.xpointer.XPointer;
- import java.io.IOException;
- import java.io.Serializable;
- import java.io.Writer;
- 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;
-
- public abstract class Child implements Node, Cloneable, Serializable, Visitee {
- static final long serialVersionUID = 6737260867707773565L;
- public static final int ELEMENT_DECL = 20;
- public static final int ATTLIST = 21;
- public static final int ATTDEF = 22;
- public static final int PSEUDONODE = 23;
- public static final String NAME_DOCUMENT = "#document";
- public static final String NAME_COMMENT = "#comment";
- public static final String NAME_TEXT = "#text";
- public static final String NAME_CDATA = "#cdata-section";
- public static final String NAME_DOCFRAGMENT = "#document-fragment";
- public static final String NAME_ATTDEF = "#attribute-definition";
- public static final String NAME_ATTLIST = "#attribute-definition-list";
- public static final String NAME_ELEMENT_DECL = "#element-declaration";
- public static final String NAME_PSEUDONODE = "#pseudo-node";
- Node parent;
- Node prevSibling;
- Node nextSibling;
- transient byte[] digest;
- TXDocument factory;
- private Object userData;
-
- public abstract Object clone();
-
- public Node cloneNode(boolean var1) {
- return (Node)this.clone();
- }
-
- public abstract boolean equals(Node var1, boolean var2);
-
- public String getNodeValue() {
- return null;
- }
-
- public void setNodeValue(String var1) {
- throw new TXDOMException((short)7, "setNodeValue(String) isn't supported in this class.");
- }
-
- public Node getParentNode() {
- return this.parent;
- }
-
- public Node getParentWithoutReference() {
- Node var1;
- for(var1 = this.getParentNode(); var1 != null && var1.getNodeType() == 5; var1 = var1.getParentNode()) {
- }
-
- return var1;
- }
-
- public NodeList getChildNodes() {
- return TXNodeList.emptyNodeList;
- }
-
- public boolean hasChildNodes() {
- return false;
- }
-
- public Node getFirstChild() {
- return null;
- }
-
- public Node getFirstWithoutReference() {
- return null;
- }
-
- public Node getLastChild() {
- return null;
- }
-
- public Node getLastWithoutReference() {
- return null;
- }
-
- public Node getPreviousSibling() {
- return this.prevSibling;
- }
-
- public Node getPreviousWithoutReference() {
- Node var1 = this.getPreviousSibling();
- if (var1 == null) {
- Node var3 = this.getParentNode();
- if (var3 == null) {
- return null;
- }
-
- if (var3.getNodeType() == 5) {
- var1 = ((Child)var3).getPreviousWithoutReference();
- }
- } else {
- while(var1.getNodeType() == 5) {
- Node var2 = var1.getLastChild();
- if (var2 == null) {
- var1 = ((Child)var1).getPreviousWithoutReference();
- break;
- }
-
- var1 = var2;
- }
- }
-
- return var1;
- }
-
- public Node getNextSibling() {
- return this.nextSibling;
- }
-
- public Node getNextWithoutReference() {
- Node var1 = this.getNextSibling();
- if (var1 == null) {
- Node var3 = this.getParentNode();
- if (var3 == null) {
- return null;
- }
-
- if (var3.getNodeType() == 5) {
- var1 = ((Child)var3).getNextWithoutReference();
- }
- } else {
- while(var1.getNodeType() == 5) {
- Node var2 = var1.getFirstChild();
- if (var2 == null) {
- var1 = ((Child)var1).getNextWithoutReference();
- break;
- }
-
- var1 = var2;
- }
- }
-
- return var1;
- }
-
- public NamedNodeMap getAttributes() {
- return null;
- }
-
- public Node insertBefore(Node var1, Node var2) throws DOMException {
- throw new TXDOMException((short)3, "com.ibm.xml.parser.Child#insertBefore(): Can't insert any nodes to this.");
- }
-
- public Node replaceChild(Node var1, Node var2) throws DOMException {
- throw new TXDOMException((short)3, "com.ibm.xml.parser.Child#replaceChild(): Can't insert any nodes to this.");
- }
-
- public Node removeChild(Node var1) throws DOMException {
- throw new TXDOMException((short)8, "com.ibm.xml.parser.Child#removeChild(): Can't insert any nodes to this.");
- }
-
- public Node appendChild(Node var1) throws DOMException {
- throw new TXDOMException((short)3, "com.ibm.xml.parser.Child#appendChild(): Can't insert any nodes to this.");
- }
-
- public String getText() {
- return "";
- }
-
- public TXElement searchAncestors(String var1) {
- return this.searchAncestors(0, (String)null, var1);
- }
-
- public TXElement searchAncestors(int var1, String var2, String var3) {
- Object var4 = this;
-
- while((var4 = ((Node)var4).getParentNode()) != null) {
- if (!(var4 instanceof TXElement)) {
- return null;
- }
-
- if (Match.matchName((Namespace)var4, var1, var2, var3)) {
- return (TXElement)var4;
- }
- }
-
- return null;
- }
-
- public void toXMLString(Writer var1, String var2) throws IOException, LibraryException {
- try {
- ToXMLStringVisitor var3 = new ToXMLStringVisitor(var1, var2);
- (new NonRecursivePreorderTreeTraversal(var3)).traverse(this);
- } catch (IOException var4) {
- throw var4;
- } catch (Exception var5) {
- throw new LibraryException("com.ibm.xml.parser.Child#toXMLString(): Unexpected Exception: " + ((Throwable)var5).toString());
- }
- }
-
- public void toXMLString(Writer var1) throws IOException, LibraryException {
- this.toXMLString(var1, (String)null);
- }
-
- public void print(Writer var1, String var2) throws IOException, LibraryException {
- this.toXMLString(var1, var2);
- }
-
- public void print(Writer var1) throws IOException, LibraryException {
- this.print(var1, (String)null);
- }
-
- public Document getOwnerDocument() {
- return this.factory;
- }
-
- public TXDocument getFactory() {
- return this.factory;
- }
-
- public void setFactory(TXDocument var1) {
- this.factory = var1;
- }
-
- public byte[] getDigest() throws LibraryException {
- if (this.digest == null) {
- this.checkFactory();
-
- try {
- MakeDigestVisitor var1 = new MakeDigestVisitor(this.getFactory().createMessageDigest());
- (new NonRecursivePreorderTreeTraversal(var1)).traverse(this);
- } catch (Exception var2) {
- throw new LibraryException("com.ibm.xml.parser.Child#getDigest(): Unexpected Exception: " + ((Throwable)var2).toString());
- }
- }
-
- return this.digest;
- }
-
- public void clearDigest() {
- if (this.digest != null) {
- this.digest = null;
- if (this.parent != null) {
- ((Child)this.parent).clearDigest();
- }
- }
-
- }
-
- public XPointer makeXPointer() {
- return XPointer.makeXPointer(this);
- }
-
- void checkFactory() {
- if (this.factory == null) {
- if (TXDocument.s_instance == null) {
- TXDocument.s_instance = new TXDocument();
- }
-
- this.factory = TXDocument.s_instance;
- }
-
- }
-
- void setParentNode(Node var1) {
- this.parent = var1;
- }
-
- void setPreviousSibling(Node var1) {
- this.prevSibling = var1;
- }
-
- void setNextSibling(Node var1) {
- this.nextSibling = var1;
- }
-
- byte[] getVisitorDigest() {
- return this.digest;
- }
-
- void setVisitorDigest(byte[] var1) {
- this.digest = var1;
- }
-
- public void setUserData(Object var1) {
- this.userData = var1;
- }
-
- public Object getUserData() {
- return this.userData;
- }
-
- public abstract String getNodeName();
-
- public abstract short getNodeType();
-
- public abstract void acceptPre(Visitor var1) throws Exception;
-
- public abstract void acceptPost(Visitor var1) throws Exception;
- }
-