Class GeneratorRunner


  • public class GeneratorRunner
    extends java.lang.Object
    • Field Detail

      • utilities

        private final Utilities utilities
      • fileOrDirectory

        private final java.lang.String fileOrDirectory
      • outjarName

        private final java.lang.String outjarName
      • locatorName

        private final java.lang.String locatorName
      • verbose

        private final boolean verbose
      • noSwap

        private final boolean noSwap
      • outputDirectory

        private final java.lang.String outputDirectory
      • includeDate

        private final boolean includeDate
      • outJarIsInJar

        private final boolean outJarIsInJar
    • Constructor Detail

      • GeneratorRunner

        public GeneratorRunner​(java.lang.String fileOrDirectory,
                               java.lang.String outjarName,
                               java.lang.String locatorName,
                               boolean verbose,
                               java.lang.String searchPath,
                               boolean noSwap,
                               java.lang.String outputDirectory,
                               boolean includeDate)
        This initializes the GeneratorRunner with the values needed to run
        Parameters:
        fileOrDirectory - The fileOrDirectory to inspect for services
        outjarName - The name of the jar file to create (can be the fileOrDirectory)
        locatorName - The name of the locator these files should be put into
        verbose - true if this should print information about progress
        searchPath - The path-separator delimited list of files or directories to search for contracts and qualifiers and various other annotations
        noSwap - true if this run should NOT swap files (faster but riskier)
        outputDirectory - The directory where the file should go
        includeDate - Whether or not the output file should include a date
    • Method Detail

      • go

        public void go()
                throws java.lang.AssertionError,
                       java.io.IOException
        Does the work of writing out the inhabitants file to the proper location
        Throws:
        java.lang.AssertionError - On an error such as not being able to find the proper file
        java.io.IOException - On IO error
      • writeToDirectory

        private void writeToDirectory​(java.util.List<DescriptorImpl> allDescriptors)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • writeToJar

        private void writeToJar​(java.io.File jarFile,
                                java.util.List<DescriptorImpl> descriptors)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • writeToJarNoSwap

        private void writeToJarNoSwap​(java.io.File jarFile,
                                      java.util.List<DescriptorImpl> descriptors)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • writeInhabitantsFile

        private java.io.File writeInhabitantsFile​(java.util.List<DescriptorImpl> descriptors,
                                                  java.io.File noSwapFile,
                                                  java.io.File outDir)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • writeHeader

        private void writeHeader​(java.io.PrintWriter writer)
      • findAllServicesFromJar

        private java.util.List<DescriptorImpl> findAllServicesFromJar​(java.io.File jar)
                                                               throws java.io.IOException
        Throws:
        java.io.IOException