public class XLIFFWriter extends Object implements IFilterWriter
| Modifier and Type | Field and Description |
|---|---|
static String |
OKP_ENGINE
Name of the Okapi XLIFF extension engine.
|
static String |
OKP_MATCHTYPE
Name of the Okapi XLIFF extension matchType.
|
| Constructor and Description |
|---|
XLIFFWriter()
Creates an XLIFF writer object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the current process.
|
void |
close()
Writes the end of this the document and close it.
|
void |
create(String xliffPath,
String skeletonPath,
LocaleId srcLoc,
LocaleId trgLoc,
String dataType,
String original,
String message)
Creates a new XLIFF document.
|
EncoderManager |
getEncoderManager()
Gets the current encoder manager for this writer.
|
String |
getName()
Gets the name of this writer.
|
XLIFFWriterParameters |
getParameters()
Gets the current parameters for this writer.
|
ISkeletonWriter |
getSkeletonWriter()
Gets the skeleton writer associated with this writer.
|
XLIFFContent |
getXLIFFContent() |
Event |
handleEvent(Event event)
Handles the filter events.
|
void |
setAnnotatorsRef(String values)
Updates the current ITS annotators references based on a given set of values.
|
void |
setOptions(LocaleId locale,
String defaultEncoding)
Sets the options for this writer.
|
void |
setOutput(OutputStream output)
Sets the output through its output stream.
|
void |
setOutput(String path)
Sets the output through the path of the output file.
|
void |
setParameters(IParameters params)
Sets new parameters for this writer.
|
void |
writeEndFile()
Writes the end of a <file> element.
|
void |
writeEndGroup()
Writes the end of a <group> element.
|
void |
writeStartFile(String original,
String dataType,
String skeletonPath)
Writes the start of a <file> element.
|
void |
writeStartFile(String original,
String dataType,
String skeletonPath,
String extraForHeader)
Writes the start of a <file> element.
|
void |
writeStartGroup(StartGroup resource)
Writes the start of a <group> element.
|
void |
writeTextUnit(ITextUnit tu)
Writes a text unit as a <trans-unit> element.
|
void |
writeTextUnit(ITextUnit tu,
String phaseName)
Writes a text unit as a <trans-unit> element.
|
public static final String OKP_MATCHTYPE
public static final String OKP_ENGINE
public void create(String xliffPath, String skeletonPath, LocaleId srcLoc, LocaleId trgLoc, String dataType, String original, String message)
xliffPath - the full path of the document to create.skeletonPath - the path for the skeleton, or null for no skeleton.srcLoc - the source locale.trgLoc - the target locale, or null for no target.dataType - the value for the datatype attribute.original - the value for the original attribute.message - optional comment to put at the top of the document (can be null).public void close()
close in interface AutoCloseableclose in interface IFilterWriterpublic void writeStartFile(String original, String dataType, String skeletonPath)
each call to this method must have a corresponding call to writeEndFile().
original - the value for the original attribute. If null: "unknown" is used.dataType - the value for the datatype attribute. If null: "x-undefined" is used.skeletonPath - optional external skeleton information, or null.writeEndFile()public void writeStartFile(String original, String dataType, String skeletonPath, String extraForHeader)
each call to this method must have a corresponding call to writeEndFile().
original - the value for the original attribute. If null: "unknown" is used.dataType - the value for the datatype attribute. If null: "x-undefined" is used.skeletonPath - optional external skeleton information, or null.extraForHeader - optional extra raw valid XLIFF to place in the header, or null.writeEndFile()public void writeEndFile()
writeStartFile(String, String, String).writeStartFile(String, String, String)public void writeStartGroup(StartGroup resource)
writeEndGroup()public void writeEndGroup()
writeStartGroup(StartGroup)public void writeTextUnit(ITextUnit tu)
tu - the text unit to output.public void writeTextUnit(ITextUnit tu, String phaseName)
tu - the text unit to output.phaseName - the value of phase-name (can be null).public void cancel()
IFilterWritercancel in interface IFilterWriterpublic EncoderManager getEncoderManager()
IFilterWritergetEncoderManager in interface IFilterWriterpublic ISkeletonWriter getSkeletonWriter()
IFilterWritergetSkeletonWriter in interface IFilterWriterpublic String getName()
IFilterWritergetName in interface IFilterWriterpublic XLIFFWriterParameters getParameters()
IFilterWritergetParameters in interface IFilterWriterpublic Event handleEvent(Event event)
IFilterWriterhandleEvent in interface IFilterWriterevent - The event to process.public void setOptions(LocaleId locale, String defaultEncoding)
IFilterWritersetOptions in interface IFilterWriterlocale - the output locale.defaultEncoding - Name of the character set encoding for the output.public void setOutput(String path)
IFilterWritersetOutput in interface IFilterWriterpath - Full path of the output file.public void setOutput(OutputStream output)
IFilterWritersetOutput in interface IFilterWriteroutput - Output stream to use for the output.public void setParameters(IParameters params)
IFilterWritersetParameters in interface IFilterWriterparams - The new parameters to use.public void setAnnotatorsRef(String values)
values - the annotators references values to use to update the existing ones.
The annotation will be output in the next element that can carry it.public XLIFFContent getXLIFFContent()
Copyright © 2022. All rights reserved.