com.ibm.dbb.dependency

Class AbstractDependencyScanner

  • java.lang.Object
    • com.ibm.dbb.dependency.AbstractDependencyScanner
  • All Implemented Interfaces:
    IDependencyScanner
    Direct Known Subclasses:
    DependencyScanner, ZUnitConfigScanner


    public abstract class AbstractDependencyScanner
    extends java.lang.Object
    implements IDependencyScanner
    Abstract dependency scanner class to help jump start creating a new DBB source code scanner. Implements IDependencyScanner. Users just need to extend this class and implement methods:
     protected Object runScan(String file, InputStream is, String encoding);
     protected abstract LogicalFile createLogicalFile(String file, Object scanMetadata);
     
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String createLogicalName(java.lang.String fileName)
      Create a logical name from a file name, for example: /u/user/test/cobol/myfile.cbl will create logical name MYFILE
      LogicalFile scan(java.lang.String file, java.io.InputStream inputStream)
      Scan and collect logical dependency of a file
      LogicalFile scan(java.lang.String file, java.io.InputStream inputStream, java.lang.String encoding)
      Scan and collect logical dependency of a file
      LogicalFile scan(java.lang.String file, java.lang.String sourceDir)
      Scan and collect logical dependency of a file
      LogicalFile scan(java.lang.String file, java.lang.String sourceDir, java.lang.String encoding)
      Scan and collect logical dependency of a file
      java.util.List<LogicalFile> scanArchive(java.lang.String archive, java.lang.String sourceDir)
      Scan and collect logical dependencies from an archive
      java.util.List<LogicalFile> scanArchive(java.lang.String archive, java.lang.String sourceDir, java.lang.String encoding)
      Scan and collect logical dependencies from an archive
      LogicalFile scanArchivedFile(java.lang.String archive, java.lang.String sourceDir, java.lang.String file)
      Scan and collect the logical dependency from an archived file
      LogicalFile scanArchivedFile(java.lang.String archive, java.lang.String sourceDir, java.lang.String file, java.lang.String encoding)
      Scan and collect the logical dependency from an archived file
      • Methods inherited from class java.lang.Object

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

      • AbstractDependencyScanner

        public AbstractDependencyScanner()
    • Method Detail

      • scan

        public LogicalFile scan(java.lang.String file,
                                java.lang.String sourceDir)
                         throws java.io.FileNotFoundException
        Scan and collect logical dependency of a file
        Specified by:
        scan in interface IDependencyScanner
        Parameters:
        file - the name of the file
        sourceDir - directory where the file can be located
        Returns:
        scan
        Throws:
        java.io.FileNotFoundException - an exception occurred
      • scan

        public LogicalFile scan(java.lang.String file,
                                java.lang.String sourceDir,
                                java.lang.String encoding)
                         throws java.io.FileNotFoundException
        Scan and collect logical dependency of a file
        Specified by:
        scan in interface IDependencyScanner
        Parameters:
        file - the name of the file
        sourceDir - directory where the file can be located
        encoding - the encoding to be used to read the content of the file
        Returns:
        scan
        Throws:
        java.io.FileNotFoundException - an exception occurred
      • scan

        public LogicalFile scan(java.lang.String file,
                                java.io.InputStream inputStream)
        Scan and collect logical dependency of a file
        Specified by:
        scan in interface IDependencyScanner
        Parameters:
        file - the name of the file
        inputStream - the file content
        Returns:
        scan
      • scan

        public LogicalFile scan(java.lang.String file,
                                java.io.InputStream inputStream,
                                java.lang.String encoding)
        Scan and collect logical dependency of a file
        Specified by:
        scan in interface IDependencyScanner
        Parameters:
        file - the name of the file
        inputStream - the file content
        encoding - the encoding to be used to read the content of the file
        Returns:
        scan
      • scanArchive

        public java.util.List<LogicalFile> scanArchive(java.lang.String archive,
                                                       java.lang.String sourceDir)
                                                throws BuildException
        Scan and collect logical dependencies from an archive
        Specified by:
        scanArchive in interface IDependencyScanner
        Parameters:
        archive - the name of the archive
        sourceDir - the directory where the archive can be located
        Returns:
        scanArchive
        Throws:
        BuildException - an exception occurred
      • scanArchive

        public java.util.List<LogicalFile> scanArchive(java.lang.String archive,
                                                       java.lang.String sourceDir,
                                                       java.lang.String encoding)
                                                throws BuildException
        Scan and collect logical dependencies from an archive
        Specified by:
        scanArchive in interface IDependencyScanner
        Parameters:
        archive - the name of the archive
        sourceDir - the directory where the archive can be located
        encoding - the encoding of the file content
        Returns:
        scanArchive
        Throws:
        BuildException - an exception occurred
      • scanArchivedFile

        public LogicalFile scanArchivedFile(java.lang.String archive,
                                            java.lang.String sourceDir,
                                            java.lang.String file)
                                     throws BuildException
        Scan and collect the logical dependency from an archived file
        Specified by:
        scanArchivedFile in interface IDependencyScanner
        Parameters:
        archive - the name of the archive
        sourceDir - the directory where the archive can be located
        file - the name of the file
        Returns:
        scanArchivedFile
        Throws:
        BuildException - an exception occurred
      • scanArchivedFile

        public LogicalFile scanArchivedFile(java.lang.String archive,
                                            java.lang.String sourceDir,
                                            java.lang.String file,
                                            java.lang.String encoding)
                                     throws BuildException
        Scan and collect the logical dependency from an archived file
        Specified by:
        scanArchivedFile in interface IDependencyScanner
        Parameters:
        archive - the name of the archive
        sourceDir - the directory where the archive can be located
        file - the name of the file
        encoding - the encoding
        Returns:
        scanArchivedFile
        Throws:
        BuildException - an exception occurred
      • createLogicalName

        public java.lang.String createLogicalName(java.lang.String fileName)
        Create a logical name from a file name, for example: /u/user/test/cobol/myfile.cbl will create logical name MYFILE
        Parameters:
        fileName - the name of the file on HFS
        Returns:
        the logical name

<IBM Copyright © 2018 IBM Corp. All Rights Reserved.