com.isti.util
Class AppletProperties

java.lang.Object
  extended bycom.isti.util.BaseProperties
      extended bycom.isti.util.AppletProperties
All Implemented Interfaces:
java.util.Map

public class AppletProperties
extends BaseProperties

Class AppletProperties manages a table of configuration property items. For use with applets. The 'load()' method reads parameters from the HTML file that launched the applet and enters them into property items. Each item has a name, a value, a default value, a loaded-flag (set true if the item has been "loaded" from the HTML file), and a required-flag (set true if the item must be loaded from the HTML file). A vector or array of 'CfgPropItem' objects may be used to define a set of property names and default-value objects; or they be added individually. The default-value objects determine the data types for the items.


Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
 
Fields inherited from class com.isti.util.BaseProperties
errMsgSetFlag, errorMessage, loadedCfgFname, SEPARATOR_STRING, SPECIAL_CHARS_STR
 
Constructor Summary
AppletProperties()
          Creates an empty table of items.
AppletProperties(BaseProperties basePropObj)
          Creates a properties object that uses the same table of items as the given properties object.
AppletProperties(CfgPropItem[] itemsArr)
          Creates a table of items using the given array of 'CfgPropItem' objects.
AppletProperties(java.util.Vector vec)
          Creates a table of items using the given Vector of 'CfgPropItem' objects.
 
Method Summary
 boolean processAppletParams(java.applet.Applet appletObj)
          Attempts to read property items as parameters in the HTML document from which the given applet (or JApplet) was launched.
 boolean processAppletParams(java.applet.Applet appletObj, java.lang.String cfgFnParam, java.lang.String defCfgFnStr)
          Attempts to read property items as parameters in the HTML document from which the given applet (or JApplet) was launched.
 
Methods inherited from class com.isti.util.BaseProperties
add, add, add, clear, containsKey, containsKey, containsValue, elements, entrySet, equals, get, get, getDisplayString, getDisplayString, getErrorMessage, getLoadedCfgFname, hashCode, insertQuoteChars, isEmpty, keys, keySet, load, load, load, load, put, putAll, remove, remove, remove, setAllToDefaults, setErrorMessage, setIllegalCharMsg, setLoadedFlags, setUnexpectedEOFMsg, size, store, store, store, store, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppletProperties

public AppletProperties()
Creates an empty table of items.


AppletProperties

public AppletProperties(java.util.Vector vec)
Creates a table of items using the given Vector of 'CfgPropItem' objects. Any object in the vector that is not a 'CfgPropItem' object is ignored.

Parameters:
vec - vector of items

AppletProperties

public AppletProperties(CfgPropItem[] itemsArr)
Creates a table of items using the given array of 'CfgPropItem' objects.

Parameters:
itemsArr - array of items

AppletProperties

public AppletProperties(BaseProperties basePropObj)
Creates a properties object that uses the same table of items as the given properties object.

Parameters:
basePropObj - base property object
Method Detail

processAppletParams

public boolean processAppletParams(java.applet.Applet appletObj,
                                   java.lang.String cfgFnParam,
                                   java.lang.String defCfgFnStr)
Attempts to read property items as parameters in the HTML document from which the given applet (or JApplet) was launched. Each property name in the current table is used to check for a matching HTML parameter. Each parameter's value must be a valid ASCII representation of the associated item's type. The loading continues even after an error has been detected; the text error message corresponding to the first error detected is saved. A configuration filename may be specified as either a URL address or the name of a file that is assumed to be in the same web directory as the document used to lauch the applet.

Parameters:
appletObj - the Applet (or JApplet) object used to fetch HTML parameters.
cfgFnParam - a parameter name that may be used to specify a configuration filename in the applet params (or null for none). The configuration file is loaded before any other applet parameters are processed.
defCfgFnStr - a default configuration filename, used if no other configuration file name is specified in the applet params (or null for none). This configuration file is loaded before any other applet parameters are processed. If the file cannot be found, no error is flagged.
Returns:
true if no errors are detected; otherwise false, and a a text error message is generated that may be fetched via the 'getErrorMessage()' method.

processAppletParams

public boolean processAppletParams(java.applet.Applet appletObj)
Attempts to read property items as parameters in the HTML document from which the given applet (or JApplet) was launched. Each property name in the current table is used to check for a matching HTML parameter. Each parameter's value must be a valid ASCII representation of the associated item's type. The loading continues even after an error has been detected; the text error message corresponding to the first error detected is saved.

Parameters:
appletObj - the Applet (or JApplet) object used to fetch HTML parameters.
Returns:
true if no errors are detected; otherwise false, and a a text error message is generated that may be fetched via the 'getErrorMessage()' method.