| java.lang.Object java.lang.Thread com.izforge.izpack.compiler.Compiler
Compiler | public class Compiler extends Thread (Code) | | The IzPack compiler class. This is now a java bean style class that can be
configured using the object representations of the install.xml
configuration. The install.xml configuration is now handled by the
CompilerConfig class.
See Also: CompilerConfig author: Julien Ponge author: Tino Schwarze author: Chadwick McHenry |
Method Summary | |
public void | addCustomJar(CustomData ca, URL url) Add a custom jar to the installation. | public void | addCustomListener(int type, String className, String jarPath, List<OsConstraint> constraints) This method parses install.xml for defined listeners and put them in the right position. | public void | addJarContent(URL content) Add jar content to the installation. | public void | addJarContent(URL content, List<String> files) Adds a jar file content to the installer. | public void | addLangPack(String locale, URL localeURL, URL flagURL) Add a lang pack to the installation. | public void | addNativeLibrary(String name, URL url) Add a native library to the installation. | public void | addNativeUninstallerLibrary(CustomData data) Add an unistaller library. | public void | addPack(PackInfo pack) Add a pack to the installation. | public void | addPanelJar(Panel panel, URL url) Add a panel jar to the installation. | public boolean | addProperty(String name, String value) Add a name value pair to the project property set. | public void | addResource(String name, URL url) Add a resource to the installation. | public void | checkDependencies() Checks whether the dependencies stated in the configuration file are correct. | public void | checkDependencies(List<PackInfo> packs) Checks whether the dependencies among the given Packs. | public void | checkExcludes() Checks whether the excluded packs exist. | public void | checkExcludes(List<PackInfo> packs) This checks if there are more than one preselected packs per excludeGroup. | public void | compile() Compiles. | public void | createInstaller() Compiles the installation. | public URL | findIzPackResource(String path, String desc) Look for an IzPack resource either in the compiler jar, or within IZPACK_HOME. | public Map<String, Condition> | getConditions() | public Map<String, DynamicVariable> | getDynamicVariables() | public String | getKind() Access the installation kind. | public IPackager | getPackager() Returns the install packager. | public PackagerListener | getPackagerListener() Returns the packager listener. | public Properties | getProperties() Returns the properties currently known to the compileer. | public String | getProperty(String name) Get the value of a property currerntly known to izpack. | public Properties | getVariables() Get the packager variables. | public void | initPackager(String classname) | public static void | main(String[] args) The main method if the compiler is invoked by a command-line call. | public void | parseError(String message) Create parse error with consistent messages. | public void | parseError(String message, Throwable how) Create parse error with consistent messages. | public String | replaceProperties(String value) Replaces placeholder in the given string with the associated strings. | public void | run() The run() method. | public void | setConditions(Map<String, Condition> conditions) | public void | setDynamicVariables(Map<String, DynamicVariable> dynamicvariables) | public void | setGUIPrefs(GUIPrefs prefs) Sets GUI preferences to the packager. | public void | setInfo(Info info) Sets an Info object to the packager. | public static void | setIzpackHome(String izHome) | public void | setPackagerListener(PackagerListener listener) Sets the packager listener. | public boolean | setProperty(String name, String value) Add a name value pair to the project property set. | public boolean | wasSuccessful() Returns whether the installation was successful or not. |
IZPACK_HOME | public static String IZPACK_HOME(Code) | | The IzPack home directory.
|
IZPACK_VERSION | final public static String IZPACK_VERSION(Code) | | The IzPack version.
|
output | protected String output(Code) | | The output jar filename.
|
Compiler | public Compiler(String basedir, String kind, String output, String compr_format) throws CompilerException(Code) | | The constructor.
Parameters: basedir - The base directory. Parameters: kind - The installer kind. Parameters: output - The installer filename. Parameters: compr_format - The format which should be used for the packs. throws: CompilerException - |
Compiler | public Compiler(String basedir, String kind, String output, String compr_format, int compr_level) throws CompilerException(Code) | | The constructor.
Parameters: basedir - The base directory. Parameters: kind - The installer kind. Parameters: output - The installer filename. Parameters: compr_format - The format which should be used for the packs. Parameters: compr_level - Compression level to be used if supported. throws: CompilerException - |
addCustomJar | public void addCustomJar(CustomData ca, URL url)(Code) | | Add a custom jar to the installation.
Parameters: ca - Parameters: url - |
addCustomListener | public void addCustomListener(int type, String className, String jarPath, List<OsConstraint> constraints) throws Exception(Code) | | This method parses install.xml for defined listeners and put them in the right position. If
posible, the listeners will be validated. Listener declaration is a fragmention in
install.xml like : <listeners> <listener compiler="PermissionCompilerListener"
installer="PermissionInstallerListener"/1gt; </listeners>
Parameters: type - The listener type. Parameters: className - The class name. Parameters: jarPath - The jar path. Parameters: constraints - The list of constraints. throws: Exception - Thrown in case an error occurs. |
addJarContent | public void addJarContent(URL content)(Code) | | Add jar content to the installation.
Parameters: content - |
addJarContent | public void addJarContent(URL content, List<String> files)(Code) | | Adds a jar file content to the installer. Package structure is maintained. Need mechanism to
copy over signed entry information. If the given file list is null the hole contents of the
jar file will be copied else only the listed.
Parameters: content - The url of the jar to add to the installer. We use a URL so the jar may benested within another. Parameters: files - to be copied |
addLangPack | public void addLangPack(String locale, URL localeURL, URL flagURL)(Code) | | Add a lang pack to the installation.
Parameters: locale - Parameters: localeURL - Parameters: flagURL - |
addNativeLibrary | public void addNativeLibrary(String name, URL url) throws Exception(Code) | | Add a native library to the installation.
Parameters: name - Parameters: url - throws: Exception - |
addNativeUninstallerLibrary | public void addNativeUninstallerLibrary(CustomData data)(Code) | | Add an unistaller library.
Parameters: data - |
addPack | public void addPack(PackInfo pack)(Code) | | Add a pack to the installation.
Parameters: pack - |
addPanelJar | public void addPanelJar(Panel panel, URL url)(Code) | | Add a panel jar to the installation.
Parameters: panel - Parameters: url - |
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 |
addResource | public void addResource(String name, URL url)(Code) | | Add a resource to the installation.
Parameters: name - Parameters: url - |
checkDependencies | public void checkDependencies() 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.
throws: CompilerException - |
checkDependencies | public void checkDependencies(List<PackInfo> packs) throws CompilerException(Code) | | Checks whether the dependencies among the given Packs. Specifically it
checks that no pack point to a non existent pack and also that there are no circular
dependencies in the packs.
Parameters: packs - - List representing the packs in the installation throws: CompilerException - |
compile | public void compile()(Code) | | Compiles.
|
createInstaller | public void createInstaller() throws Exception(Code) | | Compiles the installation.
exception: Exception - Description of the Exception |
findIzPackResource | public URL findIzPackResource(String path, String desc) throws CompilerException(Code) | | Look for an IzPack resource either in the compiler jar, or within IZPACK_HOME. The path must
not be absolute. The path must use '/' as the fileSeparator (it's used to access the jar
file). If the resource is not found, a CompilerException is thrown indicating fault in the
parent element.
Parameters: path - the relative path (using '/' as separator) to the resource. Parameters: desc - the description of the resource used to report errors a URL to the resource. throws: CompilerException - |
getKind | public String getKind()(Code) | | Access the installation kind.
the installation kind. |
getPackager | public IPackager getPackager()(Code) | | Returns the install packager.
the install packager. |
getPackagerListener | public PackagerListener getPackagerListener()(Code) | | Returns the packager listener.
the packager listener |
getProperties | public Properties getProperties()(Code) | | Returns the properties currently known to the compileer.
the properties currently known to the compileer |
getProperty | public String getProperty(String name)(Code) | | Get the value of a property currerntly known to izpack.
Parameters: name - the name of the property the value of the property, or null |
getVariables | public Properties getVariables()(Code) | | Get the packager variables.
the packager variables |
main | public static void main(String[] args)(Code) | | The main method if the compiler is invoked by a command-line call.
This simply calls the CompilerConfig.main method.
Parameters: args - The arguments passed on the command-line. |
parseError | public 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 throws: CompilerException - |
parseError | public void parseError(String message, Throwable how) throws CompilerException(Code) | | Create parse error with consistent messages. Includes file name. For use When parent is
unknown.
Parameters: message - Brief message explaining error Parameters: how - throwable which was catched throws: CompilerException - |
replaceProperties | public String replaceProperties(String value)(Code) | | Replaces placeholder in the given string with the associated strings.
Parameters: value - to be substituted the substituted string |
run | public void run()(Code) | | The run() method.
|
setConditions | public void setConditions(Map<String, Condition> conditions)(Code) | | Parameters: conditions - the conditions to set |
setGUIPrefs | public void setGUIPrefs(GUIPrefs prefs)(Code) | | Sets GUI preferences to the packager.
Parameters: prefs - preferences to be set |
setInfo | public void setInfo(Info info) throws Exception(Code) | | Sets an Info object to the packager.
Parameters: info - Info object to be set throws: Exception - |
setIzpackHome | public static void setIzpackHome(String izHome)(Code) | | Set the IzPack home directory
Parameters: izHome - - the izpack home directory |
setPackagerListener | public void setPackagerListener(PackagerListener listener)(Code) | | Sets the packager listener.
Parameters: listener - The listener. |
setProperty | public boolean setProperty(String name, String value)(Code) | | Add a name value pair to the project property set. Overwriting any existing value except system properties.
Parameters: name - the name of the property Parameters: value - the value to set an indicator if the name value pair was added. |
wasSuccessful | public boolean wasSuccessful()(Code) | | Returns whether the installation was successful or not.
whether the installation was successful or not |
|
|