Class Scriptlet

    • Constructor Detail

      • Scriptlet

        public Scriptlet()
    • Method Detail

      • getSubpackage

        public String getSubpackage()
        The optional subpackage. This is passed as a -n argument to the scriptlet directive.
        Returns:
        Returns the subpackage.
      • setSubpackage

        public void setSubpackage​(String subpackage)
        Parameters:
        subpackage - The subpackage to set.
      • getProgram

        public String getProgram()
        The program to use to execute the script. This is passed as a -p argument to the scriptlet directive.
        Returns:
        Returns the program.
      • setProgram

        public void setProgram​(String program)
        Parameters:
        program - The program to set.
      • getScript

        public String getScript()
        The contents of the script as a String. This value will override anything at getScriptFile().
        Returns:
        Returns the script.
      • setScript

        public void setScript​(String script)
        Parameters:
        script - The script to set.
      • getScriptFile

        public File getScriptFile()
        The contents of the script as a File. This will be ignored if getScript() is populated.
        Returns:
        Returns the scriptFile.
      • setScriptFile

        public void setScriptFile​(File scriptFile)
        Parameters:
        scriptFile - The scriptFile to set.
      • getFileEncoding

        public String getFileEncoding()
        The encoding to use to read getScriptFile(). If null, the default character encoding for th platform will be used.
        Returns:
        Returns the fileEncoding.
      • setFileEncoding

        public void setFileEncoding​(String fileEncoding)
        Parameters:
        fileEncoding - The fileEncoding to set.
      • setSourceEncoding

        public void setSourceEncoding​(String sourceEncoding)
        This is the maven property: project.build.sourceEncoding
        Parameters:
        sourceEncoding - The sourceEncoding to set.
      • isFilter

        public boolean isFilter()
        Returns:
        Returns the filter.
      • setFilter

        public void setFilter​(boolean filter)
        Parameters:
        filter - The filter to set.
      • write

        protected final void write​(PrintWriter writer,
                                   String directive,
                                   List<org.apache.maven.shared.filtering.FilterWrapper> filterWrappers)
                            throws IOException
        Writes the scriptlet.
        Parameters:
        writer - PrintWriter to write content to.
        directive - The directive for the scriptlet.
        filterWrappers - The filter wrappers to be applied when writing the content.
        Throws:
        IOException - if an I/IO error occurs
      • buildScriptletLine

        protected String buildScriptletLine​(String directive)
        Builds the scriptlet line including any optional args.
        Parameters:
        directive - The directive for the scriptlet.
        Returns:
        The scriptlet line - this does not include the script.
      • writeContent

        protected final void writeContent​(PrintWriter writer,
                                          List<org.apache.maven.shared.filtering.FilterWrapper> filterWrappers)
                                   throws IOException
        Writes the content (either getScript() or getScriptFile()) to writer.
        Parameters:
        writer - PrintWriter to write content to.
        filterWrappers - The filter wrappers to be applied when writing the content.
        Throws:
        IOException - if an I/IO error occurs