Class TemplateParameterDescriptor

    • Constructor Detail

      • 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 Detail

      • 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
      • 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