private void setText(Object bean, Text child) { List<Pair<Method, Wrapper>> pairs = Reflect.findMethodsWithAnnotation(bean.getClass(), TagContent.class, bean); for (Pair<Method, Wrapper> pair : pairs) { try { pair.first().invoke(bean, child.getTextContent()); } catch (IllegalArgumentException | InvocationTargetException | IllegalAccessException | DOMException e) { e.printStackTrace(); } } }
private void setText(Object bean, Text child) { List<Pair<Method, Wrapper>> pairs = Reflect.findMethodsWithAnnotation(bean.getClass(), TagContent.class, bean); for (Pair<Method, Wrapper> pair : pairs) { try { pair.first().invoke(bean, child.getTextContent()); } catch (IllegalArgumentException | InvocationTargetException | IllegalAccessException | DOMException e) { LOGGER.error(e.getMessage(), e); } } }
Object from = nl.item(0); if (from instanceof Text) { String text = ((Text) from).getTextContent(); if (text.startsWith("\"") && text.endsWith("\"")) { result = text.substring(1, text.length() -1);
Object from = nl.item(0); if (from instanceof Text) { result = ((Text) from).getTextContent(); } else { result = nl.item(0);
Object from = nl.item(0); if (from instanceof Text) { String text = ((Text) from).getTextContent(); if (text.startsWith("\"") && text.endsWith("\"")) { result = text.substring(1, text.length() -1);
Object from = nl.item(0); if (from instanceof Text) { String text = ((Text) from).getTextContent(); if (text.startsWith("\"") && text.endsWith("\"")) { result = text.substring(1, text.length() -1);
Object from = nl.item(0); if (from instanceof Text) { String text = ((Text) from).getTextContent(); if (text.startsWith("\"") && text.endsWith("\"")) { result = text.substring(1, text.length() -1);
/** * This will build a JDOM Text from an existing DOM Text * * @param text <code> org.w3c.dom.Text</code> object * @return <code>Text</code> - JDOM Text object * @since JDOM2 */ public org.jdom2.Text build(org.w3c.dom.Text text) { return factory.text(text.getTextContent()); }
public String getTitle() { if ( title == null ) return null; return titleText.getTextContent(); }
public String getTitle() { if ( title == null ) return null; return titleText.getTextContent(); }
public String getTitle() { if ( title == null ) return null; return titleText.getTextContent(); }
public String getTitle() { if ( title == null ) return null; return titleText.getTextContent(); }
private static String getTextContent(Text text, int maxLen) { String str = text.getTextContent(); str = str.replaceAll("\n", "\\\\n"); str = str.replaceAll("\r", "\\\\r"); if (str.length() > maxLen) str = str.substring(0, maxLen - 3) + "..."; return str; }
@Override protected void processTextNode( Text node ) { createAndAddChunk( node.getTextContent(), null, false ); }
@Override protected void processTextNode( Text node ) { createAndAddChunk( node.getTextContent(), null, false ); }
private String getTextChildren(Element elem) { StringBuilder result = new StringBuilder(); for (Node node = elem.getFirstChild(); node != null; node = node.getNextSibling()) { if (node instanceof Element) { printWarning("WARNING: Unsupported tag inside " + elem.getNodeName() + ": " + node.getNodeName()); continue; } result.append(((Text) node).getTextContent()); } return result.toString().replaceAll("[\r\n\t ]+", " ").trim(); }
public static void trimNode(Node node) { List<org.w3c.dom.Text> nodes=new LinkedList<org.w3c.dom.Text>(); trimNode(node,nodes); for (org.w3c.dom.Text n: nodes){ if (n.getTextContent().equals("")) n.getParentNode().removeChild(n); } }
private Chunk createChunk(Text node) { String textContent = node.getTextContent(); StylableChunk chunk = document.createChunk(currentContainer, textContent); Style style = currentContainer.getLastStyleApplied(); if (style != null) { chunk.applyStyles(style); } addITextElement(chunk); return chunk; }
@Override protected void processTextNode(Text node) { String content = node.getTextContent(); if (StringUtils.isNotEmpty(content)) { // Escape with HTML characters currentXHTMLContent.setText(StringEscapeUtils.escapeHtml(content)); } else { currentXHTMLContent.setText(" "); } } }
private CTRegularTextRun processRegularTextNode(InlineBox inlineBox, TraversalSettings settings) { settings.setCssMap(getCascadedProperties(inlineBox.getStyle())); CTRegularTextRun run = DML_OBJECT_FACTORY.createCTRegularTextRun(); run.setT(inlineBox.getTextNode().getTextContent()); run.setRPr(createRunProperties(settings)); return run; }