public class Scriptlet extends Object
getSubpackage()
and getProgram()
. The (optional) contents
can be provided by either getScript()
or getScriptFile()
.Constructor and Description |
---|
Scriptlet() |
Modifier and Type | Method and Description |
---|---|
protected String |
buildScriptletLine(String directive)
Builds the scriptlet line including any optional args.
|
String |
getFileEncoding()
The encoding to use to read
getScriptFile() . |
String |
getProgram()
The program to use to execute the script.
|
String |
getScript()
The contents of the script as a
String . |
File |
getScriptFile()
The contents of the script as a
File . |
String |
getSubpackage()
The optional subpackage.
|
boolean |
isFilter() |
void |
setFileEncoding(String fileEncoding) |
void |
setFilter(boolean filter) |
void |
setProgram(String program) |
void |
setScript(String script) |
void |
setScriptFile(File scriptFile) |
void |
setSourceEncoding(String sourceEncoding)
This is the maven property: project.build.sourceEncoding
|
void |
setSubpackage(String subpackage) |
String |
toString() |
protected void |
write(PrintWriter writer,
String directive,
List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> filterWrappers)
Writes the scriptlet.
|
protected void |
writeContent(PrintWriter writer,
List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> filterWrappers)
Writes the content (either
getScript() or getScriptFile() ) to writer. |
public String getSubpackage()
subpackage
.public void setSubpackage(String subpackage)
subpackage
- The subpackage
to set.public String getProgram()
program
.public String getScript()
String
. This value will override anything at getScriptFile()
.script
.public File getScriptFile()
File
. This will be ignored if getScript()
is populated.scriptFile
.public void setScriptFile(File scriptFile)
scriptFile
- The scriptFile
to set.public String getFileEncoding()
getScriptFile()
. If null
, the default character encoding for th
platform will be used.fileEncoding
.public void setFileEncoding(String fileEncoding)
fileEncoding
- The fileEncoding
to set.public void setSourceEncoding(String sourceEncoding)
sourceEncoding
- The sourceEncoding
to set.public boolean isFilter()
filter
.public void setFilter(boolean filter)
filter
- The filter
to set.protected final void write(PrintWriter writer, String directive, List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> filterWrappers) throws IOException
writer
- PrintWriter
to write content to.directive
- The directive for the scriptlet.filterWrappers
- The filter wrappers to be applied when writing the content.IOException
protected String buildScriptletLine(String directive)
directive
- The directive for the scriptlet.protected final void writeContent(PrintWriter writer, List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> filterWrappers) throws IOException
getScript()
or getScriptFile()
) to writer.writer
- PrintWriter
to write content to.filterWrappers
- The filter wrappers to be applied when writing the content.IOException
Copyright © 2005–2018 MojoHaus. All rights reserved.