org.apache.tools.ant.util.facade

Class FacadeTaskHelper


public class FacadeTaskHelper
extends java.lang.Object

Helper class for facade implementations - encapsulates treatment of explicit implementation choices, magic properties and implementation specific command line arguments.
Since:
Ant 1.5

Constructor Summary

FacadeTaskHelper(String defaultValue)
FacadeTaskHelper(String defaultValue, String magicValue)

Method Summary

void
addImplementationArgument(ImplementationSpecificArgument arg)
Command line argument.
String[]
getArgs()
Retrieves the command line arguments enabled for the current facade implementation.
String
getExplicitChoice()
Retrieves the explicit user choice.
String
getImplementation()
Retrieves the implementation.
boolean
hasBeenSet()
Tests whether the implementation has been chosen by the user (either via a magic property or explicitly.
void
setImplementation(String userChoice)
Used for explicit user choices.
void
setMagicValue(String magicValue)
Used to set the value of the magic property.

Constructor Details

FacadeTaskHelper

public FacadeTaskHelper(String defaultValue)
Parameters:
defaultValue - The default value for the implementation. Must not be null.

FacadeTaskHelper

public FacadeTaskHelper(String defaultValue,
                        String magicValue)
Parameters:
defaultValue - The default value for the implementation. Must not be null.
magicValue - the value of a magic property that may hold a user. choice. May be null.

Method Details

addImplementationArgument

public void addImplementationArgument(ImplementationSpecificArgument arg)
Command line argument.
Parameters:
arg - an argument to add.

getArgs

public String[] getArgs()
Retrieves the command line arguments enabled for the current facade implementation.
Returns:
an array of command line arguements.

getExplicitChoice

public String getExplicitChoice()
Retrieves the explicit user choice.
Returns:
the explicit user choice.

getImplementation

public String getImplementation()
Retrieves the implementation.
Returns:
the implementation.

hasBeenSet

public boolean hasBeenSet()
Tests whether the implementation has been chosen by the user (either via a magic property or explicitly.
Returns:
true if magic or user choice has be set.
Since:
Ant 1.5.2

setImplementation

public void setImplementation(String userChoice)
Used for explicit user choices.
Parameters:
userChoice - the explicitly chosen implementation.

setMagicValue

public void setMagicValue(String magicValue)
Used to set the value of the magic property.
Parameters:
magicValue - the value of a magic property that may hold a user.

Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.