Package org.jclouds.scriptbuilder
Class ScriptBuilder
java.lang.Object
org.jclouds.scriptbuilder.ScriptBuilder
- All Implemented Interfaces:
AcceptsStatementVisitor
,Statement
Creates a shell script.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(StatementVisitor visitor) addEnvironmentVariableScope
(String scopeName, Map<String, String> variables) Exports a variable inside the scriptaddStatement
(Statement statement) static Statement
static Statement
static Statement
functionDependencies
(OsFamily family) builds the shell script, by adding the following shell declaration line variable exports case/switchresolveFunctionDependenciesForStatements
(Map<String, String> knownFunctions, Iterable<Statement> statements, OsFamily osFamily) Unsets a variable to ensure it is set within the script.static void
writeFunctions
(Map<String, String> functionsToWrite, OsFamily osFamily, StringBuilder builder)
-
Constructor Details
-
ScriptBuilder
public ScriptBuilder()
-
-
Method Details
-
addStatement
-
unsetEnvironmentVariable
Unsets a variable to ensure it is set within the script.- Parameters:
variable
- name in UPPER_UNDERSCORE case format
-
addEnvironmentVariableScope
Exports a variable inside the script- Parameters:
scopeName
-variables
- keys are the variables to export in UPPER_UNDERSCORE case format
-
forget
-
findPid
-
call
-
render
builds the shell script, by adding the following- shell declaration line
- variable exports
- case/switch
-
writeFunctions
public static void writeFunctions(Map<String, String> functionsToWrite, OsFamily osFamily, StringBuilder builder) -
resolveFunctionDependenciesForStatements
-
functionDependencies
- Specified by:
functionDependencies
in interfaceStatement
-
accept
- Specified by:
accept
in interfaceAcceptsStatementVisitor
-