uk.ac.starlink.ttools.task
Interface DynamicTask

All Known Implementing Classes:
AbstractPlot2Task, CubePlot2Task, GenericPlot2Task, PlanePlot2Task, SkyPlot2Task, SpherePlot2Task, TimePlot2Task, TypedPlot2Task

public interface DynamicTask

Extends the Task interface by methods which allow task parameters to be queried based on a (at least partially) populated Environment. By default, Tasks report the Parameters they use so that the on-line help system can supply that information to users at runtime. However, for some tasks the parameters in use depend on the value of other parameters. This interface allows tasks to make that information available. The method implementations are considered to be on a best-efforts basis, it is not guaranteed that they will be able to report all the parameters. This information is only used for user help.

Since:
19 Sep 2014
Author:
Mark Taylor

Method Summary
 Parameter[] getContextParameters(Environment env)
          Returns the parameters for this task in the context of a given execution environment.
 Parameter getParameterByName(Environment env, String paramName)
          Attempts to find a parameter with a given name that might be used by this task in the content of the given environment.
 

Method Detail

getParameterByName

Parameter getParameterByName(Environment env,
                             String paramName)
                             throws TaskException
Attempts to find a parameter with a given name that might be used by this task in the content of the given environment.

This ought not to result in additional prompts to the user.

Parameters:
env - execution environment
paramName - requested parameter name
Returns:
parameter with the given name, or null
Throws:
TaskException

getContextParameters

Parameter[] getContextParameters(Environment env)
                                 throws TaskException
Returns the parameters for this task in the context of a given execution environment. If the environment is empty, this should give the same result as Task.getParameters(), but found settings of parameters in the presented environment may lead to parameters being added to or removed from the list.

This ought not to result in additional prompts to the user.

Parameters:
env - execution environment
Returns:
list of known parameters
Throws:
TaskException


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.