org.springframework.beandoc.client
Class AntTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.tools.ant.taskdefs.MatchingTask
              extended by org.springframework.beandoc.client.AntTask
All Implemented Interfaces:
Cloneable, org.apache.tools.ant.types.selectors.SelectorContainer

public class AntTask
extends org.apache.tools.ant.taskdefs.MatchingTask

Ant task that sets up and runs the beandoc tool based on a properties file containing all configuration options. It's not possible to allow all options to be specified on the Ant task as setters (attributes) since beandoc is extensible and any number of custom decorators or transformers could be added to the core setup, all with their own properties.

This class is a very thin wrapper that accepts the mandatory beandoc options as task attributes and boots the default context via a SpringLoader.

Since:
1.0
Author:
Darren Davison

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
AntTask()
           
 
Method Summary
 void addFileset(org.apache.tools.ant.types.FileSet fileset)
          Specify a set of files to be used as the target for the BeanDoc task.
 void execute()
          Load and run the default beandoc processor wrapping any Exception as an Ant BuildException.
 void setBeandocContext(String context)
          Power users may wish to completely customise beandoc setup through a different context definition file.
 void setBeandocProps(File beandocProps)
          Specify the location of the required properties file used to configure the beandoc tool.
 void setBeandocPropsPrefix(String beandocPropsPrefix)
          Specify a prefix for relevant properties.
 void setInputFiles(String inputFiles)
          Deprecated. use one or more nested FileSet's instead.
 void setOutputDir(File outputDir)
          Overrides any System or beandoc property to provide a direct value for output directory for the beandoc tool.
 void setTitle(String title)
          Define a title to be used in the output documentation (principally the HTML)
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

AntTask

public AntTask()
Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Load and run the default beandoc processor wrapping any Exception as an Ant BuildException.

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException
See Also:
Task.execute()

addFileset

public void addFileset(org.apache.tools.ant.types.FileSet fileset)
Specify a set of files to be used as the target for the BeanDoc task.

Parameters:
fileset - a set of files to add as one or more input files

setInputFiles

public void setInputFiles(String inputFiles)
Deprecated. use one or more nested FileSet's instead.

Overrides any System or beandoc property to provide a direct value for input files for the beandoc tool.

Parameters:
inputFiles - a String representing one or more (comma separated or wildcarded) Resources that will be used as input files.

setOutputDir

public void setOutputDir(File outputDir)
Overrides any System or beandoc property to provide a direct value for output directory for the beandoc tool.

Parameters:
outputDir - a directory (which must be writeable for the current user) where beandoc will store its output.

setTitle

public void setTitle(String title)
Define a title to be used in the output documentation (principally the HTML)

Parameters:
title - the title you wish to see in HTML <title> tags and headers.

setBeandocProps

public void setBeandocProps(File beandocProps)
Specify the location of the required properties file used to configure the beandoc tool. The task will fail if this isn't set to the location of a valid properties file.

Parameters:
beandocProps - the location of the Properties file to be used to configure the beandoc tool

setBeandocPropsPrefix

public void setBeandocPropsPrefix(String beandocPropsPrefix)
Specify a prefix for relevant properties. Properties without the prefix are ignored; from matching properties the prefix is removed.

Parameters:
beandocPropsPrefix - prefix for relevant properties
See Also:
setBeandocProps(File)

setBeandocContext

public void setBeandocContext(String context)
Power users may wish to completely customise beandoc setup through a different context definition file. Specify the location here.

Parameters:
context - location of the custom context file to use


Copyright © 2004-2009 Spring BeanDoc. All Rights Reserved.