public class TMXContent extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CODEMODE_EMPTY
Indicates that the inline codes should contain nothing.
|
static int |
CODEMODE_GENERIC
Indicates that the inline codes should contain generic codes (e.g.
|
static int |
CODEMODE_LETTERCODED
Indicates that the inline codes should contain letter-codes generic inline
code (like OmegaT (e.g.
|
static int |
CODEMODE_ORIGINAL
Indicates that the inline codes should contain the original code.
|
| Constructor and Description |
|---|
TMXContent()
Creates a new TMXContent object without any content.
|
TMXContent(TextFragment content)
Creates a new TMXContent object and set its content to the given fragment.
|
| Modifier and Type | Method and Description |
|---|---|
CharsetEncoder |
getCharsetEncoder()
Gets the current character set encoder.
|
int |
getCodeMode()
Gets the flag for the code mode currently set.
|
boolean |
getLetterCodedMode()
Indicates if this formatter is set to output letter-coded content.
|
void |
setCharsetEncoder(CharsetEncoder chsEnc)
Sets the character set encoder to use.
|
void |
setCodeMode(int codeMode)
Sets the type of content the inline codes should be output.
|
TMXContent |
setContent(TextFragment content)
Sets the fragment to format.
|
void |
setLetterCodedMode(boolean value,
boolean zeroBased)
Sets the flag that indicates if the TMX generated should use letter-coded
inline content.
|
void |
setQuoteMode(int quoteMode)
Sets the default quote mode.
|
void |
setTradosWorkarounds(boolean value)
Sets the flag that indicates if the TMX generated should use workarounds so
the output can be read in some versions of Trados Translators' Workbench that
have bugs leading to the lose of data.
|
String |
toString()
Generates a TMX string from the content.
|
String |
toString(int quoteMode,
boolean escapeGT)
Generates a TMX string from the content.
|
public static final int CODEMODE_ORIGINAL
public static final int CODEMODE_EMPTY
public static final int CODEMODE_GENERIC
public static final int CODEMODE_LETTERCODED
public TMXContent()
public TMXContent(TextFragment content)
content - The TextFragment object to format.public void setCharsetEncoder(CharsetEncoder chsEnc)
chsEnc - the character set encoder to use.public CharsetEncoder getCharsetEncoder()
public void setTradosWorkarounds(boolean value)
value - true to use workarounds, false to not use workarounds.public void setLetterCodedMode(boolean value,
boolean zeroBased)
creationtool must be set to "OmegaT".value - true to use workarounds, false to not use workarounds.zeroBased - true to have 0-based code, false for unaltered IDs.public boolean getLetterCodedMode()
public void setQuoteMode(int quoteMode)
toString() instead of toString(int, boolean).quoteMode - 0=no quote escaped, 1=apos and quot, 2=#39 and quot, and
3=quot only.public int getCodeMode()
CODEMODE_...
codes.public void setCodeMode(int codeMode)
codeMode - the code for the inline code mode: one of the
CODEMODE_... codes.public TMXContent setContent(TextFragment content)
content - The TextFragment object to format.public String toString()
setQuoteMode(int) or 1 by default.public String toString(int quoteMode, boolean escapeGT)
quoteMode - 0=no quote escaped, 1=apos and quot, 2=#39 and quot, and
3=quot only.escapeGT - True to always escape '>' to gt.Copyright © 2021. All rights reserved.