com.izforge.izpack.installer
Class AutomatedInstallData

java.lang.Object
  extended by com.izforge.izpack.installer.AutomatedInstallData
Direct Known Subclasses:
InstallData

public class AutomatedInstallData
extends java.lang.Object

Encloses information about the install process. This implementation is not thread safe.

Author:
Julien Ponge , Johannes Lehtinen

Field Summary
 java.util.List allPacks
          The complete list of packs.
protected  java.util.Map attributes
          The attributes used by the panels
 java.util.List availablePacks
          The available packs.
 boolean canClose
          Can we close the installer ?
 int curPanelNumber
          The current panel.
(package private) static java.lang.String[] CUSTOM_ACTION_TYPES
          Names of the custom actions types with which they are stored in the installer jar file.
 java.util.Map customData
          Custom data.
 Info info
          The inforamtions.
static int INSTALLER_LISTENER_INDEX
           
 boolean installSuccess
          Did the installation succeed ?
 LocaleDatabase langpack
          The language pack.
 java.lang.String localeISO3
          The language code.
 java.util.List panels
          The panels list.
 java.util.List panelsOrder
          The panels order.
 java.util.List selectedPacks
          The selected packs.
private static AutomatedInstallData self
          This class should be a singleton.
static int UNINSTALLER_JARS_INDEX
           
static int UNINSTALLER_LIBS_INDEX
           
static int UNINSTALLER_LISTENER_INDEX
           
 java.util.zip.ZipOutputStream uninstallOutJar
          The uninstaller jar stream.
protected  java.util.Properties variables
          Maps the variable names to their values
 XMLElement xmlData
          The xmlData for automated installers.
 
Constructor Summary
AutomatedInstallData()
          Constructs a new instance of this class.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String attr)
          Returns the value of the named attribute.
 java.lang.String getInstallPath()
          Returns the install path.
static AutomatedInstallData getInstance()
          Returns the one possible object of this class.
 java.lang.String getVariable(java.lang.String var)
          Returns the current value of the specified variable.
 java.util.Properties getVariables()
          Returns the map of variable values.
 void setAttribute(java.lang.String attr, java.lang.Object val)
          Sets a named attribute.
 void setInstallPath(java.lang.String path)
          Sets the install path.
 void setVariable(java.lang.String var, java.lang.String val)
          Sets a variable to the specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUSTOM_ACTION_TYPES

static final java.lang.String[] CUSTOM_ACTION_TYPES
Names of the custom actions types with which they are stored in the installer jar file. These names are also used to identify the type of custom action in the customData map. Slashes as first char are needed to use the names as "file" name in the installer jar.


INSTALLER_LISTENER_INDEX

public static final int INSTALLER_LISTENER_INDEX
See Also:
Constant Field Values

UNINSTALLER_LISTENER_INDEX

public static final int UNINSTALLER_LISTENER_INDEX
See Also:
Constant Field Values

UNINSTALLER_LIBS_INDEX

public static final int UNINSTALLER_LIBS_INDEX
See Also:
Constant Field Values

UNINSTALLER_JARS_INDEX

public static final int UNINSTALLER_JARS_INDEX
See Also:
Constant Field Values

localeISO3

public java.lang.String localeISO3
The language code.


langpack

public LocaleDatabase langpack
The language pack.


uninstallOutJar

public java.util.zip.ZipOutputStream uninstallOutJar
The uninstaller jar stream.


info

public Info info
The inforamtions.


allPacks

public java.util.List allPacks
The complete list of packs.


availablePacks

public java.util.List availablePacks
The available packs.


selectedPacks

public java.util.List selectedPacks
The selected packs.


panels

public java.util.List panels
The panels list.


panelsOrder

public java.util.List panelsOrder
The panels order.


curPanelNumber

public int curPanelNumber
The current panel.


canClose

public boolean canClose
Can we close the installer ?


installSuccess

public boolean installSuccess
Did the installation succeed ?


xmlData

public XMLElement xmlData
The xmlData for automated installers.


customData

public java.util.Map customData
Custom data.


variables

protected java.util.Properties variables
Maps the variable names to their values


attributes

protected java.util.Map attributes
The attributes used by the panels


self

private static AutomatedInstallData self
This class should be a singleton. Therefore the one possible object will be stored in this static member.

Constructor Detail

AutomatedInstallData

public AutomatedInstallData()
Constructs a new instance of this class. Only one should be possible, at a scound call a RuntimeException will be raised.

Method Detail

getInstance

public static AutomatedInstallData getInstance()
Returns the one possible object of this class.

Returns:
the one possible object of this class

getVariables

public java.util.Properties getVariables()
Returns the map of variable values. Modifying this will directly affect the current value of variables.

Returns:
the map of variable values

setVariable

public void setVariable(java.lang.String var,
                        java.lang.String val)
Sets a variable to the specified value. This is short hand for getVariables().setProperty(var, val).

Parameters:
var - the name of the variable
val - the new value of the variable
See Also:
getVariable(java.lang.String)

getVariable

public java.lang.String getVariable(java.lang.String var)
Returns the current value of the specified variable. This is short hand for getVariables().getProperty(var).

Parameters:
var - the name of the variable
Returns:
the value of the variable or null if not set
See Also:
setVariable(java.lang.String, java.lang.String)

setInstallPath

public void setInstallPath(java.lang.String path)
Sets the install path.

Parameters:
path - the new install path
See Also:
getInstallPath()

getInstallPath

public java.lang.String getInstallPath()
Returns the install path.

Returns:
the current install path or null if none set yet
See Also:
setInstallPath(java.lang.String)

getAttribute

public java.lang.Object getAttribute(java.lang.String attr)
Returns the value of the named attribute.

Parameters:
attr - the name of the attribute
Returns:
the value of the attribute or null if not set
See Also:
setAttribute(java.lang.String, java.lang.Object)

setAttribute

public void setAttribute(java.lang.String attr,
                         java.lang.Object val)
Sets a named attribute. The panels and other IzPack components can attach custom attributes to InstallData to communicate with each other. For example, a set of co-operating custom panels do not need to implement a common data storage but can use InstallData singleton. The name of the attribute should include the package and class name to prevent name space collisions.

Parameters:
attr - the name of the attribute to set
val - the value of the attribute or null to unset the attribute
See Also:
getAttribute(java.lang.String)