home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / parser.jar / com / sun / xml / tree / PINode.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-02-23  |  2.0 KB  |  80 lines

  1. package com.sun.xml.tree;
  2.  
  3. import java.io.IOException;
  4. import java.io.Writer;
  5. import org.w3c.dom.Node;
  6. import org.w3c.dom.ProcessingInstruction;
  7.  
  8. final class PINode extends NodeBase implements ProcessingInstruction {
  9.    private String target;
  10.    private char[] data;
  11.  
  12.    public PINode() {
  13.    }
  14.  
  15.    public PINode(String var1, String var2) {
  16.       this.data = var2.toCharArray();
  17.       this.target = var1;
  18.    }
  19.  
  20.    PINode(String var1, char[] var2, int var3, int var4) {
  21.       this.data = new char[var4];
  22.       System.arraycopy(var2, var3, this.data, 0, var4);
  23.       this.target = var1;
  24.    }
  25.  
  26.    public Node cloneNode(boolean var1) {
  27.       PINode var2 = new PINode(this.target, this.data, 0, this.data.length);
  28.       ((NodeBase)var2).setOwnerDocument((XmlDocument)((NodeBase)this).getOwnerDocument());
  29.       return var2;
  30.    }
  31.  
  32.    public String getData() {
  33.       return new String(this.data);
  34.    }
  35.  
  36.    public String getNodeName() {
  37.       return this.target;
  38.    }
  39.  
  40.    public short getNodeType() {
  41.       return 7;
  42.    }
  43.  
  44.    public String getNodeValue() {
  45.       return this.getData();
  46.    }
  47.  
  48.    public String getTarget() {
  49.       return this.target;
  50.    }
  51.  
  52.    public void setData(String var1) {
  53.       if (((NodeBase)this).isReadonly()) {
  54.          throw new DomEx((short)7);
  55.       } else {
  56.          this.data = var1.toCharArray();
  57.       }
  58.    }
  59.  
  60.    public void setNodeValue(String var1) {
  61.       this.setData(var1);
  62.    }
  63.  
  64.    public void setTarget(String var1) {
  65.       this.target = var1;
  66.    }
  67.  
  68.    public void writeXml(XmlWriteContext var1) throws IOException {
  69.       Writer var2 = var1.getWriter();
  70.       var2.write("<?");
  71.       var2.write(this.target);
  72.       if (this.data != null) {
  73.          var2.write(32);
  74.          var2.write(this.data);
  75.       }
  76.  
  77.       var2.write("?>");
  78.    }
  79. }
  80.