|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.okapi.common.filterwriter.ext.XLIFFContent
public class XLIFFContent
Handles the conversion between a coded text object and XLIFF. In some case this class may output ITS attributes. It assumes the namespace for ITS is declared and the corresponding prefix is 'its'.
Nested Class Summary | |
---|---|
(package private) static class |
XLIFFContent.TAG
|
Field Summary | |
---|---|
static java.lang.String |
ITS_PREFIX
|
static java.lang.String |
REF_PREFIX
|
Constructor Summary | |
---|---|
XLIFFContent()
Creates a new XLIFFContent object without any content. |
|
XLIFFContent(net.sf.okapi.common.resource.TextFragment content)
Creates a new XLIFFContent object and set its content to the given fragment. |
Method Summary | |
---|---|
void |
clearStandoff()
|
java.nio.charset.CharsetEncoder |
getCharsetEncoder()
Gets the current character set encoder. |
java.util.List<net.sf.okapi.common.annotation.GenericAnnotations> |
getStandoff()
Gets the standoff information for a possible list of annotations. |
void |
setCharsetEncoder(java.nio.charset.CharsetEncoder chsEnc)
Sets the character set encoder to use. |
XLIFFContent |
setContent(net.sf.okapi.common.resource.TextFragment content)
Sets the fragment to format. |
XLIFFContent |
setContent(net.sf.okapi.common.resource.TextFragment content,
boolean resetStandoff)
Sets the fragment to format. |
java.lang.String |
toSegmentedString(net.sf.okapi.common.resource.TextContainer container,
int quoteMode,
boolean escapeGT,
boolean withMarkers,
boolean gMode,
boolean codeAttrs,
boolean includeIts,
net.sf.okapi.common.LocaleId trgLocId)
Generates an XLIFF string from a given text container. |
java.lang.String |
toString()
Generates an XLIFF string from the content. |
java.lang.String |
toString(boolean gMode)
Generates an XLIFF string from the content. |
java.lang.String |
toString(int quoteMode,
boolean escapeGT,
boolean codeOnlyMode,
boolean gMode,
boolean codeAttrs,
boolean includeIts,
net.sf.okapi.common.LocaleId trgLocId)
Generates an XLIFF string from the content. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ITS_PREFIX
public static final java.lang.String REF_PREFIX
Constructor Detail |
---|
public XLIFFContent()
public XLIFFContent(net.sf.okapi.common.resource.TextFragment content)
content
- The TextFragment object to format.Method Detail |
---|
public void setCharsetEncoder(java.nio.charset.CharsetEncoder chsEnc)
chsEnc
- the character set encoder to use.public java.nio.charset.CharsetEncoder getCharsetEncoder()
public XLIFFContent setContent(net.sf.okapi.common.resource.TextFragment content)
content
- The TextFragment object to format.
public XLIFFContent setContent(net.sf.okapi.common.resource.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 java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(boolean gMode)
gMode
- True to use g/x markup, false to use bpt/ept/ph
public java.lang.String toString(int quoteMode, boolean escapeGT, boolean codeOnlyMode, boolean gMode, boolean codeAttrs, boolean includeIts, net.sf.okapi.common.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.
public java.lang.String toSegmentedString(net.sf.okapi.common.resource.TextContainer container, int quoteMode, boolean escapeGT, boolean withMarkers, boolean gMode, boolean codeAttrs, boolean includeIts, net.sf.okapi.common.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.
public java.util.List<net.sf.okapi.common.annotation.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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |