de.mid.innovator.ui
Class PropertyCfg<T>

java.lang.Object
  extended by de.mid.innovator.ui.PropertyCfg<T>
All Implemented Interfaces:
Property, Comparable<Property>

public class PropertyCfg<T>
extends Object
implements Property

The class is the Property interface default implementation that can be used with Innovator applications. The application uses this class to specify the properties which it will react to upon runtime; this is done using a PropertyProvider. You can specify a wide array of property configurations that are, e.g. given to the PropertyProvider upon creation.

Author:
borschet
See Also:
PropertyProvider, Property, PropertyProviderDefault

Constructor Summary
PropertyCfg(String key, String help)
          Creates a property configuration without a default value.
PropertyCfg(String key, T defVal, String help)
          Creates a property configuration of type T with a name, corresponding help string and configured default value.
 
Method Summary
 int compareTo(Property o)
           
 String getDefaultAsString()
          Getter for default value as string.
 Object getDefaultValue()
          Getter for default value.
 String getDescription()
          Getter for additional help.
 String getKey()
          Getter for key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyCfg

public PropertyCfg(String key,
                   String help)
Creates a property configuration without a default value.

Parameters:
key - the property name
help - additional help information shown about using the application

PropertyCfg

public PropertyCfg(String key,
                   T defVal,
                   String help)
Creates a property configuration of type T with a name, corresponding help string and configured default value.

Parameters:
key - the property name
defVal - the default value
help - additional help information shown about using the application
Method Detail

compareTo

public int compareTo(Property o)
Specified by:
compareTo in interface Comparable<Property>

getDefaultAsString

public String getDefaultAsString()
Getter for default value as string.

Specified by:
getDefaultAsString in interface Property
Returns:
The default value as string.

getDefaultValue

public Object getDefaultValue()
Getter for default value.

Specified by:
getDefaultValue in interface Property
Returns:
The default value that was previously configured as a (castable) object.

getDescription

public String getDescription()
Getter for additional help.

Specified by:
getDescription in interface Property
Returns:
A (hopefully) helpful description that was configured, which a user can view.

getKey

public String getKey()
Getter for key.

Specified by:
getKey in interface Property
Returns:
The name of the key