|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
stella.parameter.AbstractParameter
public abstract class AbstractParameter
An abstract base class for all parameter. Provides a protected constructor
out of a Map object and a createParameter(java.util.Map) method
to construct a parameter.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyContainer |
|---|
PropertyContainer.URLResource |
| Field Summary | |
|---|---|
static String |
KEY_FORMAT
The (decimal) formatter used for getFormatted(). |
static String |
KEY_NAME
The key to the unique trigger name. |
static String |
KEY_PRESERVE
Convenience parameter for StatePreserving parameters. |
static String |
UNKNOWN
The unknown identifier. |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES |
| Fields inherited from interface util.PropertyBearing |
|---|
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
protected |
AbstractParameter()
Protected empty constructor. |
protected |
AbstractParameter(Map info)
Constructs a new trigger. |
| Method Summary | |
|---|---|
static Parameter |
createParameter(Map prop)
Creates a new trigger instance using the class key found in the properties. |
protected static boolean |
delivers(Parameter p)
Checks if the parameter handed over is non-null and delivers non-null values. |
void |
exit()
If we preserve our state, we do this at exit. |
String |
getFormatted()
A formatted string representation of the value of this paramter. |
String |
getFormatted(Object myval)
Returns the formatted version of a given object. |
String |
getName()
Scans the properties of this global for the KEY_NAME key. |
protected File |
getPreserveFile(boolean onlyexisting)
For state preserving parameters that use a file, this method returns the file the KEY_PRESERVE parameter points to. |
String |
getString()
A string representation of the value of this paramter. |
protected String |
getString(Object myval)
A string representation of the given object. |
void |
init()
Initializes the parameter with its class name. |
protected static boolean |
register(Parameter p,
Class as,
String name)
Checks if the parameter is of the required class type and has the correct name. |
protected double |
rescanned(String key,
String old,
String newval)
If we have a known format set, we try to parse from that class. |
protected void |
setName(String newname)
Sets the name of the parameter. |
String |
toString()
A string representation of this paramter. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface stella.Parameter |
|---|
get, set |
| Methods inherited from interface util.PropertyBearing |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getLocalized, getProperties, getProperty, getResource, getResourceAsStream, getResources, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Field Detail |
|---|
public static final String KEY_NAME
public static final String KEY_FORMAT
getFormatted().
public static final String KEY_PRESERVE
StatePreserving parameters.
public static final String UNKNOWN
| Constructor Detail |
|---|
protected AbstractParameter()
protected AbstractParameter(Map info)
PropertyBearing.KEY_CLASS property is set. To not spoil any default name
setting, the name (KEY_NAME) remains unassigned.
| Method Detail |
|---|
public static final Parameter createParameter(Map prop)
PropertyBearing.KEY_CLASS
property is defined, a new Trigger with the stated class name is
created, the supplied properties used as an argument in the
constructor.
protected double rescanned(String key,
String old,
String newval)
rescanned in class PropertyContainerpublic String getName()
KEY_NAME key.
Returns the mapped value or null if undefined.
getName in interface Parameterprotected void setName(String newname)
public void init()
init in interface Initializableinit in class PropertyContainerpublic void exit()
exit in interface ExitCleaningpublic String toString()
toString in class PropertyContainerpublic String getString()
getString in interface Parameterprotected String getString(Object myval)
public String getFormatted()
getFormatted in interface Parameterpublic String getFormatted(Object myval)
protected File getPreserveFile(boolean onlyexisting)
KEY_PRESERVE parameter points to.
onlyexisting - If true, file must also exist and be readable.protected static boolean delivers(Parameter p)
protected static boolean register(Parameter p,
Class as,
String name)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||