public abstract class ParameterFinder<P extends Parameter<?>> extends Object
In some cases, it is desirable to allow parameters which are
logically associated with a layer suffix to be specified without
the suffix, for instance if you have three layers using the
same table x
, it's nice to write "in=x
"
as a shorthand for "in1=x in2=x in3=x
".
But if in2=x
is present in the environment, that will
be used in preference.
Constructor and Description |
---|
ParameterFinder() |
Modifier and Type | Method and Description |
---|---|
abstract P |
createParameter(String suffix)
Concrete subclasses must implement this method to create a
parameter of the right type with an arbitrary suffix.
|
P |
findParameter(Environment env,
String fullSuffix)
Returns an existing parameter to use for obtaining a value associated
with the given layer suffix from the given environment.
|
P |
findParameterByName(String target,
String fullSuffix)
Attempts to locate a parameter known by this finder with the given name.
|
P |
getParameter(Environment env,
String fullSuffix)
Calls
findParameter(uk.ac.starlink.task.Environment, java.lang.String) , but if the result is null,
a parameter with the full suffix is returned. |
public abstract P createParameter(String suffix)
suffix
- arbitrary suffixpublic P getParameter(Environment env, String fullSuffix)
findParameter(uk.ac.starlink.task.Environment, java.lang.String)
, but if the result is null,
a parameter with the full suffix is returned.
In that case, the environment doesn't already have a
value for the parameter, but it may take steps to obtain one
(like asking the user).env
- execution environment, possibly populated with valuesfullSuffix
- suffix associated with the layer for which
the value is requiredpublic P findParameter(Environment env, String fullSuffix)
env
- execution environment, possibly populated with valuesfullSuffix
- suffix associated with the layer for which
the value is requiredpublic P findParameterByName(String target, String fullSuffix)
target
- required parameter name (not case-sensitive)fullSuffix
- suffix associated with the layer for which
the value is requiredtarget
, or nullCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.