1 7 8 package org.dom4j.tree; 9 10 import org.dom4j.CharacterData; 11 import org.dom4j.Element; 12 13 22 public abstract class AbstractCharacterData extends AbstractNode implements 23 CharacterData { 24 public AbstractCharacterData() { 25 } 26 27 public String getPath(Element context) { 28 Element parent = getParent(); 29 30 return ((parent != null) && (parent != context)) ? (parent 31 .getPath(context) + "/text()") : "text()"; 32 } 33 34 public String getUniquePath(Element context) { 35 Element parent = getParent(); 36 37 return ((parent != null) && (parent != context)) ? (parent 38 .getUniquePath(context) + "/text()") : "text()"; 39 } 40 41 public void appendText(String text) { 42 setText(getText() + text); 43 } 44 } 45 46 82 | Popular Tags |