/** * Generates an generic coded string from the content. * @return The generic string. */ @Override public String toString () { return toString(false); }
public static String printMarkers (TextFragment textFragment) { return (new GenericContent(textFragment)).toString(); }
/** * Prints a string representation of a given segmented text, with optional * markers to indicate the segments boundaries. * @param container the container to output. * @param showSegments true if segment boundaries should be shown. * @param normalText true to show in-line real data instead of generic codes. * @return a string with the segmented text output. */ public String printSegmentedContent (TextContainer container, boolean showSegments, boolean normalText) { StringBuilder tmp = new StringBuilder(); for ( TextPart part : container ) { if ( part instanceof Segment ) { if ( showSegments ) tmp.append("["); tmp.append(setContent(part.text).toString(normalText)); if ( showSegments ) tmp.append("]"); } else { tmp.append(setContent(part.text).toString(normalText)); } } return tmp.toString(); }
for ( Segment seg : textCont.getSegments() ) { writer.write("<p>"); //$NON-NLS-1$ writer.write(Util.escapeToXML(sampleOutput.setContent(seg.text).toString(true), 0, false, null)); writer.write("</p>"); //$NON-NLS-1$
writer.writeRawXML("<td class='p'>"); //$NON-NLS-1$ fmt.setContent(srcFrag); writer.writeString(fmt.toString(!params.getGenericCodes())); else writer.writeRawXML("<td class='p'>"); //$NON-NLS-1$ fmt.setContent(trgFrag1); writer.writeString(fmt.toString(!params.getGenericCodes())); writer.writeRawXML("</td></tr>"); //$NON-NLS-1$ writer.writeRawXML("</td><td>"); //$NON-NLS-1$ fmt.setContent(trgFrag2); writer.writeString(fmt.toString(!params.getGenericCodes())); writer.writeRawXML("</td></tr>"); //$NON-NLS-1$ writer.writeRawXML("</td><td>"); //$NON-NLS-1$ fmt.setContent(trgFrag3); writer.writeString(fmt.toString(!params.getGenericCodes())); writer.writeRawXML("</td></tr>"); //$NON-NLS-1$