|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.tools.ant.Task org.w3c.tidy.ant.JTidyTask
public class JTidyTask
JTidy ant task.
Attribute | Description | Required |
---|---|---|
srcfile | source file | Yes, unless a nested <fileset> element is used. |
destfile | destination file for output | With the srcfile attribute, either destfile or destdir
can be used. With nested <fileset> elements only destdir is allowed. |
destdir | destination directory for output | |
properties | Path to a valid tidy properties file | No |
flatten | Ignore the directory structure of the source files, and copy all files into the directory specified by the
destdir attribute. |
No; defaults to false. |
failonerror | boolean to control whether failure to execute should throw a BuildException or just print an error. If set to
true errors in input files which tidy is enable to fix will cause a failure. |
No; defaults to false. |
parameter
element.
Adds the following typedef
to setup the JTidy task in your build.xml:
<taskdef name="tidy" classname="org.w3c.tidy.ant.JTidyTask"/>
This will work if JTidy jar is copied to ant lib directory. If you need to reference the jar elsewhere on the filesystem you can add a nested classpath element:
<taskdef name="tidy" classname="org.w3c.tidy.ant.JTidyTask"> <classpath> <pathelement location="${lib.dir}/jtidy.jar"/> </classpath> </taskdef>
<tidy destdir="out" properties="/path/to/tidy.properties"> <fileset dir="inputdir" /> <parameter name="drop-font-tags" value="true" /> </tidy>
Field Summary |
---|
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 | |
---|---|
JTidyTask()
|
Method Summary | |
---|---|
void |
addConfiguredParameter(org.apache.tools.ant.types.Parameter prop)
Setter method for any property using the ant type Parameter. |
void |
addFileset(org.apache.tools.ant.types.FileSet fileSet)
Adds a fileset to be processed Fileset |
void |
execute()
Run the task. |
protected void |
executeSet()
Run tidy on filesets. |
protected void |
executeSingle()
A single file has been specified. |
void |
init()
Initializes the task. |
protected void |
processFile(java.io.File inputFile,
java.io.File outputFile)
Run tidy on a file. |
void |
setDestdir(java.io.File destdir)
|
void |
setDestfile(java.io.File destfile)
|
void |
setFailonerror(boolean failonerror)
|
void |
setFlatten(boolean flatten)
|
void |
setProperties(java.io.File properties)
|
void |
setSrcfile(java.io.File srcfile)
|
protected void |
validateParameters()
Validates task parameters. |
Methods inherited from class org.apache.tools.ant.Task |
---|
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
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 |
---|
public JTidyTask()
Method Detail |
---|
public void setDestdir(java.io.File destdir)
destdir
- The destdir to set.public void setDestfile(java.io.File destfile)
destfile
- The destfile to set.public void setSrcfile(java.io.File srcfile)
srcfile
- The srcfile to set.public void setFailonerror(boolean failonerror)
failonerror
- The failonerror to set.public void setFlatten(boolean flatten)
flatten
- The flatten to set.public void setProperties(java.io.File properties)
properties
- The properties to set.public void addFileset(org.apache.tools.ant.types.FileSet fileSet)
fileSet
- public void addConfiguredParameter(org.apache.tools.ant.types.Parameter prop)
prop
- Ant type Parameterpublic void init()
init
in class org.apache.tools.ant.Task
protected void validateParameters() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
- if any invalid parameter is foundpublic void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- The exception raised during task execution.protected void executeSingle()
protected void executeSet()
protected void processFile(java.io.File inputFile, java.io.File outputFile)
inputFile
- input fileoutputFile
- output file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |