Class PackageManager


  • public class PackageManager
    extends java.lang.Object
    Given a list of directories, parse them out and store them as rendered packages, classes, imports, etc.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private PackageType defaultPackage
      The default Java package.
      private java.util.Set<java.nio.file.Path> directories  
      private java.lang.String[] excludes
      The list of exclude patterns to use.
      private FileManager fileManager  
      private java.lang.String[] includes
      The list of include patterns to use.
      private static org.slf4j.Logger LOGGER  
      private java.util.Map<java.lang.String,​PackageType> packages
      All the packages that have been parsed
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addPackageType​(PackageType packageType)
      Add a package to this package manager.
      void dump()
      Dump the package information to STDOUT.
      PackageType getPackageType​(java.lang.String name)
      Given the name of a package (Ex: org.apache.maven.util) obtain it from the package manager.
      java.util.Collection<PackageType> getPackageTypes()
      Gets all of the packages in this package manager.
      private void parse​(java.nio.file.Path baseDir)
      Parse out all the directories on which this depends.
      void process​(java.nio.file.Path directory)  
      void setExcludes​(java.lang.String[] excludes)  
      void setIncludes​(java.lang.String[] includes)  
      • Methods inherited from class java.lang.Object

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

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • directories

        private java.util.Set<java.nio.file.Path> directories
      • packages

        private java.util.Map<java.lang.String,​PackageType> packages
        All the packages that have been parsed
      • defaultPackage

        private PackageType defaultPackage
        The default Java package.
      • excludes

        private java.lang.String[] excludes
        The list of exclude patterns to use.
      • includes

        private java.lang.String[] includes
        The list of include patterns to use.
    • Constructor Detail

      • PackageManager

        public PackageManager​(FileManager fileManager)
    • Method Detail

      • getPackageType

        public PackageType getPackageType​(java.lang.String name)
        Given the name of a package (Ex: org.apache.maven.util) obtain it from the package manager.
        Parameters:
        name - name of package
        Returns:
        package type if found or default package type
      • addPackageType

        public void addPackageType​(PackageType packageType)
        Add a package to this package manager.
        Parameters:
        packageType - package type to add
      • getPackageTypes

        public java.util.Collection<PackageType> getPackageTypes()
        Gets all of the packages in this package manager.
        Returns:
        package types
      • parse

        private void parse​(java.nio.file.Path baseDir)
        Parse out all the directories on which this depends.
      • process

        public void process​(java.nio.file.Path directory)
      • dump

        public void dump()
        Dump the package information to STDOUT. FOR DEBUG ONLY
      • setExcludes

        public void setExcludes​(java.lang.String[] excludes)
      • setIncludes

        public void setIncludes​(java.lang.String[] includes)