Class TemplateParameterDescriptor

All Implemented Interfaces:
DataElementDescriptor, ElementDescriptor, ParameterDescriptor

public class TemplateParameterDescriptor extends ToolParameterDescriptor
Specialization class for parameters based on a template, with their own parameters.
  • Constructor Details

    • TemplateParameterDescriptor

      public TemplateParameterDescriptor()
    • TemplateParameterDescriptor

      public TemplateParameterDescriptor(String name, Class<?> type)
    • TemplateParameterDescriptor

      public TemplateParameterDescriptor(ToolParameterDescriptor object)
      Conversion constructor from a regular parameter
      Parameters:
      object - The source parameter
    • TemplateParameterDescriptor

      public TemplateParameterDescriptor(TemplateParameterDescriptor object)
      Copy constructor
      Parameters:
      object - The template parameter to be copied.
  • Method Details

    • addParameterDescriptor

      public void addParameterDescriptor(ToolParameterDescriptor descriptor)
      Adds a parameter descriptor to this template parameter
    • removeParameterDescriptor

      public void removeParameterDescriptor(ToolParameterDescriptor descriptor)
      Removes a parameter descriptor from this template parameter
    • getParameterDescriptors

      public List<ToolParameterDescriptor> getParameterDescriptors()
      Returns the list of the parameter descriptors of this instance
    • setTemplateEngine

      public void setTemplateEngine(TemplateEngine engine) throws TemplateException
      Sets the scripting engine for this parameter and associates its template, if any, with the engine.
      Parameters:
      engine - The scripting engine
      Throws:
      TemplateException
    • getLastContext

      public TemplateContext getLastContext()
      Returns the last scripting context resulted from the execution of the scripting engine
    • setTemplate

      public void setTemplate(Template template) throws TemplateException
      Sets the template of this parameter
      Parameters:
      template - The template object
      Throws:
      TemplateException
    • getTemplate

      public Template getTemplate()
      Returns the template of this object. If it has none, a new template will be created and returned.
    • executeTemplate

      public String executeTemplate(Map<String,Object> params) throws TemplateException
      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

      public File getOutputFile()
      Returns:
      the output file of this template parameter, after the template is parsed
    • setOutputFile

      public void setOutputFile(File outputFile)
      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

      public void copyFrom(TemplateParameterDescriptor source)