public class DVSLTask
extends org.apache.tools.ant.taskdefs.MatchingTask
Of these arguments, the sourcedir and destdir are required, or, in and out are required.
Following are the supported nested elements:
This task will recursively scan the sourcedir and destdir looking for XML documents to process via DVSL.
This task was adapted from Ant's <style> task (XSLTProcess class) from the 1.4.1 release.
| Modifier and Type | Class and Description |
|---|---|
class |
DVSLTask.Tool |
class |
DVSLTask.VelocityConfig |
| Modifier and Type | Field and Description |
|---|---|
private java.io.File |
baseDir |
private java.lang.ClassLoader |
classLoader |
private org.apache.tools.ant.types.Path |
classpath |
private java.io.File |
destDir |
private DVSL |
dvsl |
private boolean |
force |
private java.io.File |
inFile |
static java.lang.String |
INFILENAME
Supported app values
|
private java.io.File |
logFile |
private java.io.File |
outFile |
static java.lang.String |
OUTFILENAME |
private java.lang.String |
outputEncoding |
private java.io.File |
stylesheet |
private java.lang.String |
stylesheetEncoding |
private java.lang.String |
targetExtension |
private java.util.Vector |
toolAttr |
private java.io.File |
toolboxFile |
private java.util.Properties |
toolboxProps |
private boolean |
validatingParser |
private java.util.Vector |
velConfigAttr |
private java.lang.String |
velConfigClass |
private java.util.Map |
velConfigMap |
| Constructor and Description |
|---|
DVSLTask()
Creates a new DVSLTask Task.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.tools.ant.types.Path |
createClasspath()
Set the classpath to load the Processor through (nested element).
|
DVSLTask.Tool |
createTool()
support for <tool> nested element
|
DVSLTask.VelocityConfig |
createVelConfig()
support for <velconfig> nested element
|
private void |
ensureDirectoryFor(java.io.File targetFile) |
void |
execute()
Executes the task.
|
private void |
process(java.io.File inFile,
java.io.File outFile,
java.io.File stylesheet) |
private void |
process(java.io.File baseDir,
java.lang.String xmlFile,
java.io.File destDir,
java.io.File stylesheet)
Processes the given input XML file and stores the result
in the given resultFile.
|
void |
putAppValue(java.lang.String name,
java.lang.Object o)
Sets an application value from outside of the DVSL task
|
void |
setBasedir(java.io.File dir)
Set the base directory.
|
void |
setClasspath(org.apache.tools.ant.types.Path classpath)
Set the classpath to load the Processor through (attribute).
|
void |
setClasspathRef(org.apache.tools.ant.types.Reference r)
Set the classpath to load the Processor through via reference
(attribute).
|
void |
setDestdir(java.io.File dir)
Set the destination directory where the generated
files should be directed.
|
void |
setExtension(java.lang.String name)
Set the desired file extension to be used for the target files.
|
void |
setForce(boolean force)
Set whether to check dependencies, or always generate.
|
void |
setIn(java.io.File inFile)
Sets an input xml file to be styled
|
void |
setLogFile(java.io.File logFile)
Sets the file to use for logging.
|
void |
setOut(java.io.File outFile)
Sets an output file
|
void |
setOutputEncoding(java.lang.String encoding)
Sets the character encoding for output files.
|
void |
setStyle(java.io.File dvslFile)
Sets the file to use for stylesheet.
|
void |
setStyleEncoding(java.lang.String dvslFileEncoding)
Sets the encoding of stylesheet file.
|
void |
setToolbox(java.lang.String toolboxFile)
Deprecated.
use setToolboxFile instead
|
void |
setToolboxFile(java.io.File toolboxFile)
Sets the Toolbox properties file to use.
|
void |
setValidatingParser(boolean validating)
Sets the flag to have DVSL use a validating parser for the
input documents
|
void |
setVelocityConfigClass(java.lang.String classname)
Allows the user to specify a class that implements
Properties that will have user properties
to be used when setting up DVSL. |
private long |
transform(java.io.File inFile,
java.io.File outFile)
Does the actual transform
|
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, XsetItemsbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypepublic static final java.lang.String INFILENAME
public static final java.lang.String OUTFILENAME
private DVSL dvsl
private java.io.File destDir
private java.io.File baseDir
private java.io.File stylesheet
private java.lang.String stylesheetEncoding
private java.io.File inFile
private java.io.File outFile
private java.io.File logFile
private java.lang.String targetExtension
private java.lang.String outputEncoding
private org.apache.tools.ant.types.Path classpath
private java.lang.ClassLoader classLoader
private boolean force
private java.util.Vector toolAttr
private java.io.File toolboxFile
private java.util.Properties toolboxProps
private java.lang.String velConfigClass
private java.util.Map velConfigMap
private java.util.Vector velConfigAttr
private boolean validatingParser
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildExceptionpublic void setForce(boolean force)
force - false to check dependencies, true to always generatepublic void setBasedir(java.io.File dir)
dir - name of the base directorypublic void setDestdir(java.io.File dir)
dir - name of the destination directorypublic void setExtension(java.lang.String name)
.html" is used.name - the extension to usepublic void setStyle(java.io.File dvslFile)
dvslFile - stylesheet filenamepublic void setStyleEncoding(java.lang.String dvslFileEncoding)
dvslFileEncoding - encoding of stylesheet filepublic void setLogFile(java.io.File logFile)
logFile - logging filenamepublic void setToolbox(java.lang.String toolboxFile)
toolboxFile - properties file of toolspublic void setToolboxFile(java.io.File toolboxFile)
toolboxFile - properties file of toolspublic void setVelocityConfigClass(java.lang.String classname)
Properties that will have user properties
to be used when setting up DVSL.classname - Velocity configuration class to loadpublic void setOut(java.io.File outFile)
outFile - output filepublic void setIn(java.io.File inFile)
inFile - input filepublic void setOutputEncoding(java.lang.String encoding)
encoding - Output encodingpublic void setClasspath(org.apache.tools.ant.types.Path classpath)
classpath - classpath to setpublic org.apache.tools.ant.types.Path createClasspath()
public void setClasspathRef(org.apache.tools.ant.types.Reference r)
r - reference to classpathpublic void setValidatingParser(boolean validating)
public void putAppValue(java.lang.String name,
java.lang.Object o)
private void process(java.io.File baseDir,
java.lang.String xmlFile,
java.io.File destDir,
java.io.File stylesheet)
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildExceptionprivate void process(java.io.File inFile,
java.io.File outFile,
java.io.File stylesheet)
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildExceptionprivate long transform(java.io.File inFile,
java.io.File outFile)
throws java.lang.Exception
Does the actual transform
inFile - XML document sourceoutFile - File for transformed inputjava.lang.Exceptionprivate void ensureDirectoryFor(java.io.File targetFile)
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildExceptionpublic DVSLTask.Tool createTool()
public DVSLTask.VelocityConfig createVelConfig()
Copyright (c) 2001-2007 Apache Software Foundation