@NotThreadSafe public class VariableSubstitutorImpl extends Object implements VariableSubstitutor
Modifier | Constructor and Description |
---|---|
protected |
VariableSubstitutorImpl(BuildLoggerManager buildLoggerManager,
CapabilityContext capabilityContext,
AgentContext agentContext,
BuildDirectoryManager buildDirectoryManager,
BambooUrl bambooUrl,
VariableDefinitionManager variableDefinitionManager,
VcsRepositoryManager vcsRepositoryManager) |
protected |
VariableSubstitutorImpl(CommonContext commonContext,
BuildLoggerManager buildLoggerManager,
CapabilityContext capabilityContext,
AgentContext agentContext,
BuildDirectoryManager buildDirectoryManager,
BambooUrl bambooUrl,
CustomVariableContext customVariableContext,
VcsRepositoryManager vcsRepositoryManager) |
protected |
VariableSubstitutorImpl(ImmutablePlan immutablePlan,
BuildLoggerManager buildLoggerManager,
CapabilityContext capabilityContext,
AgentContext agentContext,
BuildDirectoryManager buildDirectoryManager,
BambooUrl bambooUrl,
VariableDefinitionManager variableDefinitionManager,
VcsRepositoryManager vcsRepositoryManager) |
protected |
VariableSubstitutorImpl(Map<String,VariableDefinitionContext> variablesContextMap,
BuildLoggerManager buildLoggerManager,
CapabilityContext capabilityContext,
AgentContext agentContext,
BuildDirectoryManager buildDirectoryManager,
BambooUrl bambooUrl,
VcsRepositoryManager vcsRepositoryManager) |
Modifier and Type | Method and Description |
---|---|
void |
addLocalVariable(String key,
String value)
Add a local variable to current context.
|
Set<String> |
findAllVariables(String variable)
Given a string, and a
Map of variables (variable -> value), all patterns in the string array
matching ${bamboo.<variable>} will be substituted with the value. |
Map<String,VariableDefinitionContext> |
getBuiltInRepositoryVariablesIfBuildContext()
If current context is releated to a
BuildContext return all the automatic variables related to repositories. |
Map<String,VariableSubstitutionContext> |
getSubstitutedVariables()
Returns all variables used in string substitution during this object's lifetime
|
Map<String,VariableDefinitionContext> |
getVariableContexts()
Get all variables in current context
|
String |
removeAllVariables(String value)
Given a string, remove all variable patterns.
|
String |
substituteString(String value)
Substitutes variables in the input string with their values using data from existing state.
|
protected VariableSubstitutorImpl(@NotNull BuildLoggerManager buildLoggerManager, @Nullable CapabilityContext capabilityContext, @NotNull AgentContext agentContext, @NotNull BuildDirectoryManager buildDirectoryManager, @NotNull BambooUrl bambooUrl, @Nullable VariableDefinitionManager variableDefinitionManager, @NotNull VcsRepositoryManager vcsRepositoryManager)
protected VariableSubstitutorImpl(@NotNull ImmutablePlan immutablePlan, @NotNull BuildLoggerManager buildLoggerManager, @Nullable CapabilityContext capabilityContext, @NotNull AgentContext agentContext, @NotNull BuildDirectoryManager buildDirectoryManager, @NotNull BambooUrl bambooUrl, @NotNull VariableDefinitionManager variableDefinitionManager, @NotNull VcsRepositoryManager vcsRepositoryManager)
protected VariableSubstitutorImpl(@NotNull CommonContext commonContext, @NotNull BuildLoggerManager buildLoggerManager, @Nullable CapabilityContext capabilityContext, @NotNull AgentContext agentContext, @NotNull BuildDirectoryManager buildDirectoryManager, @NotNull BambooUrl bambooUrl, @NotNull CustomVariableContext customVariableContext, @NotNull VcsRepositoryManager vcsRepositoryManager)
protected VariableSubstitutorImpl(@NotNull Map<String,VariableDefinitionContext> variablesContextMap, @NotNull BuildLoggerManager buildLoggerManager, @Nullable CapabilityContext capabilityContext, @NotNull AgentContext agentContext, @NotNull BuildDirectoryManager buildDirectoryManager, @NotNull BambooUrl bambooUrl, @NotNull VcsRepositoryManager vcsRepositoryManager)
@Nullable public String substituteString(@Nullable String value)
VariableSubstitutor
substituteString
in interface VariableSubstitutor
value
- input stringpublic Map<String,VariableSubstitutionContext> getSubstitutedVariables()
VariableSubstitutor
getSubstitutedVariables
in interface VariableSubstitutor
@NotNull public String removeAllVariables(@NotNull String value)
VariableSubstitutor
removeAllVariables
in interface VariableSubstitutor
value
- string values to be analyzed@NotNull public Set<String> findAllVariables(@Nullable String variable)
Map
of variables (variable -> value), all patterns in the string array
matching ${bamboo.<variable>} will be substituted with the value.findAllVariables
in interface VariableSubstitutor
variable
- String value to be analyzedpublic void addLocalVariable(@NotNull String key, @NotNull String value)
VariableSubstitutor
addLocalVariable
in interface VariableSubstitutor
@NotNull public Map<String,VariableDefinitionContext> getVariableContexts()
VariableSubstitutor
getVariableContexts
in interface VariableSubstitutor
public Map<String,VariableDefinitionContext> getBuiltInRepositoryVariablesIfBuildContext()
VariableSubstitutor
BuildContext
return all the automatic variables related to repositories.
Return empty map otherwise.getBuiltInRepositoryVariablesIfBuildContext
in interface VariableSubstitutor
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.