public abstract class AbstractParameter extends PropertyResources implements Parameter, ExitCleaning, Initializable
createParameter(java.util.Map<java.lang.String, java.lang.String>) method
to construct a parameter.PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
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.
|
KEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Modifier | Constructor and Description |
|---|---|
protected |
AbstractParameter()
Protected empty constructor.
|
protected |
AbstractParameter(Map<String,String> info)
Constructs a new trigger.
|
| Modifier and Type | Method and Description |
|---|---|
static Parameter |
createParameter(Map<String,String> 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 Map<String,String> |
overrideDefaultName(String defname,
Map<String,String> prop) |
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.
|
clone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdefaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringPropertiespublic 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
protected AbstractParameter()
protected AbstractParameter(Map<String,String> info)
PropertySupplying.KEY_CLASS
property is set. To not spoil any default name
setting, the name (KEY_NAME) remains unassigned.protected static Map<String,String> overrideDefaultName(String defname, Map<String,String> prop)
public static final Parameter createParameter(Map<String,String> prop)
PropertySupplying.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.protected void setName(String newname)
public void init()
throws InitException
init in interface InitializableInitExceptionpublic void exit()
exit in interface ExitCleaningpublic String toString()
toString in class PropertyContainerpublic String getString()
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)