com.atlassian.bamboo.command
Class AbstractCommandDecorator<T extends Command>

java.lang.Object
  extended by com.atlassian.bamboo.command.AbstractCommandDecorator<T>
All Implemented Interfaces:
CommandDecorator, BambooPluginModule
Direct Known Subclasses:
IsolatedLocalRepositoryMavenCommandDecorator, IsolatedTmpDirAntCommandDecorator, IsolatedTmpDirMavenCommandDecorator

public abstract class AbstractCommandDecorator<T extends Command>
extends java.lang.Object
implements CommandDecorator


Constructor Summary
protected AbstractCommandDecorator(java.lang.Class<T> commandClass)
           
 
Method Summary
protected  void addArgument(java.util.List<java.lang.String> args, java.lang.String argument)
          Argument is added to the beginning of command line.
 boolean canDecorate(Command command)
          Given a command, determine whether or not it can be decorated.
protected  BuildContext getBuildContext()
           
protected  T getCommand()
           
 void init(BuildContext buildContext)
           
protected  java.lang.String quoteArgument(java.lang.String argument)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.command.CommandDecorator
decorateArguments
 

Constructor Detail

AbstractCommandDecorator

protected AbstractCommandDecorator(java.lang.Class<T> commandClass)
Method Detail

canDecorate

public boolean canDecorate(Command command)
Description copied from interface: CommandDecorator
Given a command, determine whether or not it can be decorated. If this method returns false, then the decorateArguments method will not get called.

Specified by:
canDecorate in interface CommandDecorator
Parameters:
command - the command that will be decorated
Returns:
true if the command can be decorated by this Decorator. false otherwise.

init

public void init(BuildContext buildContext)
Specified by:
init in interface CommandDecorator

addArgument

protected void addArgument(@NotNull
                           java.util.List<java.lang.String> args,
                           @NotNull
                           java.lang.String argument)
Argument is added to the beginning of command line. On Windows the command line might start with /c call script.bat therefore options shall be added starting from index 3

Parameters:
args - Commandline arguments
argument - Argument to be added to commandline

getCommand

@Nullable
protected T getCommand()

getBuildContext

@Nullable
protected BuildContext getBuildContext()

quoteArgument

@NotNull
protected java.lang.String quoteArgument(@NotNull
                                                 java.lang.String argument)


Copyright © 2011 Atlassian. All Rights Reserved.