public static String getText(List<HSLFTextParagraph> paragraphs) { assert (!paragraphs.isEmpty()); String rawText = getRawText(paragraphs); return toExternalString(rawText, paragraphs.get(0).getRunType()); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); for (HSLFTextRun r : getTextRuns()) { sb.append(r.getRawText()); } return toExternalString(sb.toString(), getRunType()); }
@Override public String getText() { String rawText = getRawText(); return HSLFTextParagraph.toExternalString(rawText, getRunType()); }
/** * <p> * The title is a run of text of type <code>TextHeaderAtom.CENTER_TITLE_TYPE</code> or * <code>TextHeaderAtom.TITLE_TYPE</code> * </p> * * @see TextHeaderAtom */ @Override public String getTitle(){ for (List<HSLFTextParagraph> tp : getTextParagraphs()) { if (tp.isEmpty()) { continue; } int type = tp.get(0).getRunType(); switch (type) { case TextHeaderAtom.CENTER_TITLE_TYPE: case TextHeaderAtom.TITLE_TYPE: String str = HSLFTextParagraph.getRawText(tp); return HSLFTextParagraph.toExternalString(str, type); } } return null; }
String text = HSLFTextParagraph.toExternalString(tba.getText(), -1); textV.add(text); String text = HSLFTextParagraph.toExternalString(tca.getText(), -1); textV.add(text);