Class TMXReader2


  • public class TMXReader2
    extends java.lang.Object
    Helper for read TMX files, using StAX.
    See Also:
    TMX 1.4b specification
    • 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
    • Constructor Detail

      • TMXReader2

        public TMXReader2()
    • 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)