Expresso 5-6

com.jcorporate.expresso.kernel
Class InstallationOptions

java.lang.Object
  extended bycom.jcorporate.expresso.kernel.InstallationOptions

public class InstallationOptions
extends Object

Installation is a combination metadata and installation flags for a particular component. Typical Usage Inside a Component:

Creating an Installation Options:

 InstallationOptions returnOptions = new InstallationOptions();
 InstallationMetadata newMetadata = returnOptions.createNewMetadata();
 newMetadata.setName("Test");
 newMetadata.setDefaultValue(Boolean.TRUE);
 newMetadata.setType("java.lang.Boolean");
 returnOptions.addMetaData(newMetadata);
 return returnOptions;
 

Using Installation Options:

 //In the installation section
 Boolean deleteTables = installOptions.getInstallOption("Test");
 if (deleteTables.booleanValue()) {
     //Do some stuff
 }
 
 

Author:
Michael Rimov

Nested Class Summary
 class InstallationOptions.InstallationMetadata
          This class provides metadata about any options available.
 
Field Summary
protected  Map installValues
          All the installation values keyed by the metadata
protected  Map nameMetadataMap
          A map for mapping names to metdata
 
Constructor Summary
InstallationOptions()
           
 
Method Summary
 void addMetaData(InstallationOptions.InstallationMetadata metadata)
          Called by the Installable implementation to add a filled out metadata object to the Install Options
 InstallationOptions.InstallationMetadata createNewMetadata(String name, Object defaultValue)
          Kind of a factory method.
 Set getAllInstallNames()
           
 Map getAllInstallValues()
           
 Object getInstallOption(String name)
          Retrieves the installation option keyed by name.
 void setInstallOption(String name, Object newValue)
          Sets the given install option by name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

installValues

protected Map installValues
All the installation values keyed by the metadata


nameMetadataMap

protected Map nameMetadataMap
A map for mapping names to metdata

Constructor Detail

InstallationOptions

public InstallationOptions()
Method Detail

createNewMetadata

public InstallationOptions.InstallationMetadata createNewMetadata(String name,
                                                                  Object defaultValue)
Kind of a factory method. Instantiates a new metadata object

Returns:

addMetaData

public void addMetaData(InstallationOptions.InstallationMetadata metadata)
Called by the Installable implementation to add a filled out metadata object to the Install Options

Parameters:
metadata - the Created and populated metadata

setInstallOption

public void setInstallOption(String name,
                             Object newValue)
Sets the given install option by name

Parameters:
name - the name of the installation object
newValue - the value to set it to.

getInstallOption

public Object getInstallOption(String name)
Retrieves the installation option keyed by name. If the value was never set then the system returns the default value as defined by the metadata.

Parameters:
name - the name of the install option
Returns:
java.lang.Object

getAllInstallValues

public Map getAllInstallValues()

getAllInstallNames

public Set getAllInstallNames()

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.