org.codehaus.groovy.wiki
Class Wiki2Markup

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.apache.tools.ant.taskdefs.MatchingTask
              extended byorg.codehaus.groovy.wiki.Wiki2Markup
All Implemented Interfaces:
org.apache.tools.ant.types.selectors.SelectorContainer
Direct Known Subclasses:
Wiki2TestCase

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

Converts the Wiki markup into XML/HTML so that it can be styled by the Maven build

Version:
$Revision: 1.3 $
Author:
James Strachan

Field Summary
protected  File[] compileList
           
protected  boolean failOnError
           
protected  boolean listFiles
           
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
 
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
Wiki2Markup()
           
 
Method Summary
protected  void checkParameters()
           
protected  void compile()
           
protected  void compile(File file, String name)
           
 void compileFiles(String[] args)
           
protected  org.radeox.api.engine.RenderEngine createRenderEngine()
           
 org.apache.tools.ant.types.Path createSrc()
          Adds a path for source compilation.
 void execute()
          Executes the task.
protected  String filter(String result)
           
 File getDestdir()
          Gets the destination directory into which the java source files should be compiled.
protected  String getExtension()
           
 boolean getFailonerror()
          Gets the failonerror flag.
 File[] getFileList()
          Gets the list of files to be compiled.
 boolean getListfiles()
          Get the listfiles flag.
 org.apache.tools.ant.types.Path getSrcdir()
          Gets the source dirs to find the source java files.
static void main(String[] args)
           
protected  String readFile(File file)
           
protected  org.apache.tools.ant.types.Path recreateSrc()
          Recreate src.
protected  void resetFileLists()
          Clear the list of files to be compiled and copied..
protected  void scanDir(File srcDir, File destDir, String[] files)
          Scans the directory looking for source files to be compiled.
 void setDestdir(File destDir)
          Set the destination directory into which the Java source files should be compiled.
 void setFailonerror(boolean fail)
          Indicates whether the build will continue even if there are compilation errors; defaults to true.
 void setListfiles(boolean list)
          If true, list the source files being handed off to the compiler.
 void setProceed(boolean proceed)
           
 void setSrcdir(org.apache.tools.ant.types.Path srcDir)
          Set the source directories to find the source Java files.
 
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
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

failOnError

protected boolean failOnError

listFiles

protected boolean listFiles

compileList

protected File[] compileList
Constructor Detail

Wiki2Markup

public Wiki2Markup()
Method Detail

main

public static void main(String[] args)

createSrc

public org.apache.tools.ant.types.Path createSrc()
Adds a path for source compilation.

Returns:
a nested src element.

recreateSrc

protected org.apache.tools.ant.types.Path recreateSrc()
Recreate src.

Returns:
a nested src element.

setSrcdir

public void setSrcdir(org.apache.tools.ant.types.Path srcDir)
Set the source directories to find the source Java files.

Parameters:
srcDir - the source directories as a path

getSrcdir

public org.apache.tools.ant.types.Path getSrcdir()
Gets the source dirs to find the source java files.

Returns:
the source directorys as a path

setDestdir

public void setDestdir(File destDir)
Set the destination directory into which the Java source files should be compiled.

Parameters:
destDir - the destination director

getDestdir

public File getDestdir()
Gets the destination directory into which the java source files should be compiled.

Returns:
the destination directory

setListfiles

public void setListfiles(boolean list)
If true, list the source files being handed off to the compiler.

Parameters:
list - if true list the source files

getListfiles

public boolean getListfiles()
Get the listfiles flag.

Returns:
the listfiles flag

setFailonerror

public void setFailonerror(boolean fail)
Indicates whether the build will continue even if there are compilation errors; defaults to true.

Parameters:
fail - if true halt the build on failure

setProceed

public void setProceed(boolean proceed)
Parameters:
proceed - inverse of failoferror

getFailonerror

public boolean getFailonerror()
Gets the failonerror flag.

Returns:
the failonerror flag

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Executes the task.

Throws:
org.apache.tools.ant.BuildException - if an error occurs

resetFileLists

protected void resetFileLists()
Clear the list of files to be compiled and copied..


scanDir

protected void scanDir(File srcDir,
                       File destDir,
                       String[] files)
Scans the directory looking for source files to be compiled. The results are returned in the class variable compileList

Parameters:
srcDir - The source directory
destDir - The destination directory
files - An array of filenames

getFileList

public File[] getFileList()
Gets the list of files to be compiled.

Returns:
the list of files as an array

checkParameters

protected void checkParameters()
                        throws org.apache.tools.ant.BuildException
Throws:
org.apache.tools.ant.BuildException

compileFiles

public void compileFiles(String[] args)
                  throws IOException
Throws:
IOException

compile

protected void compile()

compile

protected void compile(File file,
                       String name)
                throws IOException
Throws:
IOException

filter

protected String filter(String result)

readFile

protected String readFile(File file)
                   throws IOException
Throws:
IOException

createRenderEngine

protected org.radeox.api.engine.RenderEngine createRenderEngine()

getExtension

protected String getExtension()


Copyright © 2003-2005 The Codehaus. All Rights Reserved.