Package org.esa.snap.core.gpf.descriptor
Class TemplateParameterDescriptor
java.lang.Object
org.esa.snap.core.gpf.descriptor.DefaultParameterDescriptor
org.esa.snap.core.gpf.descriptor.ToolParameterDescriptor
org.esa.snap.core.gpf.descriptor.TemplateParameterDescriptor
- All Implemented Interfaces:
DataElementDescriptor,ElementDescriptor,ParameterDescriptor
Specialization class for parameters based on a template, with their own parameters.
-
Field Summary
Fields inherited from class org.esa.snap.core.gpf.descriptor.ToolParameterDescriptor
parameterType -
Constructor Summary
ConstructorsConstructorDescriptionTemplateParameterDescriptor(String name, Class<?> type) Copy constructorConversion constructor from a regular parameter -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameterDescriptor(ToolParameterDescriptor descriptor) Adds a parameter descriptor to this template parametervoidcopyFrom(TemplateParameterDescriptor source) executeTemplate(Map<String, Object> params) Transforms (or executes) the template of this instance given a set of parameters.Returns the last scripting context resulted from the execution of the scripting engineReturns the list of the parameter descriptors of this instanceReturns the template of this object.voidremoveParameterDescriptor(ToolParameterDescriptor descriptor) Removes a parameter descriptor from this template parametervoidsetOutputFile(File outputFile) Sets the output file of this template parameter, after the template is parsed.voidsetTemplate(Template template) Sets the template of this parametervoidsetTemplateEngine(TemplateEngine engine) Sets the scripting engine for this parameter and associates its template, if any, with the engine.Methods inherited from class org.esa.snap.core.gpf.descriptor.ToolParameterDescriptor
copyFrom, getAttribute, getDefaultTypedValue, getParameterType, isParameter, isTemplateAfter, isTemplateBefore, isTemplateParameter, setAttribute, setParameterTypeMethods inherited from class org.esa.snap.core.gpf.descriptor.DefaultParameterDescriptor
getAlias, getCondition, getConverterClass, getDataMemberDescriptors, getDataType, getDefaultValue, getDescription, getDomConverterClass, getFormat, getInterval, getItemAlias, getLabel, getName, getPattern, getRasterDataNodeClass, getStructureMemberDescriptors, getUnit, getValidatorClass, getValueSet, isDeprecated, isNotEmpty, isNotNull, isSimple, isStructure, isStructure, setAlias, setCondition, setConverterClass, setDataType, setDefaultValue, setDeprecated, setDescription, setDomConverterClass, setFormat, setInterval, setItemAlias, setLabel, setName, setNotEmpty, setNotNull, setPattern, setRasterDataNodeClass, setUnit, setValidatorClass, setValueSet
-
Constructor Details
-
TemplateParameterDescriptor
public TemplateParameterDescriptor() -
TemplateParameterDescriptor
-
TemplateParameterDescriptor
Conversion constructor from a regular parameter- Parameters:
object- The source parameter
-
TemplateParameterDescriptor
Copy constructor- Parameters:
object- The template parameter to be copied.
-
-
Method Details
-
addParameterDescriptor
Adds a parameter descriptor to this template parameter -
removeParameterDescriptor
Removes a parameter descriptor from this template parameter -
getParameterDescriptors
Returns the list of the parameter descriptors of this instance -
setTemplateEngine
Sets the scripting engine for this parameter and associates its template, if any, with the engine.- Parameters:
engine- The scripting engine- Throws:
TemplateException
-
getLastContext
Returns the last scripting context resulted from the execution of the scripting engine -
setTemplate
Sets the template of this parameter- Parameters:
template- The template object- Throws:
TemplateException
-
getTemplate
Returns the template of this object. If it has none, a new template will be created and returned. -
executeTemplate
Transforms (or executes) the template of this instance given a set of parameters.- Parameters:
params- A collection of parameter values- Returns:
- The transformed template
- Throws:
TemplateException
-
getOutputFile
- Returns:
- the output file of this template parameter, after the template is parsed
-
setOutputFile
Sets the output file of this template parameter, after the template is parsed. The output file path may be a relative one or an absolute one- Parameters:
outputFile- output file of this template parameter
-
copyFrom
-