Class FileSystemClassInformationRepository

    • Field Detail

      • hierarchyMap

        private final java.util.Map<java.lang.String,​ClassInformation> hierarchyMap
    • Constructor Detail

      • FileSystemClassInformationRepository

        public FileSystemClassInformationRepository()
    • Method Detail

      • create

        public static FileSystemClassInformationRepository create​(java.util.List<java.io.File> initialClasspath)
                                                           throws java.io.IOException
        Constructs a FileSystemClassInformationRepository object and loads it up with the classes in a classpath.
        Parameters:
        initialClasspath - classpath to scan for class information (can be JAR files and/or folders)
        Returns:
        newly created FileSystemClassInformationRepository object
        Throws:
        java.lang.NullPointerException - if any argument is null or contains null elements
        java.io.IOException - if an IO error occurs
      • getInformation

        public ClassInformation getInformation​(java.lang.String internalClassName)
        Description copied from interface: ClassInformationRepository
        Get information for a class.

        This method returns class information as if it were encountered in a class file. In a class file, if the class is an interface, then its superclass is set to Object. Note that this is different from what Class.getSuperclass() returns when the class represents an interface (it returns null).

        Specified by:
        getInformation in interface ClassInformationRepository
        Parameters:
        internalClassName - internal class name
        Returns:
        information for that class, or null if not found
      • addIndividual

        public void addIndividual​(java.lang.String className,
                                  ClassInformation classInformation)
        Add a custom class.
        Parameters:
        className - name of class
        classInformation - information for class
        Throws:
        java.lang.NullPointerException - if any argument is null
        java.lang.IllegalArgumentException - if className already exists in this repository
      • addClasspath

        public void addClasspath​(java.util.List<java.io.File> classpath)
                          throws java.io.IOException
        Add classes contained within a list of JAR files and folders. Note that if a duplicate class is encountered, the original is kept.
        Parameters:
        classpath - list of JARs and folders to scan
        Throws:
        java.lang.NullPointerException - if any argument is null or contains null elements
        java.io.IOException - if an IO error occurs
      • addDirectory

        private void addDirectory​(java.io.File directory)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • addJar

        private void addJar​(java.io.File file)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • populateSuperClassMapping

        private void populateSuperClassMapping​(java.io.InputStream is)
                                        throws java.io.IOException
        Throws:
        java.io.IOException