Package org.jvnet.hk2.generator.internal
Class GeneratorRunner
- java.lang.Object
-
- org.jvnet.hk2.generator.internal.GeneratorRunner
-
public class GeneratorRunner extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringDOT_CLASSprivate java.lang.StringfileOrDirectoryprivate booleanincludeDateprivate static java.lang.StringINHABITANTSprivate java.lang.StringlocatorNameprivate static java.lang.StringMETA_INFprivate booleannoSwapprivate booleanoutJarIsInJarprivate java.lang.StringoutjarNameprivate java.lang.StringoutputDirectoryprivate static java.lang.StringTARGET_HABITATSprivate Utilitiesutilitiesprivate booleanverbose
-
Constructor Summary
Constructors Constructor 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
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.List<DescriptorImpl>findAllServicesFromJar(java.io.File jar)voidgo()Does the work of writing out the inhabitants file to the proper locationprivate voidwriteHeader(java.io.PrintWriter writer)private java.io.FilewriteInhabitantsFile(java.util.List<DescriptorImpl> descriptors, java.io.File noSwapFile, java.io.File outDir)private voidwriteToDirectory(java.util.List<DescriptorImpl> allDescriptors)private voidwriteToJar(java.io.File jarFile, java.util.List<DescriptorImpl> descriptors)private voidwriteToJarNoSwap(java.io.File jarFile, java.util.List<DescriptorImpl> descriptors)
-
-
-
Field Detail
-
DOT_CLASS
private static final java.lang.String DOT_CLASS
- See Also:
- Constant Field Values
-
META_INF
private static final java.lang.String META_INF
- See Also:
- Constant Field Values
-
INHABITANTS
private static final java.lang.String INHABITANTS
- See Also:
- Constant Field Values
-
TARGET_HABITATS
private static final java.lang.String TARGET_HABITATS
- See Also:
- Constant Field Values
-
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 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 date
-
-
Method Detail
-
go
public void go() throws java.lang.AssertionError, java.io.IOExceptionDoes 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 filejava.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
-
-