org.codehaus.cargo.util
Class AntUtils

java.lang.Object
  extended by org.codehaus.cargo.util.AntUtils

public class AntUtils
extends Object

Set of common Ant utility methods.

Version:
$Id: AntUtils.java 1575 2008-05-04 22:24:29Z mwringe $

Constructor Summary
AntUtils()
          Uses the DefaultAntTaskFactory class when creating Ant tasks.
AntUtils(AntTaskFactory factory)
           
 
Method Summary
 void addTokensToFilterChain(org.apache.tools.ant.types.FilterChain filterChain, Map map)
          Add the map of tokens to the filterChain.
 void addTokenToFilterChain(org.apache.tools.ant.types.FilterChain filterChain, String key, String value)
          Add a token to an existing filter chain.
 org.apache.tools.ant.Task createAntTask(String taskName)
          Creates and returns a new instance of the Ant task mapped to the specified logical name.
 org.apache.tools.ant.Project createProject()
           
 org.apache.tools.ant.types.Environment.Variable createSysProperty(String key, File file)
          Convenience method to create an Ant environment variable that points to a file.
 org.apache.tools.ant.types.Environment.Variable createSysProperty(String key, org.apache.tools.ant.types.Path path)
          Convenience method to create an Ant environment variable that contains a path.
 org.apache.tools.ant.types.Environment.Variable createSysProperty(String key, String value)
          Convenience method to create an Ant environment variable that contains a string.
 org.apache.tools.ant.types.Environment.Variable createSysProperty(String key, URI value)
          Convenience method to create an Ant environment variable that contains a string from an URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AntUtils

public AntUtils()
Uses the DefaultAntTaskFactory class when creating Ant tasks.


AntUtils

public AntUtils(AntTaskFactory factory)
Parameters:
factory - Ant task factory class used when creating Ant tasks
Method Detail

createAntTask

public final org.apache.tools.ant.Task createAntTask(String taskName)
Creates and returns a new instance of the Ant task mapped to the specified logical name.

Parameters:
taskName - The logical name of the task to create
Returns:
A new instance of the task

createSysProperty

public final org.apache.tools.ant.types.Environment.Variable createSysProperty(String key,
                                                                               File file)
Convenience method to create an Ant environment variable that points to a file.

Parameters:
key - The key or name of the variable
file - The file the variable should point to
Returns:
The created environment variable

createSysProperty

public final org.apache.tools.ant.types.Environment.Variable createSysProperty(String key,
                                                                               org.apache.tools.ant.types.Path path)
Convenience method to create an Ant environment variable that contains a path.

Parameters:
key - The key or name of the variable
path - The path
Returns:
The created environment variable

createSysProperty

public final org.apache.tools.ant.types.Environment.Variable createSysProperty(String key,
                                                                               String value)
Convenience method to create an Ant environment variable that contains a string.

Parameters:
key - The key or name of the variable
value - The value
Returns:
The created environment variable

createSysProperty

public final org.apache.tools.ant.types.Environment.Variable createSysProperty(String key,
                                                                               URI value)

Convenience method to create an Ant environment variable that contains a string from an URI.

Note that URI.getPath() will be used.

Parameters:
key - The key or name of the variable
value - The URI to take the value from; URI.getPath() will be used
Returns:
The created environment variable

createProject

public org.apache.tools.ant.Project createProject()
Returns:
a default empty Ant Project

addTokenToFilterChain

public void addTokenToFilterChain(org.apache.tools.ant.types.FilterChain filterChain,
                                  String key,
                                  String value)
Add a token to an existing filter chain.

Parameters:
filterChain - the filter chain to augment
key - the token key
value - the token value

addTokensToFilterChain

public void addTokensToFilterChain(org.apache.tools.ant.types.FilterChain filterChain,
                                   Map map)
Add the map of tokens to the filterChain.

Parameters:
filterChain - The filterchain to use
map - The map


Copyright © 2004-2012 Codehaus. All Rights Reserved.