1 package com.icl.saxon.tinytree; 2 import com.icl.saxon.output.Outputter; 3 import com.icl.saxon.Version; 4 import com.icl.saxon.tree.DOMExceptionImpl; 5 import javax.xml.transform.TransformerException ; 6 7 import org.w3c.dom.*; 8 9 13 14 final class TinyTextImpl extends TinyNodeImpl implements Text { 15 16 public TinyTextImpl(TinyDocumentImpl doc, int nodeNr) { 17 this.document = doc; 18 this.nodeNr = nodeNr; 19 } 20 21 25 26 public String getStringValue() { 27 int start = document.offset[nodeNr]; 28 int len = document.length[nodeNr]; 29 return new String (document.charBuffer, start, len); 30 } 31 32 36 37 public final short getNodeType() { 38 return TEXT; 39 } 40 41 44 45 public void copy(Outputter out) throws TransformerException { 46 int start = document.offset[nodeNr]; 47 int len = document.length[nodeNr]; 48 out.writeContent(document.charBuffer, start, len); 49 } 50 51 54 55 public void copyStringValue(Outputter out) throws TransformerException { 56 int start = document.offset[nodeNr]; 57 int len = document.length[nodeNr]; 58 out.writeContent(document.charBuffer, start, len); 59 } 60 61 } 62 63 | Popular Tags |