public class MapEnvironment extends Object implements TableEnvironment
Constructor and Description |
---|
MapEnvironment()
Constructs a new environment with no values.
|
MapEnvironment(Map<String,Object> map)
Constructs a new environment with a map of parameter name->value
pairs.
|
MapEnvironment(MapEnvironment env)
Clone constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
acquireValue(Parameter<?> param)
Obtains a legal value for a given parameter from the environment and
sets the parameter's value accordingly.
|
void |
clearValue(Parameter<?> param)
Clears a value for a given parameter.
|
String[] |
getErrorLines()
Returns the error output written by the task so far, in an array one line
per element.
|
PrintStream |
getErrorStream()
Returns an output stream into which error or logging output from
a task can be written.
|
String |
getErrorText()
Returns a string which contains all the error output written by the task
so far.
|
JDBCAuthenticator |
getJdbcAuthenticator()
Returns a JDBC authenticator suitable for use in this environment.
|
Map<String,Object> |
getMap()
Returns the map object that contains the data for this environment.
|
String[] |
getNames()
Returns an array of parameter names which have been specified.
|
String[] |
getOutputLines()
Returns the output written by the task so far, in an array one line
per element.
|
PrintStream |
getOutputStream()
Returns an output stream into which text output from a task can
be written.
|
StarTable |
getOutputTable(String paramName)
If the task which has been executed in this environment has created
an output table which has not been otherwise disposed of, you
can get it from here.
|
String |
getOutputText()
Returns a string which contains all the output written by the task
so far.
|
StarTableFactory |
getTableFactory()
Returns a table factory suitable for use in this environment.
|
StarTableOutput |
getTableOutput()
Returns a table output marshaller suitable for use in this environment.
|
String[] |
getUnused()
Returns an array containing any words of the input argument list
which were never queried by the application to find their value.
|
boolean |
isDebug()
Indicates whether we are running in debug mode.
|
boolean |
isStrictVotable()
Determines whether votables are to be parsed in strict mode.
|
void |
setDebug(boolean debug)
Sets whether we are running in debug mode.
|
MapEnvironment |
setResourceBase(Class<?> clazz)
Sets the class which defines the context for resource discovery.
|
void |
setStrictVotable(boolean strict)
Sets whether votables should be parsed in strict mode.
|
MapEnvironment |
setValue(String paramName,
Object value)
Sets the value of a parameter.
|
public MapEnvironment()
public MapEnvironment(Map<String,Object> map)
map
- parameter mappublic MapEnvironment(MapEnvironment env)
env
- environment to copypublic PrintStream getOutputStream()
Environment
getOutputStream
in interface Environment
public PrintStream getErrorStream()
Environment
getErrorStream
in interface Environment
public void clearValue(Parameter<?> param)
Environment
clearValue
in interface Environment
param
- the Parameter whose value is to be clearedpublic String[] getNames()
Environment
getNames
in interface Environment
public Map<String,Object> getMap()
public String getOutputText()
public String[] getOutputLines()
public String getErrorText()
public String[] getErrorLines()
public MapEnvironment setValue(String paramName, Object value)
paramName
- namevalue
- string or other valuepublic MapEnvironment setResourceBase(Class<?> clazz)
clazz
- resource base classClass.getResource(java.lang.String)
public StarTable getOutputTable(String paramName)
paramName
- name of a TableConsumerParametername
public void acquireValue(Parameter<?> param) throws TaskException
Environment
This environment should obtain a value for the parameter par
in whatever way it sees fit, and must then call par
's
Parameter.setValueFromString(uk.ac.starlink.task.Environment, java.lang.String)
method so that the parameter
knows what its new value is. If the setValueFromString
call
throws a ParameterValueException
the environment may
try to get another value (for instance by re-prompting the user)
or may give up and re-throw the exception.
acquireValue
in interface Environment
param
- the Parameter whose value is to be obtained and setTaskException
public StarTableFactory getTableFactory()
TableEnvironment
getTableFactory
in interface TableEnvironment
public StarTableOutput getTableOutput()
TableEnvironment
getTableOutput
in interface TableEnvironment
public JDBCAuthenticator getJdbcAuthenticator()
TableEnvironment
getJdbcAuthenticator
in interface TableEnvironment
public boolean isDebug()
TableEnvironment
isDebug
in interface TableEnvironment
public void setDebug(boolean debug)
TableEnvironment
setDebug
in interface TableEnvironment
debug
- set true if you want debugging messagespublic boolean isStrictVotable()
TableEnvironment
isStrictVotable
in interface TableEnvironment
public void setStrictVotable(boolean strict)
TableEnvironment
setStrictVotable
in interface TableEnvironment
strict
- true if VOTables should be interpreted
strictly in accordance with the standardpublic String[] getUnused()
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.