public class XLIFFContent extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ITS_PREFIX |
static String |
REF_PREFIX |
| Constructor and Description |
|---|
XLIFFContent()
Creates a new XLIFFContent object without any content.
|
XLIFFContent(String codedText,
List<Code> codes,
XLIFFContent innerContent,
CharsetEncoder chsEnc,
List<GenericAnnotations> standoff,
ITSContent itsCont) |
XLIFFContent(TextFragment content)
Creates a new XLIFFContent object and set its content to the given fragment.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearStandoff() |
CharsetEncoder |
getCharsetEncoder()
Gets the current character set encoder.
|
String |
getCodedText() |
List<Code> |
getCodes() |
XLIFFContent |
getInnerContent() |
ITSContent |
getItsCont() |
List<GenericAnnotations> |
getStandoff()
Gets the standoff information for a possible list of annotations.
|
void |
setCharsetEncoder(CharsetEncoder chsEnc)
Sets the character set encoder to use.
|
XLIFFContent |
setContent(TextFragment content)
Sets the fragment to format.
|
XLIFFContent |
setContent(TextFragment content,
boolean resetStandoff)
Sets the fragment to format.
|
String |
toSegmentedString(TextContainer container,
int quoteMode,
boolean escapeGT,
boolean withMarkers,
boolean gMode,
boolean codeAttrs,
boolean includeIts,
LocaleId trgLocId)
Generates an XLIFF string from a given text container.
|
String |
toString()
Generates an XLIFF string from the content.
|
String |
toString(boolean gMode)
Generates an XLIFF string from the content.
|
String |
toString(int quoteMode,
boolean escapeGT,
boolean codeOnlyMode,
boolean gMode,
boolean codeAttrs,
boolean includeIts,
LocaleId trgLocId)
Generates an XLIFF string from the content.
|
public static final String ITS_PREFIX
public static final String REF_PREFIX
public XLIFFContent()
public XLIFFContent(TextFragment content)
content - The TextFragment object to format.public XLIFFContent(String codedText, List<Code> codes, XLIFFContent innerContent, CharsetEncoder chsEnc, List<GenericAnnotations> standoff, ITSContent itsCont)
public void setCharsetEncoder(CharsetEncoder chsEnc)
chsEnc - the character set encoder to use.public CharsetEncoder getCharsetEncoder()
public XLIFFContent setContent(TextFragment content)
content - The TextFragment object to format.public XLIFFContent setContent(TextFragment content, boolean resetStandoff)
content - The TextFragment object to format.resetStandoff - true to reset the ITS standoff items (e.g. when the fragment is the whole content of a text container).public String toString()
public String toString(boolean gMode)
gMode - True to use g/x markup, false to use bpt/ept/phpublic String toString(int quoteMode, boolean escapeGT, boolean codeOnlyMode, boolean gMode, boolean codeAttrs, boolean includeIts, LocaleId trgLocId)
In some cases, a reference to an ITS standoff element may be generated.
Use getStandoff() to get the standoff information that needs to be output
along with the inline reference. Each call to this method resets
the standoff information returned by getStandoff().
quoteMode - 0=no quote escaped, 1=apos and quot, 2=#39 and quot,
and 3=quot only.escapeGT - True to always escape '>' to gtcodeOnlyMode - True when the in-line codes are to be set as raw-values.gMode - True to use g/x markup, false to use bpt/ept/ph
This option is to be used when the in-line code is an XLIFF-in-line code itself.codeAttrs - True to include extended code attributes in the output.includeIts - True to include ITS markup in the output.trgLocId - the id of the target locale.public String toSegmentedString(TextContainer container, int quoteMode, boolean escapeGT, boolean withMarkers, boolean gMode, boolean codeAttrs, boolean includeIts, LocaleId trgLocId)
container - The container to write out.quoteMode - 0=no quote escaped, 1=apos and quot, 2=#39 and quot,
and 3=quot only.escapeGT - True to always escape '>' to >withMarkers - True to output mrk elements, false to output only
the content of mrk element.gMode - True to use g/x markup, false to use bpt/ept/phcodeAttrs - True to include extended code attributes in the output.includeIts - True to include ITS markup in the output.trgLocId - the id of the target locale.public List<GenericAnnotations> getStandoff()
GenericAnnotations objects.
The data of each annotation set is the id that is used
in the local markup to point to this standoff markup.public void clearStandoff()
public final String getCodedText()
public final XLIFFContent getInnerContent()
public final ITSContent getItsCont()
Copyright © 2022. All rights reserved.