Applicet Framework for Applets and Applications v2.03

be.arci.pub
Class ParameterParser

java.lang.Object
  |
  +--be.arci.pub.ParameterParser

public class ParameterParser
extends java.lang.Object

Convenience class that contains one single method to decode Framework parameter Strings to a Color value, which is quite commonly required (some IDE code generators even put such a method by default into your applet's java code).

We supply this class as a free service to all Framework users. You are allowed to modify this source code, provided you move the class out of the be.arci package hierarchy.

Since:
05/feb/2000

Field Summary
static java.lang.String[] asHtmlFalseTrue
          String values for HTML PARAM-style NO (false) and YES (true).
 
Method Summary
static boolean getBooleanParameter(Framework applicet, java.lang.String sName, boolean swDefault)
          Returns a boolean value which is the supplied default, unless the opposite value has been specified as text for the named parameter.
static boolean getBooleanParameter(Framework applicet, java.lang.String sName, boolean swDefault, java.lang.String[] asFalseTrue)
          Returns a boolean value which is the supplied default, unless the opposite has been specified.
static java.awt.Color getColor(java.lang.String sColor)
          Convenience method to convert an HTML-style hexadimal "RRGGBB" or "#RRGGBB" color number or one of the predefined Color names (case-insensitive) to an awt.Color object, or null if no color is matched.
static java.awt.Color getColorParameter(Framework applicet, java.lang.String sName, java.lang.String sDefaultColor)
          Returns the Color value of a named parameter, or the default value if no value for the parameter has been specified, or the value is no Color representation.
static long getLongIntParameter(Framework applicet, java.lang.String sName, long lDefault)
          Returns the long integer value of a named parameter, or the default value if no value for the parameter has been specified, or the value is no long representation.
static long getLongIntParameter(Framework applicet, java.lang.String sName, long lDefault, long lMinValue, long lMaxValue)
          Returns the long integer value of a named parameter, or the default value if the specified parameter value is out of range, no value for the parameter has been specified, or the value is no long representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

asHtmlFalseTrue

public static final java.lang.String[] asHtmlFalseTrue
String values for HTML PARAM-style NO (false) and YES (true).
Since:
version 2.03
Method Detail

getBooleanParameter

public static boolean getBooleanParameter(Framework applicet,
                                          java.lang.String sName,
                                          boolean swDefault)
Returns a boolean value which is the supplied default, unless the opposite value has been specified as text for the named parameter.
Parameters:
applicet - Framework to retrieve the named parameter for
sName - name of the boolean parameter to retrieve
swDefault - default return value

getBooleanParameter

public static boolean getBooleanParameter(Framework applicet,
                                          java.lang.String sName,
                                          boolean swDefault,
                                          java.lang.String[] asFalseTrue)
Returns a boolean value which is the supplied default, unless the opposite has been specified.

getLongIntParameter

public static long getLongIntParameter(Framework applicet,
                                       java.lang.String sName,
                                       long lDefault)
Returns the long integer value of a named parameter, or the default value if no value for the parameter has been specified, or the value is no long representation.
Parameters:
applicet - Framework to retrieve the named parameter for
sName - name of the long integer parameter to retrieve
lDefault - default return value

getLongIntParameter

public static long getLongIntParameter(Framework applicet,
                                       java.lang.String sName,
                                       long lDefault,
                                       long lMinValue,
                                       long lMaxValue)
Returns the long integer value of a named parameter, or the default value if the specified parameter value is out of range, no value for the parameter has been specified, or the value is no long representation.
Parameters:
applicet - Framework to retrieve the named parameter for
sName - name of the long integer parameter to retrieve
lDefault - default return value
lMinValue - minimum accepted parameter value
lMaxValue - maximum accepted parameter value
Since:
Applicet Framework v2.03

getColorParameter

public static java.awt.Color getColorParameter(Framework applicet,
                                               java.lang.String sName,
                                               java.lang.String sDefaultColor)
Returns the Color value of a named parameter, or the default value if no value for the parameter has been specified, or the value is no Color representation.
Parameters:
applicet - Framework to retrieve the named parameter for
sName - name of the Color parameter to retrieve
sDefaultcolor - String representation of default return value

getColor

public static java.awt.Color getColor(java.lang.String sColor)
Convenience method to convert an HTML-style hexadimal "RRGGBB" or "#RRGGBB" color number or one of the predefined Color names (case-insensitive) to an awt.Color object, or null if no color is matched. The predefined Color names are

Parameters:
sColor - The color name or number. May be null or an empty String.

Applicet Framework for Applets and Applications v2.03