protected IFilterWriter createSubDocumentFilterWriter (StartSubDocument res) { IFilterWriter writer = new GenericFilterWriter(createSubDocumentSkeletonWriter(res), getEncoderManager()); writer.setOptions(outLoc, "UTF-8"); return writer; }
/** * Sets the fragment to format. * This method does not reset any possible standoff items. * @param content The TextFragment object to format. * @return Itself */ public XLIFFContent setContent (TextFragment content) { return setContent(content, false); }
/** * Sets the flag indicating if non-translatable text units should be output or not. * @param includeNoTranslate true to include non-translatable text unit in the output. */ public void setIncludeNoTranslate (boolean includeNoTranslate) { setBoolean(INCLUDENOTRANSLATE, includeNoTranslate); }
public void close () { if ( writer == null ) return; writer.writeEndDocument(); writer.close(); writer = null; }
@Override public void destroy() { if ( filterWriter != null ) { filterWriter.close(); } }
/** * Prints a generic 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. * @return A string with the segmented text output. */ public String printSegmentedContent (TextContainer container, boolean showSegments) { return printSegmentedContent(container, showSegments, false); }
/** * Generates an generic coded string from the content. * @return The generic string. */ @Override public String toString () { return toString(false); }
/** * Generates an XLIFF string from the content. * This is the same as calling this.toString(1, true, false, gMode, false, true) and setting gMode. * @param gMode True to use g/x markup, false to use bpt/ept/ph * @return The string formatted in XLIFF. */ public String toString (boolean gMode) { return toString(1, true, false, gMode, false, true, null); }
/** * Gets the flag indicating if the inline code should use the place-holder notation (g and x elements). * @return true if the inline code should use the place-holder notation. */ public boolean getPlaceholderMode () { return getBoolean(PLACEHOLDERMODE); }
/** * Generates a TMX string from the content. * This is the same as calling this.toString(quoteMode, true), * where quoteMode is the value set by {@link #setQuoteMode(int)} or 1 by default. * @return The string formatted in TMX. */ @Override public String toString () { return toString(defaultQuoteMode, true); }
/** * Sets the flag indicating whether the writer should output * letter-coded content (e.g. to work for OmegaT). * @param value true to output letter-coded content. False otherwise. * @param zeroBased true to have 0-based code, false for unaltered IDs. */ public void setLetterCodedMode (boolean value, boolean zeroBased) { tmxCont.setLetterCodedMode(value, zeroBased); }
@Override public void setOutput (String path) { close(); // Make sure previous is closed this.outputPath = path; }
/** * Sets the default quote mode to use in escaping the TMX segment content (1 is the default). * @param quoteMode 0=no quote escaped, 1=apos and quot, 2=#39 and quot, * and 3=quot only. */ public void setQuoteMode (int quoteMode) { tmxCont.setQuoteMode(quoteMode); }
public void clearStandoff () { standoff = null; if ( itsCont != null ) itsCont.clearStandoff(); }
/** * Creates a new XLIFFContent object and set its content to the given fragment. * @param content The TextFragment object to format. */ public XLIFFContent (TextFragment content) { setContent(content); }
/** * Sets the copySource flag indicating to copy the source at the target spot if there is no target defined. * @param copySource true to copy the source at the target spot if there is no target defined. */ public void setCopySource (boolean copySource) { setBoolean(COPYSOURCE, copySource); }
/** * Gets the flag indicating if ITS markup should be output or not. * @return true if ITS markup should be output, false otherwise. */ public boolean getIncludeIts () { return getBoolean(INCLUDEITS); }
/** * Sets the flag indicating if the inline code should use the place-holder notation (g and x elements). * @param placeholderMode true if the inline code should use the place-holder notation. */ public void setPlaceholderMode(boolean placeholderMode) { setBoolean(PLACEHOLDERMODE, placeholderMode); }
/** * Sets the flag indicating to mark as not translatable all entries that are approved. * @param setApprovedAsNoTranslate true to mark approved entries as not translatable. */ public void setSetApprovedAsNoTranslate(boolean setApprovedAsNoTranslate) { setBoolean(SETAPPROVEDASNOTRANSLATE, setApprovedAsNoTranslate); }
/** * Sets the flag indicating if extended code attributes should be output or not. * @param includeCodeAttrs true to include extended code attributes in the output. */ public void setIncludeCodeAttrs(boolean includeCodeAttrs) { setBoolean(INCLUDECODEATTRS, includeCodeAttrs); }