org.osjava.jardiff.ant
Class JDXSLTProcess

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.apache.tools.ant.taskdefs.MatchingTask
              extended byorg.osjava.jardiff.ant.JDXSLTProcess
All Implemented Interfaces:
org.apache.tools.ant.types.selectors.SelectorContainer, org.apache.tools.ant.taskdefs.XSLTLogger

public class JDXSLTProcess
extends org.apache.tools.ant.taskdefs.MatchingTask
implements org.apache.tools.ant.taskdefs.XSLTLogger


Nested Class Summary
static class JDXSLTProcess.Factory
          The factory element to configure a transformer factory
static class JDXSLTProcess.OutputProperty
          Specify how the result tree should be output as specified in the specification.
static class JDXSLTProcess.Param
          The Param inner class used to store XSL parameters
 
Field Summary
 
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
JDXSLTProcess()
          Creates a new JDXSLTProcess Task.
 
Method Summary
 void addConfiguredXMLCatalog(org.apache.tools.ant.types.XMLCatalog xmlCatalog)
          Add the catalog to our internal catalog
 void addMapper(org.apache.tools.ant.types.Mapper mapper)
          Defines the mapper to map source to destination files.
protected  void configureLiaison(Object stylesheet)
          Loads the stylesheet and set xsl:param parameters.
 org.apache.tools.ant.types.Path createClasspath()
          Set the optional classpath to the XSL processor
 JDXSLTProcess.Factory createFactory()
          Create the factory element to configure a trax liaison.
 JDXSLTProcess.OutputProperty createOutputProperty()
          Create an instance of an output property to be configured.
 JDXSLTProcess.Param createParam()
          Create an instance of an XSL parameter for configuration by Ant.
 void execute()
          Executes the task.
 JDXSLTProcess.Factory getFactory()
          Get the factory instance configured for this processor
protected  org.apache.tools.ant.taskdefs.XSLTLiaison getLiaison()
          Get the Liason implementation to use in processing.
 Enumeration getOutputProperties()
           
 org.apache.tools.ant.types.XMLCatalog getXMLCatalog()
          Get the XML catalog containing entity definitions
 void init()
          Initialize internal instance of XMLCatalog
 void setBasedir(File dir)
          Set the base directory; optional, default is the project's basedir.
 void setClasspath(org.apache.tools.ant.types.Path classpath)
          Set the optional classpath to the XSL processor
 void setClasspathRef(org.apache.tools.ant.types.Reference r)
          Set the reference to an optional classpath to the XSL processor
 void setDestdir(File dir)
          Set the destination directory into which the XSL result files should be copied to; required, unless in and out are specified.
 void setExtension(String name)
          Set the desired file extension to be used for the target; optional, default is html.
 void setForce(boolean force)
          Set whether to check dependencies, or always generate; optional, default is false.
 void setIn(File inFile)
          specifies a single XML document to be styled.
 void setOut(File outFile)
          Specifies the output name for the styled result from the in attribute; required if in is set
 void setProcessor(String processor)
          Set the name of the XSL processor to use; optional, default trax.
 void setReloadStylesheet(boolean b)
          Controls whether the stylesheet is reloaded for every transform.
 void setScanIncludedDirectories(boolean b)
          Whether to style all files in the included directories as well; optional, default is true.
 void setStyle(String xslFile)
          Name of the stylesheet to use - given either relative to the project's basedir or as an absolute path; required.
 void setStyleurl(String styleurl)
          Set the stylesheet url.
 
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, 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
 
Methods inherited from interface org.apache.tools.ant.taskdefs.XSLTLogger
log
 

Constructor Detail

JDXSLTProcess

public JDXSLTProcess()
Creates a new JDXSLTProcess Task.

Since:
JarDiff 0.2
Method Detail

setScanIncludedDirectories

public void setScanIncludedDirectories(boolean b)
Whether to style all files in the included directories as well; optional, default is true.

Parameters:
b - true if files in included directories are processed.
Since:
Ant 1.5

setReloadStylesheet

public void setReloadStylesheet(boolean b)
Controls whether the stylesheet is reloaded for every transform.

Setting this to true may get around a bug in certain Xalan-J versions, default is false.

Since:
Ant 1.5.2

addMapper

public void addMapper(org.apache.tools.ant.types.Mapper mapper)
Defines the mapper to map source to destination files.

