@Override public List<Content> cloneContent() { final int size = getContentSize(); final List<Content> list = new ArrayList<Content>(size); for (int i = 0; i < size; i++) { final Content child = getContent(i); list.add(child.clone()); } return list; }
/** * Returns the content of a JDOM Element detached from it. * * @param elt the element to get the content from. * * @return a (possibly empty) list of JDOM nodes, detached from * their parent. */ private List<Content> getDetachedContent(Element elt) { List<Content> content = elt.getContent(); List<Content> nodes = new ArrayList<Content>(content.size()); while (content.size() != 0) { Content o = content.remove(0); nodes.add(o); } return (nodes); } }
private final void recurseElementText(Element element, StringBuilder sb) { for (Iterator<?> it = element.getContent().iterator(); it.hasNext(); ) { Content c = (Content)it.next(); if (c instanceof Element) { recurseElementText((Element)c, sb); } else if (c instanceof Text) { sb.append(((Text)c).getText()); } } }
descending = ((Element)ret).getContent().iterator(); if (ssize >= stack.length) { stack = ArrayCopy.copyOf(stack, ssize + 16);
/** * Returns the XPath 1.0 string value of this element, which is the * complete, ordered content of all text node descendants of this element * (i.e. the text that's left after all references are resolved * and all other markup is stripped out.) * * @return a concatentation of all text node descendants */ @Override public String getValue() { final StringBuilder buffer = new StringBuilder(); for (Content child : getContent()) { if (child instanceof Element || child instanceof Text) { buffer.append(child.getValue()); } } return buffer.toString(); }
/** * This will handle printing out an <code>{@link * Element}</code>'s content only, not including its tag, and attributes. * This can be useful for printing the content of an element that contains * HTML, like "<description>JDOM is * <b>fun>!</description>". * * @param element * <code>Element</code> to output. * @param out * <code>Writer</code> to use. * @throws IOException * - if there's any problem writing. * @throws NullPointerException * if the specified content is null. */ public final void outputElementContent(Element element, Writer out) throws IOException { myProcessor.process(out, myFormat, element.getContent()); out.flush(); }
/** * This will handle printing out an <code>{@link * Element}</code>'s content only, not including its tag, and attributes. * This can be useful for printing the content of an element that contains * HTML, like "<description>JDOM is * <b>fun>!</description>". * * @param element * <code>Element</code> to output. * @param out * <code>XMLStreamWriter</code> to use. * @throws XMLStreamException * - if there's any problem writing. * @throws NullPointerException * if the specified content is null. */ public final void outputElementContent(Element element, XMLStreamWriter out) throws XMLStreamException { myProcessor.process(out, myFormat, element.getContent()); out.flush(); }
/** * This will handle printing out an <code>{@link * Element}</code>'s content only, not including its tag, and attributes. * This can be useful for printing the content of an element that contains * HTML, like "<description>JDOM is * <b>fun>!</description>". * * @param element * <code>Element</code> to output. * @param out * <code>XMLEventConsumer</code> to use. * @throws XMLStreamException * - if there's any problem writing. * @throws NullPointerException * if the specified content is null. */ public final void outputElementContent(Element element, XMLEventConsumer out) throws XMLStreamException { myProcessor.process(out, myFormat, myEventFactory, element.getContent()); //out.flush(); }
final FilterList<E> list = (FilterList<E>)getContent(filter); list.sort(comparator);
pnt.getContent(Filters.text()); // CDATA return getPositionPath(content, sibs, "text()", buffer); pnt.getContent(Filters.comment()); return getPositionPath(content, sibs, "comment()", buffer); pnt.getContent(Filters.processinginstruction()); return getPositionPath(content, sibs, "processing-instruction()", buffer); .singletonList(nsa) : pnt.getContent(); return getPositionPath(content, sibs, "node()", buffer);
final List<Content> content = element.getContent();
try { final List<Content> content = element.getContent();
element.getQualifiedName(), atts); final List<Content> content = element.getContent();
private Element getFirstContent(final Element element, final String name) { final List<Element> filterList = element.getContent(new ContentFilter(name)); Element firstContent = null; if (filterList != null && !filterList.isEmpty()) { firstContent = filterList.get(0); } return firstContent; }
final List<Content> content = element.getContent();
protected String getXmlInnerText(final Element e) { final StringBuffer sb = new StringBuffer(); final XMLOutputter xo = new XMLOutputter(); final List<Content> children = e.getContent(); sb.append(xo.outputString(children)); return sb.toString(); } }
protected String getXmlInnerText(Element e) { StringBuffer sb = new StringBuffer(); XMLOutputter xo = new XMLOutputter(); List children = e.getContent(); sb.append(xo.outputString(children)); return sb.toString(); } }
protected String getXmlInnerText(final Element e) { final StringBuffer sb = new StringBuffer(); final XMLOutputter xo = new XMLOutputter(); final List<Content> children = e.getContent(); sb.append(xo.outputString(children)); return sb.toString(); } }
final List<Content> content = element.getContent();
private void parseUpdates(final Element historyChild, final History history, final Locale locale) { final List<Element> updatedChildren = historyChild.getContent(new ContentFilter(Update.NAME)); for (final Element updateChild : updatedChildren) { final Update update = new Update(); update.setBy(parseStringAttribute(updateChild, Update.BY_ATTRIBUTE)); update.setWhen(parseDateAttribute(updateChild, Update.WHEN_ATTRIBUTE, locale)); history.addUpdate(update); } }