Class XsltTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.implab.gradle.xslt.tasks.XsltTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

@DisableCachingByDefault(because="XSLT transformations may resolve external resources not declared as task inputs.") public abstract class XsltTask extends org.gradle.api.DefaultTask
The task for applying an XSLT transformation. This task applies a single transformation to a single document and produces a single result.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
    XsltTask(org.gradle.api.model.ObjectFactory objects)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    fragment(groovy.lang.Closure<?> configure)
    Creates an XML document fragment.
    abstract org.gradle.api.file.ConfigurableFileCollection
     
    abstract org.gradle.api.provider.Property<Integer>
     
    abstract org.gradle.api.file.RegularFileProperty
     
    org.gradle.api.provider.Provider<Map<String,XsltParameter>>
     
    abstract org.gradle.api.file.RegularFileProperty
     
    abstract org.gradle.api.file.RegularFileProperty
     
    org.apache.xpath.NodeSet
    nodeSet(groovy.lang.Closure<?> configure)
    Creates a nodeset.
    void
    parameters(groovy.lang.Closure<?> configure)
    Conventional method, applies closure to the transformation parameters.
    void
    parameters(Map<String,?> parameters)
    Adds transformation parameters from a map.
    void
    parameters(org.gradle.api.Action<? super Map<String,Object>> configure)
    Applies action to a temporary parameter map and adds collected values to transformation parameters.
    void
    run()
     

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Constructor Details

    • XsltTask

      @Inject public XsltTask(org.gradle.api.model.ObjectFactory objects)
  • Method Details

    • getStylesheet

      @InputFile @PathSensitive(RELATIVE) public abstract org.gradle.api.file.RegularFileProperty getStylesheet()
    • getSource

      @InputFile @PathSensitive(RELATIVE) public abstract org.gradle.api.file.RegularFileProperty getSource()
    • getIncludes

      @InputFiles @Optional @PathSensitive(RELATIVE) public abstract org.gradle.api.file.ConfigurableFileCollection getIncludes()
    • getOutput

      @OutputFile public abstract org.gradle.api.file.RegularFileProperty getOutput()
    • getParameters

      @Input public org.gradle.api.provider.Provider<Map<String,XsltParameter>> getParameters()
    • parameters

      public void parameters(groovy.lang.Closure<?> configure)
      Conventional method, applies closure to the transformation parameters.

      The delegate for this closure is the map of values where the keys are the names of the parameters. Values could be either:

      • simple values,
      • nodes, nodeSets (nodeSet(Closure)),
      • providers which supply simple values.
      Parameters:
      configure - A closure for configuration of transformation parameters
    • parameters

      public void parameters(Map<String,?> parameters)
      Adds transformation parameters from a map.
      Parameters:
      parameters - The map of transformation parameters
    • parameters

      public void parameters(org.gradle.api.Action<? super Map<String,Object>> configure)
      Applies action to a temporary parameter map and adds collected values to transformation parameters.
      Parameters:
      configure - An action for configuration of transformation parameters
    • nodeSet

      public org.apache.xpath.NodeSet nodeSet(groovy.lang.Closure<?> configure)
      Creates a nodeset. Can be used to construct a transformation parameter.
      Parameters:
      configure - A closure with inner nodes for this nodeSet.
    • fragment

      public Object fragment(groovy.lang.Closure<?> configure)
      Creates an XML document fragment. Can be used to construct a transformation parameter when the stylesheet expects a single fragment instead of a node set.
      Parameters:
      configure - A closure with inner nodes for this fragment.
    • getIndent

      @Input @Optional public abstract org.gradle.api.provider.Property<Integer> getIndent()
    • run

      public void run() throws IOException, TransformerException
      Throws:
      IOException
      TransformerException