Throws:
org.apache.tools.ant.BuildException - if more than one mapper is defined
Since:
Ant 1.6.2

execute

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

Throws:
org.apache.tools.ant.BuildException - if there is an execution problem.

setForce

public void setForce(boolean force)
Set whether to check dependencies, or always generate; optional, default is false.

Parameters:
force - true if always generate.

setBasedir

public void setBasedir(File dir)
Set the base directory; optional, default is the project's basedir.

Parameters:
dir - the base directory

setDestdir

public void setDestdir(File dir)
Set the destination directory into which the XSL result files should be copied to; required, unless in and out are specified.

Parameters:
dir - the name of the destination directory

setExtension

public void setExtension(String name)
Set the desired file extension to be used for the target; optional, default is html.

Parameters:
name - the extension to use

setStyle

public void setStyle(String xslFile)
Name of the stylesheet to use - given either relative to the project's basedir or as an absolute path; required.

Parameters:
xslFile - the stylesheet to use

setClasspath

public void setClasspath(org.apache.tools.ant.types.Path classpath)
Set the optional classpath to the XSL processor

Parameters:
classpath - the classpath to use when loading the XSL processor

createClasspath

public org.apache.tools.ant.types.Path createClasspath()
Set the optional classpath to the XSL processor

Returns:
a path instance to be configured by the Ant core.

setClasspathRef

public void setClasspathRef(org.apache.tools.ant.types.Reference r)
Set the reference to an optional classpath to the XSL processor

Parameters:
r - the id of the Ant path instance to act as the classpath for loading the XSL processor

setProcessor

public void setProcessor(String processor)
Set the name of the XSL processor to use; optional, default trax. Other values are "xalan" for Xalan1 and "xslp" for XSL:P, though the later is strongly deprecated.

Parameters:
processor - the name of the XSL processor

setStyleurl

public void setStyleurl(String styleurl)
Set the stylesheet url.

Since:
JarDiff 0.2

addConfiguredXMLCatalog

public void addConfiguredXMLCatalog(org.apache.tools.ant.types.XMLCatalog xmlCatalog)
Add the catalog to our internal catalog

Parameters:
xmlCatalog - the XMLCatalog instance to use to look up DTDs

setOut

public void setOut(File outFile)
Specifies the output name for the styled result from the in attribute; required if in is set

Parameters:
outFile - the output File instance.

setIn

public void setIn(File inFile)
specifies a single XML document to be styled. Should be used with the out attribute; ; required if out is set

Parameters:
inFile - the input file

getFactory

public JDXSLTProcess.Factory getFactory()
Get the factory instance configured for this processor

Returns:
the factory instance in use

getXMLCatalog

public org.apache.tools.ant.types.XMLCatalog getXMLCatalog()
Get the XML catalog containing entity definitions

Returns:
the XML catalog for the task.

getOutputProperties

public Enumeration getOutputProperties()

getLiaison

protected org.apache.tools.ant.taskdefs.XSLTLiaison getLiaison()
Get the Liason implementation to use in processing.

Returns:
an instance of the XSLTLiason interface.

createParam

public JDXSLTProcess.Param createParam()
Create an instance of an XSL parameter for configuration by Ant.

Returns:
an instance of the Param class to be configured.

createOutputProperty

public JDXSLTProcess.OutputProperty createOutputProperty()
Create an instance of an output property to be configured.

Returns:
the newly created output property.
Since:
Ant 1.5

init

public void init()
          throws org.apache.tools.ant.BuildException
Initialize internal instance of XMLCatalog

Throws:
org.apache.tools.ant.BuildException

configureLiaison

protected void configureLiaison(Object stylesheet)
                         throws org.apache.tools.ant.BuildException
Loads the stylesheet and set xsl:param parameters.

Parameters:
stylesheet - the file form which to load the stylesheet.
Throws:
org.apache.tools.ant.BuildException - if the stylesheet cannot be loaded.

createFactory

public JDXSLTProcess.Factory createFactory()
                                    throws org.apache.tools.ant.BuildException
Create the factory element to configure a trax liaison.

Returns:
the newly created factory element.
Throws:
org.apache.tools.ant.BuildException - if the element is created more than one time.


Copyright © 2005-2006 OSJava. All Rights Reserved.