com.atlassian.bamboo.build
Class VariableSubstitutionBean

java.lang.Object
  extended by com.atlassian.bamboo.build.AbstractSubstitutionBean
      extended by com.atlassian.bamboo.build.VariableSubstitutionBean
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
VariableSubstitutionBeanForTesting

public class VariableSubstitutionBean
extends AbstractSubstitutionBean
implements java.io.Serializable

This bean is responsible for substituting BuildDefinition values with variables. Variables can come from two locations: BuildResultsImpl.getCustomBuildData() or AdministrationConfiguration.getGlobalVariables(). This bean substitutes using the BuildResultsImpl.getCustomBuildData() first, then delegates to GlobalSubstitutionBeanImpl to substitute AdministrationConfiguration.getGlobalVariables(). For remoting, this bean will be deployed on the remote agent, the GlobalVariableSubstitutionBean exists only on the server.

See Also:
Serialized Form

Constructor Summary
VariableSubstitutionBean()
           
 
Method Summary
 void setCapabilitySubstitutionBean(CapabilitySubstitutionBean capabilitySubstitutionBean)
           
 void setGlobalSubstitutionBean(GlobalSubstitutionBean globalSubstitutionBean)
           
 java.lang.String[] substituteBambooVariables(java.lang.String[] commandLine, java.lang.String buildPlanKey, BuildLogger buildLogger, java.util.Map<java.lang.String,java.lang.String> customBuildData)
          Takes in a string array to be parsed for variables.
 java.lang.String substituteBambooVariables(java.lang.String unparsedString, java.lang.String buildPlanKey, BuildLogger buildLogger, java.util.Map<java.lang.String,java.lang.String> customBuildData)
          Takes in a String to be parsed for variables.
 
Methods inherited from class com.atlassian.bamboo.build.AbstractSubstitutionBean
substituteVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableSubstitutionBean

public VariableSubstitutionBean()
Method Detail

substituteBambooVariables

public java.lang.String substituteBambooVariables(java.lang.String unparsedString,
                                                  java.lang.String buildPlanKey,
                                                  BuildLogger buildLogger,
                                                  java.util.Map<java.lang.String,java.lang.String> customBuildData)
Takes in a String to be parsed for variables. The build and buildInfo will determine which variables can be parsed. i.e. you can not use bamboo.buildNumber without supplying the BuildResults.

Parameters:
unparsedString - String to be substituted. Does not necessarily have to contain any variables. Can not be null but can be blank
buildPlanKey -
buildLogger -
customBuildData -
Returns:
String with macthed variables replaced

substituteBambooVariables

public java.lang.String[] substituteBambooVariables(java.lang.String[] commandLine,
                                                    java.lang.String buildPlanKey,
                                                    BuildLogger buildLogger,
                                                    java.util.Map<java.lang.String,java.lang.String> customBuildData)
Takes in a string array to be parsed for variables. The build and buildInfo will determine which variables can be parsed. i.e. you can not use bamboo.buildNumber without supplying the BuildResults. Will stubstitue with variables from the customBuilData map first. Then proceed to substitute with GlobalSubstitutionBeanImpl.

Parameters:
commandLine - String Array to be substituted. Does not necessarily have to contain any variables. Can not be null but can be empty.
buildPlanKey -
buildLogger -
customBuildData -
Returns:
String Array with matched variables replaced

setGlobalSubstitutionBean

public void setGlobalSubstitutionBean(GlobalSubstitutionBean globalSubstitutionBean)

setCapabilitySubstitutionBean

public void setCapabilitySubstitutionBean(CapabilitySubstitutionBean capabilitySubstitutionBean)


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.