Class XMLStreamReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class XMLStreamReader
    extends java.lang.Object
    implements java.io.Closeable
    A reader for XML stream.
    • Constructor Detail

      • XMLStreamReader

        public XMLStreamReader()
    • Method Detail

      • setStream

        public final void setStream​(java.io.File name)
                             throws java.io.FileNotFoundException,
                                    java.io.UnsupportedEncodingException,
                                    java.io.IOException,
                                    TranslationException
        Throws:
        java.io.FileNotFoundException
        java.io.UnsupportedEncodingException
        java.io.IOException
        TranslationException
      • setStream

        public final void setStream​(java.lang.String name,
                                    java.lang.String encoding)
                             throws java.io.FileNotFoundException,
                                    java.io.UnsupportedEncodingException,
                                    java.io.IOException,
                                    TranslationException
        Throws:
        java.io.FileNotFoundException
        java.io.UnsupportedEncodingException
        java.io.IOException
        TranslationException
      • setStream

        public void setStream​(java.io.InputStream stream)
                       throws java.io.IOException,
                              TranslationException
        Provide an interface where stream can be opened elsewhere.
        Throws:
        java.io.IOException
        TranslationException
      • setStream

        public void setStream​(java.io.InputStream stream,
                              java.lang.String encoding)
                       throws java.io.IOException,
                              TranslationException
        Provide an interface where stream can be opened elsewhere.
        Throws:
        java.io.IOException
        TranslationException
      • killEmptyBlocks

        public final void killEmptyBlocks()
      • breakOnWhitespace

        public final void breakOnWhitespace​(boolean brk)
      • compressWhitespace

        public final void compressWhitespace​(boolean tof)
      • makeValidXML

        public java.lang.String makeValidXML​(int cp)
        Converts a single code point into valid XML. Output stream must convert stream to UTF-8 when saving to disk.
      • makeValidXML

        public java.lang.String makeValidXML​(java.lang.String plaintext)
        Converts a stream of plaintext into valid XML. Output stream must convert stream to UTF-8 when saving to disk.
      • getHeadBlock

        public final XMLBlock getHeadBlock()
      • close

        public void close()
                   throws java.io.IOException
        Closes the TMX file
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException