Package org.jvnet.hk2.generator
Class HabitatGenerator
java.lang.Object
org.jvnet.hk2.generator.HabitatGenerator
This is a command line (or embedded) utility
that will generate habitat files based on
@Service annotations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String
static final String
This option gives the name of directory in the target location where the file should be placedprivate final String
static final String
The flag for the location of the filestatic final String
private final boolean
static final String
The flag for the name of the locatorprivate static final String
private final String
private static final String
static final String
This option gives the name of directory in the target location where the file should be placedprivate final boolean
static final String
This option will write files in-place, which is quicker but will remove existing files prior to writing new onesstatic final String
The name of the JAR file to write to (defaults to input file, ignored if input file is directory)private final String
private final String
private final String
static final String
The path-separator delimited list of files to search for contracts and qualifiers (defaults to classpath)private final boolean
static final String
The flag for verbosity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
embeddedMain
(String[] argv) A utility to generate inhabitants files.private int
go()
static void
This method will call System.exit() with a 0 on success and non-zero on failureprivate void
private static void
usage()
-
Field Details
-
CLASS_PATH_PROP
- See Also:
-
CLASSPATH
-
FILE_ARG
The flag for the location of the file- See Also:
-
LOCATOR_ARG
The flag for the name of the locator- See Also:
-
VERBOSE_ARG
The flag for verbosity- See Also:
-
OUTJAR_ARG
The name of the JAR file to write to (defaults to input file, ignored if input file is directory)- See Also:
-
SEARCHPATH_ARG
The path-separator delimited list of files to search for contracts and qualifiers (defaults to classpath)- See Also:
-
NOSWAP_ARG
This option will write files in-place, which is quicker but will remove existing files prior to writing new ones- See Also:
-
DIRECTORY_ARG
This option gives the name of directory in the target location where the file should be placed- See Also:
-
NO_DATE_ARG
This option gives the name of directory in the target location where the file should be placed- See Also:
-
directoryOrFileToGenerateFor
-
outjarName
-
locatorName
-
verbose
private final boolean verbose -
searchPath
-
noSwap
private final boolean noSwap -
outputDirectory
-
includeDate
private final boolean includeDate -
LOCATOR_DEFAULT
- See Also:
-
META_INF
- See Also:
-
HK2_LOCATOR
- See Also:
-
-
Constructor Details
-
HabitatGenerator
-
-
Method Details
-
printThrowable
-
go
private int go() -
usage
private static void usage() -
embeddedMain
A utility to generate inhabitants files. By default the first element of the classpath will be analyzed and an inhabitants file will be put into the JAR or directory. The arguments are as follows:HabitatGenerator [--file jarFileOrDirectory] [--searchPath path-separator-delimited-classpath] [--outjar jarfile] [--locator locatorName] [--directory targetDirectory] [--verbose]
If the input file is a directory then the output file will go into META-INF/locatorName in the original directoryIf the input file is a jar file then the output file will go into the JAR file under META-INF/locatorName, overwriting any file that was previously in that location
--outjar only works if the file being added to is a JAR file, in which case this is the name of the output jar file that should be written. This defaults to the input jar file itself if not specified. If specified and the jarFileOrDirectory parameter is a directory then this parameter is ignored
- Parameters:
argv
- The set of command line arguments- Returns:
- 0 on success, non-zero on failure
-
main
This method will call System.exit() with a 0 on success and non-zero on failure- Parameters:
argv
- The arguments to the command (see embeddedMain)
-