public Text createText(String text) { if (text == null) { String msg = "Adding text to an XML document must not be null"; throw new IllegalArgumentException(msg); } return new DefaultText(text); }
protected Node createXPathResult(Element parent) { return new DefaultText(parent, getText()); } }
public Text createText(String text) { if (text == null) { String msg = "Adding text to an XML document must not be null"; throw new IllegalArgumentException(msg); } return new DefaultText(text); }
public Text createText(String text) { if (text == null) { String msg = "Adding text to an XML document must not be null"; throw new IllegalArgumentException(msg); } return new DefaultText(text); }
public Text createText(String text) { if (text == null) { String msg = "Adding text to an XML document must not be null"; throw new IllegalArgumentException(msg); } return new DefaultText(text); }
public Text createText(String text) { if (text == null) { String msg = "Adding text to an XML document must not be null"; throw new IllegalArgumentException(msg); } return new DefaultText(text); }
public Text createText(String text) { if (text == null) { String msg = "Adding text to an XML document must not be null"; throw new IllegalArgumentException(msg); } return new DefaultText(text); }
public Text createText(String text) { if (text == null) { String msg = "Adding text to an XML document must not be null"; throw new IllegalArgumentException(msg); } return new DefaultText(text); }
public Text createText(String text) { if (text == null) { String msg = "Adding text to an XML document must not be null"; throw new IllegalArgumentException(msg); } return new DefaultText(text); }
public Text createText(String text) { if (text == null) { String msg = "Adding text to an XML document must not be null"; throw new IllegalArgumentException(msg); } return new DefaultText(text); }
@Override public Text createText(@Nonnull final String text) { Assertions.notNull("text", text); return new DefaultText(text.intern()); } }
protected Node createXPathResult(Element parent) { return new DefaultText(parent, getText()); } }
protected Node createXPathResult(Element parent) { return new DefaultText(parent, getText()); } }
protected Node createXPathResult(Element parent) { return new DefaultText(parent, getText()); } }
protected Node createXPathResult(Element parent) { return new DefaultText(parent, getText()); } }
protected Node createXPathResult(Element parent) { return new DefaultText(parent, getText()); } }
protected Node createXPathResult(Element parent) { return new DefaultText(parent, getText()); } }
protected Node createXPathResult(Element parent) { return new DefaultText(parent, getText()); } }
protected Node createXPathResult(Element parent) { return new DefaultText(parent, getText()); } }
public static void main(String[] args) throws DocumentException { SAXReader reader = new SAXReader(); String xml = "<div class=\"discussionThread dt\"><div class=\"dt_subject\">2011 IS HERE!</div></div>"; Document document = reader.read(new StringReader(xml)); DefaultElement newElement = new DefaultElement("div"); newElement.addAttribute("class", "test"); newElement.add(new DefaultText("Test Val")); List content = document.getRootElement().content(); if (content != null ) { content.add(0, newElement); } System.out.println(document.asXML()); }