Class VariableSubstitutorImpl
java.lang.Object
com.atlassian.bamboo.variable.substitutor.VariableSubstitutorImpl
- All Implemented Interfaces:
VariableSubstitutor
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVariableSubstitutorImpl(@NotNull BuildLoggerManager buildLoggerManager, @Nullable CapabilityContext capabilityContext, @NotNull AgentContext agentContext, @NotNull BuildDirectoryManager buildDirectoryManager, @NotNull BambooUrl bambooUrl, @Nullable VariableDefinitionManager variableDefinitionManager, @NotNull VcsRepositoryManager vcsRepositoryManager) protectedVariableSubstitutorImpl(@NotNull ImmutablePlan immutablePlan, @NotNull BuildLoggerManager buildLoggerManager, @Nullable CapabilityContext capabilityContext, @NotNull AgentContext agentContext, @NotNull BuildDirectoryManager buildDirectoryManager, @NotNull BambooUrl bambooUrl, @NotNull VariableDefinitionManager variableDefinitionManager, @NotNull VcsRepositoryManager vcsRepositoryManager) protectedVariableSubstitutorImpl(@NotNull CommonContext commonContext, @NotNull BuildLoggerManager buildLoggerManager, @Nullable CapabilityContext capabilityContext, @NotNull AgentContext agentContext, @NotNull BuildDirectoryManager buildDirectoryManager, @NotNull BambooUrl bambooUrl, @NotNull CustomVariableContext customVariableContext, @NotNull VcsRepositoryManager vcsRepositoryManager, boolean createLocalCopyOfVariableContext) protectedVariableSubstitutorImpl(@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 TypeMethodDescriptionvoidaddLocalVariable(@NotNull String key, @NotNull String value) Add a local variable to current context.findAllVariables(@Nullable String string) Given a string, and aMapof variables (variable -> value), all patterns in the string array matching ${bamboo.<variable>} will be substituted with the value.If current context is releated to aBuildContextreturn 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 StringremoveAllVariables(@NotNull String value) Given a string, remove all variable patterns.@Nullable StringsubstituteString(@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, boolean createLocalCopyOfVariableContext) -
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:VariableSubstitutorSubstitutes variables in the input string with their values using data from existing state.- Specified by:
substituteStringin interfaceVariableSubstitutor- Parameters:
value- input string- Returns:
- substituted string
-
getSubstitutedVariables
Description copied from interface:VariableSubstitutorReturns all variables used in string substitution during this object's lifetime- Specified by:
getSubstitutedVariablesin interfaceVariableSubstitutor
-
removeAllVariables
Description copied from interface:VariableSubstitutorGiven a string, remove all variable patterns.- Specified by:
removeAllVariablesin interfaceVariableSubstitutor- Parameters:
value- string values to be analyzed- Returns:
- value with variables removed
-
findAllVariables
Given a string, and aMapof variables (variable -> value), all patterns in the string array matching ${bamboo.<variable>} will be substituted with the value.- Specified by:
findAllVariablesin interfaceVariableSubstitutor- Parameters:
string- String value to be analyzed- Returns:
- Array of string values with variables extrapolated
-
addLocalVariable
Description copied from interface:VariableSubstitutorAdd a local variable to current context.- Specified by:
addLocalVariablein interfaceVariableSubstitutor- Parameters:
key-value-
-
getVariableContexts
Description copied from interface:VariableSubstitutorGet all variables in current context- Specified by:
getVariableContextsin interfaceVariableSubstitutor
-
getBuiltInRepositoryVariablesIfBuildContext
Description copied from interface:VariableSubstitutorIf current context is releated to aBuildContextreturn all the automatic variables related to repositories. Return empty map otherwise.- Specified by:
getBuiltInRepositoryVariablesIfBuildContextin interfaceVariableSubstitutor
-