net.sf.jasperreports.ant
Class JRAntUpdateTask

java.lang.Object
  extended by MatchingTask
      extended by net.sf.jasperreports.ant.JRAntUpdateTask

public class JRAntUpdateTask
extends MatchingTask

Ant task for batch-updating JRXML report design files. Works like the built-in javac Ant task.

This task can take the following arguments:

Of these arguments, the src and destdir are required. When this task executes, it will recursively scan the src and destdir looking for JRXML report design files to update. This task makes its update decision based on timestamp and only JRXML files that have no corresponding file in the target directory or where the destination report design file is older than the source file will be updated.

Version:
$Id: JRAntUpdateTask.java 4595 2011-09-08 15:55:10Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Constructor Summary
JRAntUpdateTask()
           
 
Method Summary
protected  void checkParameters()
          Checks that all required attributes have been set and that the supplied values are valid.
 Path createClasspath()
          Adds a path to the classpath.
 Path createSrc()
          Adds a path for update source.
 UpdaterElement createUpdater()
          Adds an updater.
 void execute()
          Executes the task.
protected  void scanDir(java.io.File srcdir, java.io.File destdir, java.lang.String[] files)
          Scans the directory looking for source files to be updated.
protected  void scanSrc()
          Scans the source directories looking for source files to be updated.
 void setDestdir(java.io.File destdir)
          Sets the destination directory into which the XML report design files should be updated.
 void setSrcdir(Path srcdir)
          Sets the source directories to find the XML report design files.
 void setXmlvalidation(boolean xmlvalidation)
          Instructs the XML parser to validate the XML report design file during update.
protected  void update()
          Performs the update of the selected report design files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRAntUpdateTask

public JRAntUpdateTask()
Method Detail

setSrcdir

public void setSrcdir(Path srcdir)
Sets the source directories to find the XML report design files.

Parameters:
srcdir - source path

createSrc

public Path createSrc()
Adds a path for update source.

Returns:
source path

setDestdir

public void setDestdir(java.io.File destdir)
Sets the destination directory into which the XML report design files should be updated.

Parameters:
destdir - destination directory

createClasspath

public Path createClasspath()
Adds a path to the classpath.

Returns:
classpath to use when updating the report

setXmlvalidation

public void setXmlvalidation(boolean xmlvalidation)
Instructs the XML parser to validate the XML report design file during update.

Parameters:
xmlvalidation - flag for enabling/disabling the validation feature of the XML parser

createUpdater

public UpdaterElement createUpdater()
Adds an updater.


execute

public void execute()
             throws BuildException
Executes the task.

Throws:
BuildException

checkParameters

protected void checkParameters()
                        throws BuildException
Checks that all required attributes have been set and that the supplied values are valid.

Throws:
BuildException

scanSrc

protected void scanSrc()
                throws BuildException
Scans the source directories looking for source files to be updated.

Throws:
BuildException

scanDir

protected void scanDir(java.io.File srcdir,
                       java.io.File destdir,
                       java.lang.String[] files)
Scans the directory looking for source files to be updated. The results are returned in the instance variable reportFilesMap.

Parameters:
srcdir - source directory
destdir - destination directory
files - included file names

update

protected void update()
               throws BuildException
Performs the update of the selected report design files.

Throws:
BuildException


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com