Package org.omegat.util
Class TMXReader2
- java.lang.Object
-
- org.omegat.util.TMXReader2
-
public class TMXReader2 extends java.lang.Object
Helper for read TMX files, using StAX.- See Also:
- TMX 1.4b specification
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TMXReader2.LoadCallback
Callback for receive data from TMX.static class
TMXReader2.ParsedTu
static class
TMXReader2.ParsedTuv
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CT_OMEGAT
Creation Tool attribute value of OmegaT TMXs: "OmegaT"static java.lang.String
SEG_PARAGRAPH
Segment Type attribute value: "paragraph"static java.lang.String
SEG_SENTENCE
Segment Type attribute value: "sentence"static org.xml.sax.EntityResolver
TMX_DTD_RESOLVER
static javax.xml.stream.XMLResolver
TMX_DTD_RESOLVER_2
-
Constructor Summary
Constructors Constructor Description TMXReader2()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
detectCharset(java.io.File file)
Detects charset of XML file.boolean
isParagraphSegtype()
long
parseISO8601date(java.lang.String str)
void
readTMX(java.io.File file, Language sourceLanguage, Language targetLanguage, boolean isSegmentingEnabled, boolean forceOmegaTMX, boolean extTmxLevel2, boolean useSlash, TMXReader2.LoadCallback callback)
Read TMX file.
-
-
-
Field Detail
-
SEG_PARAGRAPH
public static final java.lang.String SEG_PARAGRAPH
Segment Type attribute value: "paragraph"- See Also:
- Constant Field Values
-
SEG_SENTENCE
public static final java.lang.String SEG_SENTENCE
Segment Type attribute value: "sentence"- See Also:
- Constant Field Values
-
CT_OMEGAT
public static final java.lang.String CT_OMEGAT
Creation Tool attribute value of OmegaT TMXs: "OmegaT"- See Also:
- Constant Field Values
-
TMX_DTD_RESOLVER
public static final org.xml.sax.EntityResolver TMX_DTD_RESOLVER
-
TMX_DTD_RESOLVER_2
public static final javax.xml.stream.XMLResolver TMX_DTD_RESOLVER_2
-
-
Method Detail
-
detectCharset
public static java.lang.String detectCharset(java.io.File file) throws java.io.IOException
Detects charset of XML file.- Throws:
java.io.IOException
-
isParagraphSegtype
public boolean isParagraphSegtype()
-
readTMX
public void readTMX(java.io.File file, Language sourceLanguage, Language targetLanguage, boolean isSegmentingEnabled, boolean forceOmegaTMX, boolean extTmxLevel2, boolean useSlash, TMXReader2.LoadCallback callback) throws java.lang.Exception
Read TMX file.- Throws:
java.lang.Exception
-
parseISO8601date
public long parseISO8601date(java.lang.String str)
-
-