|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Converter
Field Summary | |
---|---|
static int |
BLKSIZE
Block size constant for heirs to use in reading and writing files |
static java.lang.String |
formatSuffix
The format file associated with a native file has the same name as the native file, with the following suffixed: |
static java.lang.String |
skeletonSuffix
The skeleton file associated with a native file has the same name as the native file, with the following suffixed: |
static java.lang.String |
startXliff
Introduces the xliff element of an XLIFF document: |
static java.lang.String |
stylesTSkeletonSuffix
Some converters need to create an intermediate "temporary" skeleton file for styles, which is later processed to help create the final skeleton file. |
static java.lang.String |
tSkeletonSuffix
Some converters need to create an intermediate "temporary" skeleton file, which is later processed to create the final skeleton file. |
static java.lang.String |
xliffSuffix
The xliff file associated with a native file has the same name as the native file, with the following suffixed: |
static java.lang.String |
xmlDeclaration
Used at the top of generated XML files: |
Method Summary | |
---|---|
ConversionStatus |
convert(ConversionMode mode,
java.util.Locale language,
java.lang.String phaseName,
int maxPhase,
java.nio.charset.Charset nativeEncoding,
FileType nativeFileType,
java.lang.String nativeFileName,
java.lang.String baseDir,
Notifier notifier)
Deprecated. |
ConversionStatus |
convert(ConversionMode mode,
java.util.Locale language,
java.lang.String phaseName,
int maxPhase,
java.nio.charset.Charset nativeEncoding,
FileType nativeFileType,
java.lang.String nativeFileName,
java.lang.String baseDir,
Notifier notifier,
SegmentBoundary boundary,
java.io.StringWriter generatedFileName)
Convert a file from a Native format to XLIFF, or from XLIFF (back) to the original native format. |
ConversionStatus |
convert(ConversionMode mode,
java.util.Locale language,
java.lang.String phaseName,
int maxPhase,
java.nio.charset.Charset nativeEncoding,
FileType nativeFileType,
java.lang.String nativeFileName,
java.lang.String baseDir,
Notifier notifier,
SegmentBoundary boundary,
java.io.StringWriter generatedFileName,
java.util.Set<f2xutils.XMLTuXPath> skipList)
Convert a file from a Native format to XLIFF, or from XLIFF (back) to the original native format. |
java.lang.Object |
getConversionProperty(java.lang.String property)
Return an object representing a format-specific (and converter-specific) property. |
FileType |
getFileType()
Return the file type that this converter handles. |
void |
setConversionProperty(java.lang.String property,
java.lang.Object value)
Set a format-specific property that might affect the way that the conversion occurs. |
Field Detail |
---|
static final java.lang.String xmlDeclaration
static final java.lang.String startXliff
static final java.lang.String xliffSuffix
static final java.lang.String tSkeletonSuffix
static final java.lang.String stylesTSkeletonSuffix
static final java.lang.String skeletonSuffix
static final java.lang.String formatSuffix
static final int BLKSIZE
Method Detail |
---|
ConversionStatus convert(ConversionMode mode, java.util.Locale language, java.lang.String phaseName, int maxPhase, java.nio.charset.Charset nativeEncoding, FileType nativeFileType, java.lang.String nativeFileName, java.lang.String baseDir, Notifier notifier, SegmentBoundary boundary, java.io.StringWriter generatedFileName, java.util.Set<f2xutils.XMLTuXPath> skipList) throws ConversionException
mode
- The mode of conversion (to or from XLIFF).language
- The language of the native document. If we are converting
from a native format to XLIFF, the language becomes the <source>
xml:lang in the XLIFF. If conversion is from XLIFF back to the native
format, the language selects which <target> (in the XLIFF's
translation-units) will provide the strings for the destination native
document.phaseName
- The name of the phase to convert. (This is meaningful
only for conversions from XLIFF back to the native format, where
there are multiple target elements for the same locale, differentiated
only by the optional phase-name attribute.) This parameter is
ignored if conversion is to XLIFF. If converting from XLIFF back
to a native format and the XLIFF target elements do not use the
phase-name attribute, specify null for this parameter.
Special behavior: If the phase name string consists entirely of numeric digits equivalent to an integer with value greater than 1 but less than or equal to maxPhase (see below), the implementation may choose to search for targets with phase-names of earlier numerically named phase names.
maxPhase
- The maximum phase number. (This is meaningful
only for conversions from XLIFF back to the native format, where
there are multiple target elements for the same locale, differentiated
only by the optional phase-name attribute.) This parameter is
ignored if conversion is to XLIFF.
If phaseName is specified as "0" and maxPhase is a non-negative integer, search for the highest "numbered" phase, starting at maxPhase, and searching down to phase "1".
nativeEncoding
- The encoding of the native document. If we are
converting a native document to XLIFF, this parameter tells the converter
how to interpret the bytes read from the native document as it converts
to UTF-8 used by XLIFF. If conversion is from XLIFF back to the native
format, this parameter tells the converter what to convert the UTF-8-
encoding back to.
Note: If the native format offers no choice of encoding, then this parameter's value is ignored.
nativeFileType
- The type of the native file. Examples: "HTML",
"WORD". (Note: This parameter is needed only when converting
to XLIFF, to provide a value for the datatype attribute of the
XLIFF's file element.) If converting from XLIFF, the datatype
is read from the XLIFF file; this parameter is ignored.nativeFileName
- The name of the native file. If we are converting
from a native format to XLIFF, this specifies the name of the file to
convert to XLIFF. If conversion is from XLIFF back to the native format,
this parameter specifies the name of the file generated from XLIFF.baseDir
- The directory (in the file system) from which input files
will be read, and to which output files will be written.notifier
- Instance of a class that implements the Notifier
interface (to send notifications in case of conversion error).boundary
- The boundary on which to segment translation units (e.g.,
on paragraph or sentence boundaries)generatedFileName
- If this parameter is non-null, the converter
implementation might write the name of the generated output file
to this parameter (a StringWriter).skipList
- A set of potential translatable structures to omit. (This
is applicable to the import--conversion to XLIFF--of XML files,
for example.).
ConversionException
- If a conversion exception is encountered.ConversionStatus convert(ConversionMode mode, java.util.Locale language, java.lang.String phaseName, int maxPhase, java.nio.charset.Charset nativeEncoding, FileType nativeFileType, java.lang.String nativeFileName, java.lang.String baseDir, Notifier notifier, SegmentBoundary boundary, java.io.StringWriter generatedFileName) throws ConversionException
mode
- The mode of conversion (to or from XLIFF).language
- The language of the native document. If we are converting
from a native format to XLIFF, the language becomes the <source>
xml:lang in the XLIFF. If conversion is from XLIFF back to the native
format, the language selects which <target> (in the XLIFF's
translation-units) will provide the strings for the destination native
document.phaseName
- The name of the phase to convert. (This is meaningful
only for conversions from XLIFF back to the native format, where
there are multiple target elements for the same locale, differentiated
only by the optional phase-name attribute.) This parameter is
ignored if conversion is to XLIFF. If converting from XLIFF back
to a native format and the XLIFF target elements do not use the
phase-name attribute, specify null for this parameter.
Special behavior: If the phase name string consists entirely of numeric digits equivalent to an integer with value greater than 1 but less than or equal to maxPhase (see below), the implementation may choose to search for targets with phase-names of earlier numerically named phase names.
maxPhase
- The maximum phase number. (This is meaningful
only for conversions from XLIFF back to the native format, where
there are multiple target elements for the same locale, differentiated
only by the optional phase-name attribute.) This parameter is
ignored if conversion is to XLIFF.
If phaseName is specified as "0" and maxPhase is a non-negative integer, search for the highest "numbered" phase, starting at maxPhase, and searching down to phase "1".
nativeEncoding
- The encoding of the native document. If we are
converting a native document to XLIFF, this parameter tells the converter
how to interpret the bytes read from the native document as it converts
to UTF-8 used by XLIFF. If conversion is from XLIFF back to the native
format, this parameter tells the converter what to convert the UTF-8-
encoding back to.
Note: If the native format offers no choice of encoding, then this parameter's value is ignored.
nativeFileType
- The type of the native file. Examples: "HTML",
"WORD". (Note: This parameter is needed only when converting
to XLIFF, to provide a value for the datatype attribute of the
XLIFF's file element.) If converting from XLIFF, the datatype
is read from the XLIFF file; this parameter is ignored.nativeFileName
- The name of the native file. If we are converting
from a native format to XLIFF, this specifies the name of the file to
convert to XLIFF. If conversion is from XLIFF back to the native format,
this parameter specifies the name of the file generated from XLIFF.baseDir
- The directory (in the file system) from which input files
will be read, and to which output files will be written.notifier
- Instance of a class that implements the Notifier
interface (to send notifications in case of conversion error).boundary
- The boundary on which to segment translation units (e.g.,
on paragraph or sentence boundaries)generatedFileName
- If this parameter is non-null, the converter
implementation might write the name of the generated output file
to this parameter (a StringWriter).
ConversionException
- If a conversion exception is encountered.@Deprecated ConversionStatus convert(ConversionMode mode, java.util.Locale language, java.lang.String phaseName, int maxPhase, java.nio.charset.Charset nativeEncoding, FileType nativeFileType, java.lang.String nativeFileName, java.lang.String baseDir, Notifier notifier) throws ConversionException
mode
- The mode of conversion (to or from XLIFF).language
- The language of the native document. If we are converting
from a native format to XLIFF, the language becomes the <source>
xml:lang in the XLIFF. If conversion is from XLIFF back to the native
format, the language selects which <target> (in the XLIFF's
translation-units) will provide the strings for the destination native
document.phaseName
- The name of the phase to convert. (This is meaningful
only for conversions from XLIFF back to the native format, where
there are multiple target elements for the same locale, differentiated
only by the optional phase-name attribute.) This parameter is
ignored if conversion is to XLIFF. If converting from XLIFF back
to a native format and the XLIFF target elements do not use the
phase-name attribute, specify null for this parameter.
Special behavior: If the phase name string consists entirely of numeric digits equivalent to an integer with value greater than 1 but less than or equal to maxPhase (see below), the implementation may choose to search for targets with phase-names of earlier numerically named phase names.
maxPhase
- The maximum phase number. (This is meaningful
only for conversions from XLIFF back to the native format, where
there are multiple target elements for the same locale, differentiated
only by the optional phase-name attribute.) This parameter is
ignored if conversion is to XLIFF.
If phaseName is specified as "0" and maxPhase is a non-negative integer, search for the highest "numbered" phase, starting at maxPhase, and searching down to phase "1".
nativeEncoding
- The encoding of the native document. If we are
converting a native document to XLIFF, this parameter tells the converter
how to interpret the bytes read from the native document as it converts
to UTF-8 used by XLIFF. If conversion is from XLIFF back to the native
format, this parameter tells the converter what to convert the UTF-8-
encoding back to.
Note: If the native format offers no choice of encoding, then this parameter's value is ignored.
nativeFileType
- The type of the native file. Examples: "HTML",
"WORD". (Note: This parameter is needed only when converting
to XLIFF, to provide a value for the datatype attribute of the
XLIFF's file element.) If converting from XLIFF, the datatype
is read from the XLIFF file; this parameter is ignored.nativeFileName
- The name of the native file. If we are converting
from a native format to XLIFF, this specifies the name of the file to
convert to XLIFF. If conversion is from XLIFF back to the native format,
this parameter specifies the name of the file generated from XLIFF.baseDir
- The directory (in the file system) from which input files
will be read, and to which output files will be written.notifier
- Instance of a class that implements the Notifier
interface (to send notifications in case of conversion error).
ConversionException
- If a conversion exception is encountered.java.lang.Object getConversionProperty(java.lang.String property)
property
- The name of the property to return.
FileType getFileType()
void setConversionProperty(java.lang.String property, java.lang.Object value) throws ConversionException
property
- The name of the propertyvalue
- The value of the property
ConversionException
- If the property isn't recognized (and if it matters).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |