|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@PublicApi public interface CustomVariableContext
Bean maintaining ThreadLocal
state of available variables.
The state contains (if applicable):
- current Plan
- variable definitions (including Plan variables when applicable)
- BuildContext
- BuildLogger
Method Summary | |
---|---|
void |
addCustomData(java.lang.String key,
java.lang.String value)
Adds a VariableType.MANUAL variable to ThreadLocal state. |
void |
clearContext()
Clear ThreadLocal state. |
java.util.Set<java.lang.String> |
findAllVariables(java.lang.String stringWithVariables)
Given a string, all patterns in the string matching ${bamboo. |
java.util.Map<java.lang.String,VariableSubstitutionContext> |
getSubstitutedVariables()
Get all the variables that have previously been substituted in this thread. |
java.util.Map<java.lang.String,java.lang.String> |
getVariables(BuildContext buildContext)
Deprecated. since 5.0 use getVariables(CommonContext) |
java.util.Map<java.lang.String,java.lang.String> |
getVariables(CommonContext commonContext)
Get all variables from context. |
java.lang.String |
removeAllVariables(java.lang.String unparsedString)
Given a string, remove all variable patterns. |
void |
setBuildContext(BuildContext buildContext)
Deprecated. since 5.0 use setCommonContext(CommonContext) |
void |
setCommonContext(CommonContext commonContext)
Set context reference in ThreadLocal state. |
void |
setPlan(ImmutablePlan plan)
Sets Plan reference and default variable definitions (globals and from plan) in ThreadLocal state. |
void |
setPlan(ImmutablePlan plan,
java.util.Map<java.lang.String,VariableDefinitionContext> variablesContextMap)
Sets Plan reference and variable definitions in ThreadLocal state. |
void |
setPlan(PlanIdentifier plan,
java.util.Map<java.lang.String,VariableDefinitionContext> variablesContextMap)
Sets Plan reference and variable definitions in ThreadLocal state. |
void |
setVariables(java.util.Map<java.lang.String,VariableDefinitionContext> variablesContextMap)
Set variable definitions in ThreadLocal state. |
java.lang.String |
substituteString(java.lang.String value)
Substitutes variables in the input string with their values using data from existing ThreadLocal state. |
java.lang.String |
substituteString(java.lang.String value,
BuildContext buildContext,
BuildLogger buildLogger)
Deprecated. since 5.0 use substituteString(String, CommonContext, BuildLogger) |
java.lang.String |
substituteString(java.lang.String value,
CommonContext commonContext,
BuildLogger buildLogger)
Substitutes variables in the input string with their values using provided data, i.e. |
Method Detail |
---|
void addCustomData(java.lang.String key, java.lang.String value)
VariableType.MANUAL
variable to ThreadLocal
state.
key
- name of the variablevalue
- value of the variable@Nullable java.lang.String substituteString(@Nullable java.lang.String value)
ThreadLocal
state.
value
- input string
@Nullable @Deprecated java.lang.String substituteString(@Nullable java.lang.String value, @Nullable BuildContext buildContext, @Nullable BuildLogger buildLogger)
substituteString(String, CommonContext, BuildLogger)
ThreadLocal
state.
value
- input stringbuildContext
- build contextbuildLogger
- build logger
@Nullable java.lang.String substituteString(@Nullable java.lang.String value, @Nullable CommonContext commonContext, @Nullable BuildLogger buildLogger)
ThreadLocal
state.
value
- input stringcommonContext
- build contextbuildLogger
- build logger
@NotNull @Deprecated java.util.Map<java.lang.String,java.lang.String> getVariables(@Nullable BuildContext buildContext)
getVariables(CommonContext)
buildContext
- Build or Deployment context
@NotNull java.util.Map<java.lang.String,java.lang.String> getVariables(@Nullable CommonContext commonContext)
commonContext
- Build or Deployment context
@NotNull java.lang.String removeAllVariables(@NotNull java.lang.String unparsedString)
unparsedString
- string values to be analyzed
@NotNull java.util.Map<java.lang.String,VariableSubstitutionContext> getSubstitutedVariables()
@Deprecated void setBuildContext(BuildContext buildContext)
setCommonContext(CommonContext)
ThreadLocal
state.
Sets the variable definitions to those contained in the context.
BuildContext has priority over Plan when resolving the variables.
buildContext
- void setCommonContext(@NotNull CommonContext commonContext)
ThreadLocal
state.
Sets the variable definitions to those contained in the context.
context has priority over Plans and Deployment Jobs when resolving the variables.
commonContext
- void clearContext()
ThreadLocal
state.
void setPlan(@NotNull PlanIdentifier plan, @Nullable java.util.Map<java.lang.String,VariableDefinitionContext> variablesContextMap)
ThreadLocal
state.
Clears history of substituted variables (getSubstitutedVariables()
plan
- variablesContextMap
- variable definitions (including plan variables)void setPlan(@NotNull ImmutablePlan plan, @Nullable java.util.Map<java.lang.String,VariableDefinitionContext> variablesContextMap)
ThreadLocal
state.
Clears history of substituted variables (getSubstitutedVariables()
plan
- variablesContextMap
- variable definitions (including plan variables)void setPlan(@NotNull ImmutablePlan plan)
ThreadLocal
state.
Clears history of substituted variables (getSubstitutedVariables()
plan
- void setVariables(java.util.Map<java.lang.String,VariableDefinitionContext> variablesContextMap)
ThreadLocal
state.
Clears history of substituted variables (getSubstitutedVariables()
variablesContextMap
- variable definitions@NotNull java.util.Set<java.lang.String> findAllVariables(@Nullable java.lang.String stringWithVariables)
stringWithVariables
- String value to be analyzed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |