Class ClassEnumerationReader


  • public final class ClassEnumerationReader
    extends java.lang.Object
    Reads plain text files enumerating classes to take from the classpath and add to a ClasspathLibraryInfo. Files should have a format similar to the following:
     - com.mycompany.pkg1.Class1
     Class2
     Class3
     - com.mycompany.pkg2.Foo
     Bar
     - another.pkg.Utils
     ...
     
    Such files are expected to be UTF-8. The exact file structure is as follows:
    • Lines that start with a "-" denote a fully-qualified class, interface, or enum name.
    • Lines following a line starting with "-" are simply a class, interface, or enum name, and are assumed to be in the same package as the previous class on the "-" line.
    • Blank lines and lines starting with "#" are ignored.
    Version:
    1.0
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ClassEnumerationReader()
      Private constructor to prevent instantiation.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> getClassNames​(java.io.InputStream in)
      Returns the list of classes specified in the given stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassEnumerationReader

        private ClassEnumerationReader()
        Private constructor to prevent instantiation.
    • Method Detail

      • getClassNames

        public static java.util.List<java.lang.String> getClassNames​(java.io.InputStream in)
                                                              throws java.io.IOException
        Returns the list of classes specified in the given stream.
        Parameters:
        in - The input stream to read from. This will be closed when this method returns.
        Returns:
        The list of class names read.
        Throws:
        java.io.IOException - If an IO error occurs.