home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / xml4j.jar / com / ibm / xml / parser / TXPI.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-08-30  |  2.1 KB  |  93 lines

  1. package com.ibm.xml.parser;
  2.  
  3. import org.w3c.dom.Node;
  4. import org.w3c.dom.ProcessingInstruction;
  5.  
  6. public class TXPI extends Child implements ProcessingInstruction {
  7.    static final long serialVersionUID = 5857404877602965574L;
  8.    String name;
  9.    String data;
  10.  
  11.    public TXPI(String var1, String var2) {
  12.       this.name = var1;
  13.       if (var2.length() <= 0) {
  14.          this.data = var2;
  15.       } else {
  16.          int var3;
  17.          for(var3 = 0; var3 < var2.length() && XMLChar.isSpace(var2.charAt(var3)); ++var3) {
  18.          }
  19.  
  20.          this.data = var2.substring(var3);
  21.       }
  22.    }
  23.  
  24.    public synchronized Object clone() {
  25.       ((Child)this).checkFactory();
  26.       TXPI var1 = (TXPI)super.factory.createProcessingInstruction(this.name, this.data);
  27.       ((Child)var1).setFactory(((Child)this).getFactory());
  28.       return var1;
  29.    }
  30.  
  31.    public synchronized boolean equals(Node var1, boolean var2) {
  32.       if (var1 == null) {
  33.          return false;
  34.       } else if (!(var1 instanceof ProcessingInstruction)) {
  35.          return false;
  36.       } else {
  37.          ProcessingInstruction var3 = (ProcessingInstruction)var1;
  38.          return var3.getTarget().equals(this.getTarget()) && var3.getData().equals(this.getData());
  39.       }
  40.    }
  41.  
  42.    public short getNodeType() {
  43.       return 7;
  44.    }
  45.  
  46.    public String getNodeName() {
  47.       return this.getTarget();
  48.    }
  49.  
  50.    /** @deprecated */
  51.    public String getName() {
  52.       return this.name;
  53.    }
  54.  
  55.    public String getTarget() {
  56.       return this.name;
  57.    }
  58.  
  59.    public void setTarget(String var1) {
  60.       this.name = var1;
  61.       ((Child)this).clearDigest();
  62.    }
  63.  
  64.    public String getData() {
  65.       return this.data;
  66.    }
  67.  
  68.    public String getNodeValue() {
  69.       return this.getData();
  70.    }
  71.  
  72.    public void setData(String var1) {
  73.       this.data = var1;
  74.       ((Child)this).clearDigest();
  75.    }
  76.  
  77.    public void setNodeValue(String var1) {
  78.       this.setData(var1);
  79.    }
  80.  
  81.    public String getText() {
  82.       return "";
  83.    }
  84.  
  85.    public void acceptPre(Visitor var1) throws Exception {
  86.       var1.visitPIPre(this);
  87.    }
  88.  
  89.    public void acceptPost(Visitor var1) throws Exception {
  90.       var1.visitPIPost(this);
  91.    }
  92. }
  93.