org.pscode.xui.param
Class Parameter

java.lang.Object
  extended by org.pscode.xui.param.Parameter

public class Parameter
extends Object

A class to store information on, and determine the defined value of, parameters for running an application. The Parameter might be used by an application configured either from runtime properties, or Applet parameters.

Version:
2009-12-03
Author:
Andrew Thompson

Constructor Summary
Parameter(Applet applet, String name, String type, String description)
          A minimally specified Parameter.
Parameter(Applet applet, String name, String type, String description, String defaultValue)
           
Parameter(Applet applet, String name, String type, String description, String defaultValue, String minValue, String maxValue)
           
Parameter(String name, String type, String description, String defaultValue, String minValue, String maxValue)
          Fully specified parameter.
 
Method Summary
 void configurePropertiesFromArguments(String[] args)
          Sets System properties from a String[] of argument name/value pairs.
 Boolean getBooleanValue()
           
 Color getColorValue()
           
 Object getDefaultValue()
           
 String getDescription()
           
 Double getDoubleValue()
           
 Float getFloatValue()
           
 Integer getIntegerValue()
           
 String getLongDescription()
          The description, combined with default and range, if appropriate.
 Long getLongValue()
           
 Object getMaxValue()
           
 Object getMinValue()
           
 String getName()
           
 String getStringValue()
           
 String getType()
           
 Object getValue()
           
 String getValue(Applet applet)
          Provides a parameter value from the applet, or if the applet is null, the system properties.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter(String name,
                 String type,
                 String description,
                 String defaultValue,
                 String minValue,
                 String maxValue)
          throws IllegalArgumentException
Fully specified parameter.

Throws:
IllegalArgumentException

Parameter

public Parameter(Applet applet,
                 String name,
                 String type,
                 String description)
          throws IllegalArgumentException
A minimally specified Parameter.

Throws:
IllegalArgumentException

Parameter

public Parameter(Applet applet,
                 String name,
                 String type,
                 String description,
                 String defaultValue)
          throws IllegalArgumentException
Throws:
IllegalArgumentException

Parameter

public Parameter(Applet applet,
                 String name,
                 String type,
                 String description,
                 String defaultValue,
                 String minValue,
                 String maxValue)
          throws IllegalArgumentException
Throws:
IllegalArgumentException - If parameters are not logical and internally consistent.
Method Detail

getName

public String getName()

getDescription

public String getDescription()

getLongDescription

public String getLongDescription()
The description, combined with default and range, if appropriate.


getType

public String getType()

getValue

public String getValue(Applet applet)
Provides a parameter value from the applet, or if the applet is null, the system properties. TODO Look into why 'jnlp' prefix params throw security exceptions on Linux.

Returns:
String the value of the parameter or property.

getValue

public Object getValue()

getColorValue

public Color getColorValue()

getStringValue

public String getStringValue()

getBooleanValue

public Boolean getBooleanValue()

getIntegerValue

public Integer getIntegerValue()

getLongValue

public Long getLongValue()

getFloatValue

public Float getFloatValue()

getDoubleValue

public Double getDoubleValue()

getDefaultValue

public Object getDefaultValue()

getMinValue

public Object getMinValue()

getMaxValue

public Object getMaxValue()

toString

public String toString()
Overrides:
toString in class Object

configurePropertiesFromArguments

public void configurePropertiesFromArguments(String[] args)
Sets System properties from a String[] of argument name/value pairs.