xdoclet.ant
Class ReplaceCopy

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.Copy
                    |
                    +--xdoclet.ant.ReplaceCopy

public class ReplaceCopy
extends org.apache.tools.ant.taskdefs.Copy

Extension of Ant's Copy task that uses XDoclet's template engine to copy instead of Ant's plain copy. It will scan each file for occurrences of and replace them with the associated Ant property value.
This is similar to using the standard Ant built-in task with a nested element, but this task uses a pull mechanism (ant properties are pulled from the ant environment by the copied files) instead of a push mechanism (where Ant pushes explicit values into the copied files).

Version:
$Revision: 1.5 $
Author:
Aslak Hellesøy

Fields inherited from class org.apache.tools.ant.taskdefs.Copy
destDir, destFile, dirCopyMap, file, fileCopyMap, filesets, filtering, flatten, forceOverwrite, includeEmpty, mapperElement, preserveLastModified, verbosity
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
ReplaceCopy()
           
 
Method Summary
protected  void doFileOperations()
          Overridden doFileOperations() as Ant suggests.
 
Methods inherited from class org.apache.tools.ant.taskdefs.Copy
addFileset, buildMap, createFilterSet, createMapper, execute, getFileUtils, getFilterSets, scan, setFile, setFiltering, setFlatten, setIncludeEmptyDirs, setOverwrite, setPreserveLastModified, setTodir, setTofile, setVerbose, validateAttributes
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplaceCopy

public ReplaceCopy()
Method Detail

doFileOperations

protected void doFileOperations()
Overridden doFileOperations() as Ant suggests. It would be less copy-paste if fileUtils.copyFile in the superclass' method used getFileUtils().copyFile instead. Then we could just override getFileUtils() and return a FileUtils subclass which used XDoclet template engine. Until Ant fixes this, we'll do inheritance by copy/paste :-(
Overrides:
doFileOperations in class org.apache.tools.ant.taskdefs.Copy