| java.lang.Object java.lang.Thread com.izforge.izpack.compiler.CompilerConfig
CompilerConfig | public class CompilerConfig extends Thread (Code) | | A parser for the installer xml configuration. This parses a document
conforming to the installation.dtd and populates a Compiler instance to
perform the install compilation.
author: Scott Stark version: $Revision: 2061 $ |
Constructor Summary | |
public | CompilerConfig(String filename, String basedir, String kind, String output) The constructor. | public | CompilerConfig(String filename, String basedir, String kind, String output, PackagerListener listener) The constructor. | public | CompilerConfig(String filename, String base, String kind, String output, String compr_format, PackagerListener listener) | public | CompilerConfig(String basedir, String kind, String output, PackagerListener listener, String installText) | public | CompilerConfig(String filename, String basedir, String kind, String output, String compr_format, PackagerListener listener, String installText) | public | CompilerConfig(String filename, String basedir, String kind, String output, String compr_format, int compr_level, PackagerListener listener, String installText) |
Method Summary | |
protected void | addArchiveContent(File baseDir, File archive, String targetdir, List<OsConstraint> osList, int override, PackInfo pack, Map additionals, String condition) | protected void | addConditions(XMLElement data) Parse conditions and add them to the compiler. | protected void | addDynamicVariables(XMLElement data) | protected void | addGUIPrefs(XMLElement data) Returns the GUIPrefs. | protected void | addInfo(XMLElement data) Builds the Info class from the XML tree.
Parameters: data - The XML data. | protected void | addJars(XMLElement data) Add project specific external jar files to the installer. | protected void | addLangpacks(XMLElement data) Adds the ISO3 codes of the langpacks and associated resources. | protected void | addNativeLibraries(XMLElement data) Add native libraries to the installer. | protected void | addPacks(XMLElement data) Add packs and their contents to the installer. | protected void | addPanels(XMLElement data) Parse panels and their paramters, locate the panels resources and add to the Packager. | public boolean | addProperty(String name, String value) Add a name value pair to the project property set. | protected void | addRecursively(File baseDir, File file, String targetdir, List<OsConstraint> osList, int override, PackInfo pack, Map additionals, String condition) Recursive method to add files in a pack. | protected void | addResources(XMLElement data) Adds the resources. | protected void | addVariables(XMLElement data) Variable declaration is a fragment of the xml file. | public void | checkDependencies(List<PackInfo> packs) Checks whether the dependencies stated in the configuration file are correct. | public void | compile() | public void | executeCompiler() Compiles the installation. | public Compiler | getCompiler() | protected int | getOverrideValue(XMLElement f) | public PackagerListener | getPackagerListener() | protected XMLElement | getXMLTree() Returns the XMLElement representing the installation XML file. | public static void | main(String[] args) The main method if the compiler is invoked by a command-line call. | protected void | parseError(String message) Create parse error with consistent messages. | protected void | parseError(XMLElement parent, String message) Create parse error with consistent messages. | protected void | parseError(XMLElement parent, String message, Throwable cause) Create a chained parse error with consistent messages. | protected void | parseWarn(XMLElement parent, String message) Create a parse warning with consistent messages. | protected String | requireAttribute(XMLElement element, String attribute) Call getAttribute on an element, producing a meaningful error message if not present, or
empty. | protected XMLElement | requireChildNamed(XMLElement parent, String name) Call getFirstChildNamed on the parent, producing a meaningful error message on failure. | protected String | requireContent(XMLElement element) Call getContent on an element, producing a meaningful error message if not present, or empty. | protected int | requireIntAttribute(XMLElement element, String attribute) Get a required attribute of an element, ensuring it is an integer. | protected URL | requireURLContent(XMLElement element) Call getContent on an element, producing a meaningful error message if not present, or empty,
or a valid URL. | protected boolean | requireYesNoAttribute(XMLElement element, String attribute) Call getAttribute on an element, producing a meaningful error message if not present, or one
of "yes" or "no". | public void | run() The run() method. | public static void | setIzpackHome(String izHome) | protected void | substituteAllProperties(XMLElement element) | protected void | substituteProperties(XMLElement data) Properties declaration is a fragment of the xml file. | protected boolean | validateYesNo(String value) | protected boolean | validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue) Call getAttribute on an element, producing a meaningful warning if not "yes" or "no". | public boolean | wasSuccessful() |
STANDARD | final public static String STANDARD(Code) | | Standard installer.
|
VERSION | final public static String VERSION(Code) | | The compiler version.
|
compilerListeners | protected List<CompilerListener> compilerListeners(Code) | | List of CompilerListeners which should be called at packaging
|
CompilerConfig | public CompilerConfig(String filename, String basedir, String kind, String output) throws CompilerException(Code) | | The constructor.
Parameters: filename - The XML filename. Parameters: basedir - The base directory. Parameters: kind - The installer kind. Parameters: output - The installer filename. throws: CompilerException - |
CompilerConfig | public CompilerConfig(String filename, String basedir, String kind, String output, PackagerListener listener) throws CompilerException(Code) | | The constructor.
Parameters: filename - The XML filename. Parameters: basedir - The base directory. Parameters: kind - The installer kind. Parameters: output - The installer filename. Parameters: listener - The PackagerListener. throws: CompilerException - |
CompilerConfig | public CompilerConfig(String filename, String base, String kind, String output, String compr_format, PackagerListener listener) throws CompilerException(Code) | | Parameters: filename - The XML filename. Parameters: kind - The installer kind. Parameters: output - The installer filename. Parameters: compr_format - The compression format to be used for packs. Parameters: listener - The PackagerListener. throws: CompilerException - |
CompilerConfig | public CompilerConfig(String basedir, String kind, String output, PackagerListener listener, String installText) throws CompilerException(Code) | | Parameters: basedir - The base directory. Parameters: kind - The installer kind. Parameters: output - The installer filename. Parameters: listener - The PackagerListener. Parameters: installText - The install xml configuration text throws: CompilerException - |
CompilerConfig | public CompilerConfig(String filename, String basedir, String kind, String output, String compr_format, PackagerListener listener, String installText) throws CompilerException(Code) | | Parameters: filename - The XML filename. Parameters: basedir - The base directory. Parameters: kind - The installer kind. Parameters: output - The installer filename. Parameters: compr_format - The compression format to be used for packs. Parameters: listener - The PackagerListener. Parameters: installText - The install xml configuration text throws: CompilerException - |
CompilerConfig | public CompilerConfig(String filename, String basedir, String kind, String output, String compr_format, int compr_level, PackagerListener listener, String installText) throws CompilerException(Code) | | Parameters: filename - The XML filename. Parameters: basedir - The base directory. Parameters: kind - The installer kind. Parameters: output - The installer filename. Parameters: compr_format - The compression format to be used for packs. Parameters: compr_level - Compression level to be used if supported. Parameters: listener - The PackagerListener. Parameters: installText - The install xml configuration text throws: CompilerException - |
addArchiveContent | protected void addArchiveContent(File baseDir, File archive, String targetdir, List<OsConstraint> osList, int override, PackInfo pack, Map additionals, String condition) throws IOException(Code) | | Add files in an archive to a pack
Parameters: archive - the archive file to unpack Parameters: targetdir - the target directory where the content of the archive will be installed Parameters: osList - The target OS constraints. Parameters: override - Overriding behaviour. Parameters: pack - Pack to be packed into Parameters: additionals - Map which contains additional data Parameters: condition - |
addInfo | protected void addInfo(XMLElement data) throws Exception(Code) | | Builds the Info class from the XML tree.
Parameters: data - The XML data. return The Info. exception: Exception - Description of the Exception |
addJars | protected void addJars(XMLElement data) throws Exception(Code) | | Add project specific external jar files to the installer.
Parameters: data - The XML data. |
addNativeLibraries | protected void addNativeLibraries(XMLElement data) throws Exception(Code) | | Add native libraries to the installer.
Parameters: data - The XML data. |
addPanels | protected void addPanels(XMLElement data) throws CompilerException(Code) | | Parse panels and their paramters, locate the panels resources and add to the Packager.
Parameters: data - The XML data. exception: CompilerException - Description of the Exception |
addProperty | public boolean addProperty(String name, String value)(Code) | | Add a name value pair to the project property set. It is not
replaced it is already in the set of properties.
Parameters: name - the name of the property Parameters: value - the value to set true if the property was not already set |
addRecursively | protected void addRecursively(File baseDir, File file, String targetdir, List<OsConstraint> osList, int override, PackInfo pack, Map additionals, String condition) throws IOException(Code) | | Recursive method to add files in a pack.
Parameters: file - The file to add. Parameters: targetdir - The relative path to the parent. Parameters: osList - The target OS constraints. Parameters: override - Overriding behaviour. Parameters: pack - Pack to be packed into Parameters: additionals - Map which contains additional data Parameters: condition - exception: FileNotFoundException - if the file does not exist |
addVariables | protected void addVariables(XMLElement data) throws CompilerException(Code) | | Variable declaration is a fragment of the xml file. For example:
<variables>
<variable name="nom" value="value"/>
<variable name="foo" value="pippo"/>
</variables>
variable declared in this can be referred to in parsable files.
Parameters: data - The XML data. exception: CompilerException - Description of the Exception |
checkDependencies | public void checkDependencies(List<PackInfo> packs) throws CompilerException(Code) | | Checks whether the dependencies stated in the configuration file are correct. Specifically it
checks that no pack point to a non existent pack and also that there are no circular
dependencies in the packs.
|
compile | public void compile()(Code) | | Compile the installation
|
executeCompiler | public void executeCompiler() throws Exception(Code) | | Compiles the installation.
exception: Exception - Description of the Exception |
getCompiler | public Compiler getCompiler()(Code) | | Access the install compiler
the install compiler |
main | public static void main(String[] args)(Code) | | The main method if the compiler is invoked by a command-line call.
Parameters: args - The arguments passed on the command-line. |
parseError | protected void parseError(String message) throws CompilerException(Code) | | Create parse error with consistent messages. Includes file name. For use When parent is
unknown.
Parameters: message - Brief message explaining error |
parseError | protected void parseError(XMLElement parent, String message) throws CompilerException(Code) | | Create parse error with consistent messages. Includes file name and line # of parent. It is
an error for 'parent' to be null.
Parameters: parent - The element in which the error occured Parameters: message - Brief message explaining error |
parseError | protected void parseError(XMLElement parent, String message, Throwable cause) throws CompilerException(Code) | | Create a chained parse error with consistent messages. Includes file name and line # of
parent. It is an error for 'parent' to be null.
Parameters: parent - The element in which the error occured Parameters: message - Brief message explaining error |
parseWarn | protected void parseWarn(XMLElement parent, String message)(Code) | | Create a parse warning with consistent messages. Includes file name and line # of parent. It
is an error for 'parent' to be null.
Parameters: parent - The element in which the warning occured Parameters: message - Warning message |
requireAttribute | protected String requireAttribute(XMLElement element, String attribute) throws CompilerException(Code) | | Call getAttribute on an element, producing a meaningful error message if not present, or
empty. It is an error for 'element' or 'attribute' to be null.
Parameters: element - The element to get the attribute value of Parameters: attribute - The name of the attribute to get |
requireChildNamed | protected XMLElement requireChildNamed(XMLElement parent, String name) throws CompilerException(Code) | | Call getFirstChildNamed on the parent, producing a meaningful error message on failure. It is
an error for 'parent' to be null.
Parameters: parent - The element to search for a child Parameters: name - Name of the child element to get |
requireContent | protected String requireContent(XMLElement element) throws CompilerException(Code) | | Call getContent on an element, producing a meaningful error message if not present, or empty.
It is an error for 'element' to be null.
Parameters: element - The element to get content of |
requireIntAttribute | protected int requireIntAttribute(XMLElement element, String attribute) throws CompilerException(Code) | | Get a required attribute of an element, ensuring it is an integer. A meaningful error message
is generated as a CompilerException if not present or parseable as an int. It is an error for
'element' or 'attribute' to be null.
Parameters: element - The element to get the attribute value of Parameters: attribute - The name of the attribute to get |
requireURLContent | protected URL requireURLContent(XMLElement element) throws CompilerException(Code) | | Call getContent on an element, producing a meaningful error message if not present, or empty,
or a valid URL. It is an error for 'element' to be null.
Parameters: element - The element to get content of |
requireYesNoAttribute | protected boolean requireYesNoAttribute(XMLElement element, String attribute) throws CompilerException(Code) | | Call getAttribute on an element, producing a meaningful error message if not present, or one
of "yes" or "no". It is an error for 'element' or 'attribute' to be null.
Parameters: element - The element to get the attribute value of Parameters: attribute - The name of the attribute to get |
run | public void run()(Code) | | The run() method.
|
setIzpackHome | public static void setIzpackHome(String izHome)(Code) | | Set the IzPack home directory
Parameters: izHome - - the izpack home directory |
substituteProperties | protected void substituteProperties(XMLElement data) throws CompilerException(Code) | | Properties declaration is a fragment of the xml file. For example:
<properties>
<property name="app.name" value="Property Laden Installer"/>
<!-- Ant styles 'location' and 'refid' are not yet supported -->
<property file="filename-relative-to-install?"/>
<property file="filename-relative-to-install?" prefix="prefix"/>
<!-- Ant style 'url' and 'resource' are not yet supported -->
<property environment="prefix"/>
</properties>
variable declared in this can be referred to in parsable files.
Parameters: data - The XML data. exception: CompilerException - Description of the Exception |
validateYesNo | protected boolean validateYesNo(String value)(Code) | | |
validateYesNoAttribute | protected boolean validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue)(Code) | | Call getAttribute on an element, producing a meaningful warning if not "yes" or "no". If the
'element' or 'attribute' are null, the default value is returned.
Parameters: element - The element to get the attribute value of Parameters: attribute - The name of the attribute to get Parameters: defaultValue - Value returned if attribute not present or invalid |
wasSuccessful | public boolean wasSuccessful()(Code) | | |
|
|