1 16 17 package org.apache.axis.message; 18 19 import org.w3c.dom.Comment ; 20 import org.w3c.dom.DOMException ; 21 22 import javax.xml.soap.Text ; 23 24 30 31 public class CommentImpl 32 extends org.apache.axis.message.Text 33 implements Text, Comment { 34 35 public CommentImpl(String text) { 36 super(text); 37 } 38 39 public boolean isComment() { 40 return true; 41 } 42 43 public org.w3c.dom.Text splitText(int offset) throws DOMException { 44 int length = textRep.getLength(); 45 String tailData = textRep.substringData(offset, length); 49 textRep.deleteData(offset, length); 50 51 Text tailText = new CommentImpl(tailData); 53 org.w3c.dom.Node myParent = (org.w3c.dom.Node ) getParentNode(); 54 if (myParent != null) { 55 org.w3c.dom.NodeList brothers = 56 (org.w3c.dom.NodeList ) myParent.getChildNodes(); 57 for (int i = 0; i < brothers.getLength(); i++) { 58 if (brothers.item(i).equals(this)) { 59 myParent.insertBefore(tailText, this); 60 return tailText; 61 } 62 } 63 } 64 return tailText; 65 } 66 67 } 68 | Popular Tags |