Class CustomCodeRuleProxy

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String decryptEncryptedValue​(java.lang.String var)
      This method returns the decrypted value if an numeric encrypted value is passed
      java.lang.Object getEncryptedVariable​(java.lang.String var)
      This method returns the encrypted literal Object represented by an InstallAnywhere variable
      java.lang.Object getService​(java.lang.Class requestedServiceClass)
      This method provides access to InstallAnywhere installer services
      java.lang.String getValue​(java.lang.String key)
      This method loads an i18n resource for the current default locale.
      java.lang.String getValue​(java.lang.String key, java.util.Locale locale)
      This method loads an i18n resource for a specific locale.
      java.lang.Object getVariable​(java.lang.String var)
      This method returns the literal Object represented by an InstallAnywhere variable
      java.util.Enumeration getVariables()
      This method returns an enumeration containing the name of all variables defined in the installer or uninstaller.
      java.lang.Object setVariable​(java.lang.String var, java.lang.Object value)
      This method sets the named variable to the specified value.
      java.lang.String substitute​(java.lang.String var)
      This method fully resolves a String that may contain embedded InstallAnywhere variables
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CustomCodeRuleProxy

        public CustomCodeRuleProxy​(VariableAccess _va,
                                   I18NAccess _i18na)

        Constructor

        Creates an instance of the CustomCodeRuleProxy.

        Parameters:
        _va - Access to the runtime variables.
        _i18na - Access to the international resources.
    • Method Detail

      • substitute

        public java.lang.String substitute​(java.lang.String var)

        This method fully resolves a String that may contain embedded InstallAnywhere variables

        The String returned is guaranteed to resolve all InstallAnywhere variables embedded in the parameter passed to this method. Variables contained (embedded) within the String are fully and recursively resolved (i.e., they are resolved recursively). InstallAnywhere variables that are to be resolved are identified by their surrounding dollar signs ($). If no value has been set for a given variable name, that variable is resolved to the empty String.

        For example, calling this method on the String:

           "The files have been $PLACED$ in $USER_INSTALL_DIR$"

        would return a String with $PLACED$ and $USER_INSTALL_DIR$ resolved to the toString() values of the objects represented by the InstallAnywhere variables.

        This method is particularly useful for resolving file system paths represented by InstallAnywhere variables for Magic Folders and is the preferred mechanism for retrieving this type of data.

        Specified by:
        substitute in interface VariableAccess
        Parameters:
        var - the String that is to be substituted (i.e., the String whose embedded InstallAnywhere variables are to be resolved).
        Returns:
        a String representing the fully resolved contents of the String var that is passed to the method.
        See Also:
        getVariable(String), setVariable(String, Object)
      • getVariable

        public java.lang.Object getVariable​(java.lang.String var)

        This method returns the literal Object represented by an InstallAnywhere variable

        InstallAnywhere variables are identified by their surrounding dollar signs ($). If no value has been set for a given variable name, null is returned.

        The getVariable() method does not recursively resolve variables. If the intention is to get the String representation of a particular InstallAnywhere variable, the substitute()method is generally preferred.

        For example, getVariable("$USER_INSTALL_DIR$") would return the MagicFolder object for the current install location, while substitute("$USER_INSTALL_DIR$") would return a String representing the absolute path to the current install location.

        Specified by:
        getVariable in interface VariableAccess
        Parameters:
        var - the String that represents the name of the InstallAnywhere variable whose contents are to be retrieved.
        Returns:
        the Object representing contents of the named InstallAnywhere variable that is passed as a parameter to the method.
        See Also:
        substitute(String), setVariable(String, Object)
      • getVariables

        public java.util.Enumeration getVariables()

        This method returns an enumeration containing the name of all variables defined in the installer or uninstaller.

        To get the literal Object represented by an InstallAnywhere variable use the getVariable() method.

        Specified by:
        getVariables in interface VariableAccess
        Returns:
        Enumeration with the name of the variables.
        See Also:
        getVariable(String)
      • setVariable

        public java.lang.Object setVariable​(java.lang.String var,
                                            java.lang.Object value)

        This method sets the named variable to the specified value.

        If the variable was already set, its previous value is returned. Otherwise, returns null.

        Specified by:
        setVariable in interface VariableAccess
        Parameters:
        var - The String representation of the variable to be set.
        value - The value of the variable to be set.
        Returns:
        The previous value of the variable, or null if the variable was not previously set.
      • getEncryptedVariable

        public java.lang.Object getEncryptedVariable​(java.lang.String var)

        This method returns the encrypted literal Object represented by an InstallAnywhere variable

        InstallAnywhere variables are identified by their surrounding dollar signs ($). If no value has been set for a given variable name, null is returned.

        The getVariable() method does not recursively resolve variables. If the intention is to get the String representation of a particular InstallAnywhere variable, the substitute()method is generally preferred.

        For example, getVariable("$USER_INSTALL_DIR$") would return the MagicFolder object for the current install location, while substitute("$USER_INSTALL_DIR$") would return a String representing the absolute path to the current install location.

        Specified by:
        getEncryptedVariable in interface VariableAccess
        Parameters:
        var - the String that represents the name of the InstallAnywhere variable whose contents are to be retrieved.
        Returns:
        the Object representing contents of the named InstallAnywhere variable that is passed as a parameter to the method.
        See Also:
        substitute(String)
      • decryptEncryptedValue

        public java.lang.String decryptEncryptedValue​(java.lang.String var)

        This method returns the decrypted value if an numeric encrypted value is passed

        Specified by:
        decryptEncryptedValue in interface VariableAccess
        Parameters:
        var - the String that represents the numeric value of the encrypted value which has to be decrypted.
        Returns:
        the String representing decrypted value.
      • getValue

        public java.lang.String getValue​(java.lang.String key)

        This method loads an i18n resource for the current default locale.

        Gives access to locale-specific static UI strings. The resource is returned from the custom_ file the installation locale. This is useful if you want to internationalize custom code.

        Localized resources should be placed in the custom_ files in the i18nresources directory in the resource directory of your InstallAnywhere installation ([InstallAnywhere]/resource/i18nresources/custom_[locale]) prior to building the installer in the InstallAnywhere designer. Resources are included in the locale files using Java properties file notation (i.e., a key/value combination delimited by an equals sign ('=') with no spaces between the key, value, and delimiter).

        Resources are then accessed during install time by specifying the desired key.

        For example:
           getValue("userpanel.imageresource")
        would retrieve the value of userpanel.imagesource from locale file for the current installation locale.

        Specified by:
        getValue in interface I18NAccess
        Parameters:
        key - the Key in the externalized property file for i18n.
        Returns:
        the value of the Key from the Locales property file.
      • getValue

        public java.lang.String getValue​(java.lang.String key,
                                         java.util.Locale locale)

        This method loads an i18n resource for a specific locale.

        Gives access to locale-specific static UI strings. The resource is returned from the specified custom_ file. This is useful if you want to internationalize custom code.

        Localized resources should be placed in the custom_ files in the i18nresources directory in the resource directory of your InstallAnywhere installation ([InstallAnywhere]/resource/i18nresources/custom_[locale]) prior to building the installer in the InstallAnywhere designer. Resources are included in the locale files using Java properties file notation (i.e., a key/value combination delimited by an equals sign ('=') with no spaces between the key, value, and delimiter).

        Resources are then accessed during install time by specifying the desired key.

        For example:
           getValue("userpanel.imageresource", Locale.ENGLISH)
        would retrieve the value of userpanel.imagesource from the custom_en locale file.

        Specified by:
        getValue in interface I18NAccess
        Parameters:
        key - the Key in the externalized property file for i18n.
        locale - the Locale from which property file to load value specified by the Key.
        Returns:
        the value of the Key from the Locales property file.
      • getService

        public java.lang.Object getService​(java.lang.Class requestedServiceClass)

        This method provides access to InstallAnywhere installer services

        The Object returned by this method must be cast to the requested service. The returned Object, if the service is available, is guaranteed to implement requestedServiceClass.

        Specified by:
        getService in interface ServiceAccess
        Parameters:
        requestedServiceClass - a class representing the the interface of the service requested.
        Returns:
        an instance of the requested service.

        The extensions currently available are:

        See Also:
        SimpleRegistryManager, InstallerResources