Module org.hsqldb

Class LineGroupReader


  • public class LineGroupReader
    extends java.lang.Object
    Uses a LineNumberReader and returns multiple consecutive lines which conform to the specified group demarcation characteristics. Any exception thrown while reading from the reader is handled internally.
    Since:
    1.9.0
    Author:
    Fred Toussi (fredt@users dot sourceforge.net)
    • Constructor Detail

      • LineGroupReader

        public LineGroupReader​(java.io.LineNumberReader reader)
        Default constructor for TestUtil usage. Sections start at lines beginning with any non-space character. SQL comment lines are ignored.
        Parameters:
        reader - LineNumberReader
      • LineGroupReader

        public LineGroupReader​(java.io.LineNumberReader reader,
                               java.lang.String[] sectionStarts)
        Constructor for sections starting with specified strings.
        Parameters:
        reader - LineNumberReader
        sectionStarts - String[]
    • Method Detail

      • getNextSection

        public HsqlArrayList<java.lang.String> getNextSection()
      • getSectionAsString

        public java.lang.String getSectionAsString()
      • getAsMap

        public OrderedHashMap<java.lang.String,​java.lang.String> getAsMap()
        Returns a map/list which contains the first line of each line group as key and the rest of the lines as a String value.
        Returns:
        OrderedHashMap
      • getStartLineNumber

        public int getStartLineNumber()
      • close

        public void close()
      • convertToString

        public static java.lang.String convertToString​(HsqlArrayList<java.lang.String> list,
                                                       int offset)
      • getStatementMap

        public static OrderedHashMap<java.lang.String,​java.lang.String> getStatementMap​(java.lang.String path)
      • getGroupReader

        public static LineGroupReader getGroupReader​(java.lang.String path,
                                                     java.lang.String[] starters)
      • getGroupReader

        public static LineGroupReader getGroupReader​(java.lang.String path)