net.sf.jasperreports.ant
Class JRAntDecompileTask

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

public class JRAntDecompileTask
extends MatchingTask

Ant task for batch-generating the source JRXML report design files, from compiled report template 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 compiled report template files and it will recreate the source JRXML file for each of them. This task makes its file creation decision based on timestamp and only input files that have no corresponding file in the target directory or where the destination JRXML file is older than the input file will be processed.

Version:
$Id: JRAntCompileTask.java 1606 2007-02-28 08:21:12Z lucianc $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Constructor Summary
JRAntDecompileTask()
           
 
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 decompilation source.
protected  void decompile()
          Performs the decompilation of the selected report design files.
 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 decompiled.
protected  void scanSrc()
          Scans the source directories looking for source files to be decompiled.
 void setDestdir(java.io.File destdir)
          Sets the destination directory into which the report design files should be decompilated.
 void setSrcdir(Path srcdir)
          Sets the source directories to find the compiled report design files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRAntDecompileTask

public JRAntDecompileTask()
Method Detail

setSrcdir

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

Parameters:
srcdir - source path

createSrc

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

Returns:
source path

setDestdir

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

Parameters:
destdir - destination directory

createClasspath

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

Returns:
classpath to use when decompiling the report

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 decompiled.

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 decompiled. The results are returned in the instance variable reportFilesMap.

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

decompile

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

Throws:
BuildException


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com