Class AbstractScriptComponent

    • Constructor Detail

      • AbstractScriptComponent

        public AbstractScriptComponent()
    • Method Detail

      • setProject

        public void setProject​(Project project)
        Set the project.
        Overrides:
        setProject in class ProjectComponent
        Parameters:
        project - the owner of this component.
      • getRunner

        public ScriptRunnerBase getRunner()
        Get our script runner
        Returns:
        the runner
      • setSrc

        public void setSrc​(java.io.File file)
        Load the script from an external file; optional.
        Parameters:
        file - the file containing the script source.
      • addText

        public void addText​(java.lang.String text)
        The script text.
        Parameters:
        text - a component of the script text to be added.
      • setManager

        public void setManager​(java.lang.String manager)
        Defines the manager.
        Parameters:
        manager - the scripting manager.
      • setLanguage

        public void setLanguage​(java.lang.String language)
        Defines the language (required).
        Parameters:
        language - the scripting language name for the script.
      • initScriptRunner

        protected void initScriptRunner()
        Initialize the script runner. Calls this before running the system
      • setClasspath

        public void setClasspath​(Path classpath)
        Set the classpath to be used when searching for classes and resources.
        Parameters:
        classpath - an Ant Path object containing the search path.
      • createClasspath

        public Path createClasspath()
        Classpath to be used when searching for classes and resources.
        Returns:
        an empty Path instance to be configured by Ant.
      • setClasspathRef

        public void setClasspathRef​(Reference r)
        Set the classpath by reference.
        Parameters:
        r - a Reference to a Path instance to be used as the classpath value.
      • executeScript

        protected void executeScript​(java.lang.String execName)
        Run a script
        Parameters:
        execName - name of the script
      • setSetBeans

        public void setSetBeans​(boolean setBeans)
        Set the setbeans attribute. If this is true, <script> will create variables in the script instance for all properties, targets and references of the current project. It this is false, only the project and self variables will be set. The default is true.
        Parameters:
        setBeans - the value to set.
        Since:
        Ant 1.8.0
      • setEncoding

        public void setEncoding​(java.lang.String encoding)
        Set the encoding of the script from an external file; optional.
        Parameters:
        encoding - the encoding of the file containing the script source.
        Since:
        Ant 1.10.2