Class VariableSubstitutorImpl
java.lang.Object
com.atlassian.bamboo.variable.substitutor.VariableSubstitutorImpl
- All Implemented Interfaces:
VariableSubstitutor
-
Constructor Summary
ModifierConstructorDescriptionprotected
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) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLocalVariable
(@NotNull String key, @NotNull String value) Add a local variable to current context.findAllVariables
(@Nullable String string) Given a string, and aMap
of variables (variable -> value), all patterns in the string array matching ${bamboo.<variable>} will be substituted with the value.If current context is releated to aBuildContext
return all the automatic variables related to repositories.Returns all variables used in string substitution during this object's lifetime@NotNull Map<String,
VariableDefinitionContext> Get all variables in current context@NotNull String
removeAllVariables
(@NotNull String value) Given a string, remove all variable patterns.@Nullable String
substituteString
(@Nullable String value) Substitutes variables in the input string with their values using data from existing state.
-
Constructor Details
-
VariableSubstitutorImpl
protected VariableSubstitutorImpl(@NotNull @NotNull BuildLoggerManager buildLoggerManager, @Nullable @Nullable CapabilityContext capabilityContext, @NotNull @NotNull AgentContext agentContext, @NotNull @NotNull BuildDirectoryManager buildDirectoryManager, @NotNull @NotNull BambooUrl bambooUrl, @Nullable @Nullable VariableDefinitionManager variableDefinitionManager, @NotNull @NotNull VcsRepositoryManager vcsRepositoryManager) -
VariableSubstitutorImpl
protected VariableSubstitutorImpl(@NotNull @NotNull ImmutablePlan immutablePlan, @NotNull @NotNull BuildLoggerManager buildLoggerManager, @Nullable @Nullable CapabilityContext capabilityContext, @NotNull @NotNull AgentContext agentContext, @NotNull @NotNull BuildDirectoryManager buildDirectoryManager, @NotNull @NotNull BambooUrl bambooUrl, @NotNull @NotNull VariableDefinitionManager variableDefinitionManager, @NotNull @NotNull VcsRepositoryManager vcsRepositoryManager) -
VariableSubstitutorImpl
protected VariableSubstitutorImpl(@NotNull @NotNull CommonContext commonContext, @NotNull @NotNull BuildLoggerManager buildLoggerManager, @Nullable @Nullable CapabilityContext capabilityContext, @NotNull @NotNull AgentContext agentContext, @NotNull @NotNull BuildDirectoryManager buildDirectoryManager, @NotNull @NotNull BambooUrl bambooUrl, @NotNull @NotNull CustomVariableContext customVariableContext, @NotNull @NotNull VcsRepositoryManager vcsRepositoryManager) -
VariableSubstitutorImpl
protected VariableSubstitutorImpl(@NotNull @NotNull Map<String, VariableDefinitionContext> variablesContextMap, @NotNull @NotNull BuildLoggerManager buildLoggerManager, @Nullable @Nullable CapabilityContext capabilityContext, @NotNull @NotNull AgentContext agentContext, @NotNull @NotNull BuildDirectoryManager buildDirectoryManager, @NotNull @NotNull BambooUrl bambooUrl, @NotNull @NotNull VcsRepositoryManager vcsRepositoryManager)
-
-
Method Details
-
substituteString
Description copied from interface:VariableSubstitutor
Substitutes variables in the input string with their values using data from existing state.- Specified by:
substituteString
in interfaceVariableSubstitutor
- Parameters:
value
- input string- Returns:
- substituted string
-
getSubstitutedVariables
Description copied from interface:VariableSubstitutor
Returns all variables used in string substitution during this object's lifetime- Specified by:
getSubstitutedVariables
in interfaceVariableSubstitutor
-
removeAllVariables
Description copied from interface:VariableSubstitutor
Given a string, remove all variable patterns.- Specified by:
removeAllVariables
in interfaceVariableSubstitutor
- Parameters:
value
- string values to be analyzed- Returns:
- value with variables removed
-
findAllVariables
Given a string, and aMap
of variables (variable -> value), all patterns in the string array matching ${bamboo.<variable>} will be substituted with the value.- Specified by:
findAllVariables
in interfaceVariableSubstitutor
- Parameters:
string
- String value to be analyzed- Returns:
- Array of string values with variables extrapolated
-
addLocalVariable
Description copied from interface:VariableSubstitutor
Add a local variable to current context.- Specified by:
addLocalVariable
in interfaceVariableSubstitutor
-
getVariableContexts
Description copied from interface:VariableSubstitutor
Get all variables in current context- Specified by:
getVariableContexts
in interfaceVariableSubstitutor
-
getBuiltInRepositoryVariablesIfBuildContext
Description copied from interface:VariableSubstitutor
If current context is releated to aBuildContext
return all the automatic variables related to repositories. Return empty map otherwise.- Specified by:
getBuiltInRepositoryVariablesIfBuildContext
in interfaceVariableSubstitutor
-