public class GeneratorRunner
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DOT_CLASS |
private java.lang.String |
fileOrDirectory |
private boolean |
includeDate |
private static java.lang.String |
INHABITANTS |
private java.lang.String |
locatorName |
private static java.lang.String |
META_INF |
private boolean |
noSwap |
private boolean |
outJarIsInJar |
private java.lang.String |
outjarName |
private java.lang.String |
outputDirectory |
private static java.lang.String |
TARGET_HABITATS |
private Utilities |
utilities |
private boolean |
verbose |
Constructor and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
private java.util.List<DescriptorImpl> |
findAllServicesFromJar(java.io.File jar) |
void |
go()
Does the work of writing out the inhabitants file to the proper location
|
private void |
writeHeader(java.io.PrintWriter writer) |
private java.io.File |
writeInhabitantsFile(java.util.List<DescriptorImpl> descriptors,
java.io.File noSwapFile,
java.io.File outDir) |
private void |
writeToDirectory(java.util.List<DescriptorImpl> allDescriptors) |
private void |
writeToJar(java.io.File jarFile,
java.util.List<DescriptorImpl> descriptors) |
private void |
writeToJarNoSwap(java.io.File jarFile,
java.util.List<DescriptorImpl> descriptors) |
private static final java.lang.String DOT_CLASS
private static final java.lang.String META_INF
private static final java.lang.String INHABITANTS
private static final java.lang.String TARGET_HABITATS
private final Utilities utilities
private final java.lang.String fileOrDirectory
private final java.lang.String outjarName
private final java.lang.String locatorName
private final boolean verbose
private final boolean noSwap
private final java.lang.String outputDirectory
private final boolean includeDate
private final boolean outJarIsInJar
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)
fileOrDirectory
- The fileOrDirectory to inspect for servicesoutjarName
- The name of the jar file to create (can be the fileOrDirectory)locatorName
- The name of the locator these files should be put intoverbose
- true if this should print information about progresssearchPath
- The path-separator delimited list of files or directories to search for
contracts and qualifiers and various other annotationsnoSwap
- true if this run should NOT swap files (faster but riskier)outputDirectory
- The directory where the file should goincludeDate
- Whether or not the output file should include a datepublic void go() throws java.lang.AssertionError, java.io.IOException
java.lang.AssertionError
- On an error such as not being able to find the
proper filejava.io.IOException
- On IO errorprivate void writeToDirectory(java.util.List<DescriptorImpl> allDescriptors) throws java.io.IOException
java.io.IOException
private void writeToJar(java.io.File jarFile, java.util.List<DescriptorImpl> descriptors) throws java.io.IOException
java.io.IOException
private void writeToJarNoSwap(java.io.File jarFile, java.util.List<DescriptorImpl> descriptors) throws java.io.IOException
java.io.IOException
private java.io.File writeInhabitantsFile(java.util.List<DescriptorImpl> descriptors, java.io.File noSwapFile, java.io.File outDir) throws java.io.IOException
java.io.IOException
private void writeHeader(java.io.PrintWriter writer)
private java.util.List<DescriptorImpl> findAllServicesFromJar(java.io.File jar) throws java.io.IOException
java.io.IOException