Class SchematronSelExtractTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
name.jurgenei.gradle.xml.SchematronSelExtractTask
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>
Direct Known Subclasses:
ShaclSelExtractTask

@DisableCachingByDefault(because="Extraction output fan-out depends on source trees and dynamic grouped mappings") public abstract class SchematronSelExtractTask extends org.gradle.api.DefaultTask
Phase-3 runtime task that executes Schematron SEL extraction.

The task can consume a precompiled extraction stylesheet or compile one on the fly from annotation-bearing Schematron rules.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    JSON routing mode for .json SEL input files.

    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
    Creates extraction task with fail-fast behavior enabled by default.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Runs SEL extraction for all configured source files.
    abstract org.gradle.api.provider.Property<Boolean>
    Controls build failure behavior when extraction errors occur.
    abstract org.gradle.api.provider.MapProperty<String,String>
    Group-to-relative-path mapping for emitted SEL documents.
    abstract org.gradle.api.provider.Property<String>
    Optional JSON mode controlling how .json input is parsed.
    org.gradle.api.provider.Property<String>
    Backward-compatible alias for getOutputMode().
    abstract org.gradle.api.file.DirectoryProperty
    Output directory root for grouped extraction documents.
    org.gradle.api.provider.Property<String>
    Canonical output-format alias for getXirFormat().
    org.gradle.api.provider.Property<String>
    Canonical output-mode alias for getJsonMode().
    abstract org.gradle.api.provider.Property<String>
    Optional SEL output namespace prefix override for generated extraction output.
    abstract org.gradle.api.provider.Property<String>
    Optional SEL output namespace URI override for generated extraction output.
    abstract org.gradle.api.provider.Property<String>
    Active Schematron phase used for on-the-fly SEL compilation.
    abstract org.gradle.api.file.RegularFileProperty
    Schematron schema containing SEL rule metadata.
    abstract org.gradle.api.file.ConfigurableFileCollection
    Canonical sources used for extraction.
    abstract org.gradle.api.file.RegularFileProperty
    Optional precompiled extraction stylesheet.
    org.gradle.api.provider.Property<String>
    Backward-compatible alias for getOutputFormat().
    abstract org.gradle.api.provider.Property<String>
    Optional XIR output format used when emitting .xir group outputs.
    void
    groupOutput(String group, String relativePath)
    Configures output path mapping for a logical group.
    void
    Sets JSON routing mode (Gradle DSL friendly).
    void
    mode(String mode)
    Backward-compatible alias for outputMode(String).
    void
    Sets S-expression output format using canonical DSL name.
    void
    Sets JSON routing mode using canonical DSL name.
    void
    Sets SEL output namespace prefix override.
    void
    Sets SEL output namespace URI override.
    void
    phase(String value)
    Sets Schematron phase used by on-the-fly SEL compilation.
    void
    schema(Object path)
    Sets Schematron schema file.
    void
    Groovy/Kotlin assignment-style alias for mode(String).
    void
    Groovy/Kotlin assignment-style alias for outputFormat(String).
    void
    Groovy/Kotlin assignment-style alias for outputMode(String).
    void
    Groovy/Kotlin assignment-style alias for xformat(String).
    void
    source(Object source)
    Adds input source(s) using Gradle file notation.
    void
    source(Object sourceDir, org.gradle.api.Action<? super org.gradle.api.tasks.util.PatternFilterable> action)
    Adds source file tree include/exclude configuration.
    void
    style(Object path)
    Sets precompiled extraction stylesheet file.
    void
    xformat(String format)
    Backward-compatible alias for outputFormat(String).
    void
    xirFormat(String format)
    Sets S-expression output format for .xir group outputs (Gradle DSL friendly).

    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, getLoggingManager, 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

    • SchematronSelExtractTask

      @Inject public SchematronSelExtractTask()
      Creates extraction task with fail-fast behavior enabled by default.
  • Method Details

    • getSchema

      @InputFile @PathSensitive(RELATIVE) public abstract org.gradle.api.file.RegularFileProperty getSchema()
      Schematron schema containing SEL rule metadata.
      Returns:
      schema file property
    • getStyle

      @Optional @InputFile @PathSensitive(RELATIVE) public abstract org.gradle.api.file.RegularFileProperty getStyle()
      Optional precompiled extraction stylesheet.
      Returns:
      stylesheet property
    • getSourceFiles

      @InputFiles @PathSensitive(RELATIVE) public abstract org.gradle.api.file.ConfigurableFileCollection getSourceFiles()
      Canonical sources used for extraction.
      Returns:
      source file collection
    • getOutputDir

      @OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getOutputDir()
      Output directory root for grouped extraction documents.
      Returns:
      output directory property
    • getGroupOutputs

      @Input public abstract org.gradle.api.provider.MapProperty<String,String> getGroupOutputs()
      Group-to-relative-path mapping for emitted SEL documents.
      Returns:
      group output mapping
    • getOutputNamespaceUri

      @Input @Optional public abstract org.gradle.api.provider.Property<String> getOutputNamespaceUri()
      Optional SEL output namespace URI override for generated extraction output.

      When set, overrides schema-level SEL output namespace defaults.

      Returns:
      optional namespace URI
    • getOutputNamespacePrefix

      @Input @Optional public abstract org.gradle.api.provider.Property<String> getOutputNamespacePrefix()
      Optional SEL output namespace prefix override for generated extraction output.

      Use empty string to emit SEL elements in default namespace.

      Returns:
      optional namespace prefix
    • getFailOnError

      @Input public abstract org.gradle.api.provider.Property<Boolean> getFailOnError()
      Controls build failure behavior when extraction errors occur.
      Returns:
      fail-on-error property
    • getJsonMode

      @Input @Optional public abstract org.gradle.api.provider.Property<String> getJsonMode()
      Optional JSON mode controlling how .json input is parsed.
      Returns:
      JSON mode property: auto, native, canonical
    • getOutputMode

      @Internal public org.gradle.api.provider.Property<String> getOutputMode()
      Canonical output-mode alias for getJsonMode().
      Returns:
      JSON routing mode property
    • getMode

      @Internal public org.gradle.api.provider.Property<String> getMode()
      Backward-compatible alias for getOutputMode().
      Returns:
      JSON routing mode property
    • getXirFormat

      @Input @Optional public abstract org.gradle.api.provider.Property<String> getXirFormat()
      Optional XIR output format used when emitting .xir group outputs.

      Supported values are compact (default) and beautified.

      Returns:
      XIR serializer output format property
    • getOutputFormat

      @Internal public org.gradle.api.provider.Property<String> getOutputFormat()
      Canonical output-format alias for getXirFormat().
      Returns:
      XIR serializer output format property
    • getXformat

      @Internal public org.gradle.api.provider.Property<String> getXformat()
      Backward-compatible alias for getOutputFormat().
      Returns:
      XIR serializer output format property
    • getPhase

      @Input @Optional public abstract org.gradle.api.provider.Property<String> getPhase()
      Active Schematron phase used for on-the-fly SEL compilation.

      Supported values:

      • #DEFAULT (default) — uses sch:schema/@defaultPhase, else all rules.
      • #ALL — includes all SEL-annotated rules.
      • explicit phase id — includes patterns activated by that phase.

      When getStyle() is configured, phase filtering is expected to be applied at compile time of that precompiled stylesheet and this property is ignored by extraction runtime.

      Returns:
      optional phase selector
    • schema

      public void schema(Object path)
      Sets Schematron schema file.
      Parameters:
      path - file notation accepted by Project.file.
    • style

      public void style(Object path)
      Sets precompiled extraction stylesheet file.
      Parameters:
      path - file notation accepted by Project.file.
    • source

      public void source(Object source)
      Adds input source(s) using Gradle file notation.
      Parameters:
      source - file, directory, fileTree, or collection.
    • source

      public void source(Object sourceDir, org.gradle.api.Action<? super org.gradle.api.tasks.util.PatternFilterable> action)
      Adds source file tree include/exclude configuration.
      Parameters:
      sourceDir - root directory.
      action - include/exclude action.
    • groupOutput

      public void groupOutput(String group, String relativePath)
      Configures output path mapping for a logical group.
      Parameters:
      group - SEL group key.
      relativePath - output path under each input-stem root.
    • outputNamespaceUri

      public void outputNamespaceUri(String value)
      Sets SEL output namespace URI override.
      Parameters:
      value - namespace URI
    • outputNamespacePrefix

      public void outputNamespacePrefix(String value)
      Sets SEL output namespace prefix override.
      Parameters:
      value - prefix (empty string for default namespace output)
    • jsonMode

      public void jsonMode(String mode)
      Sets JSON routing mode (Gradle DSL friendly).
      Parameters:
      mode - one of auto, native, canonical
    • outputMode

      public void outputMode(String mode)
      Sets JSON routing mode using canonical DSL name.
      Parameters:
      mode - one of auto, native, canonical
    • setOutputMode

      public void setOutputMode(String mode)
      Groovy/Kotlin assignment-style alias for outputMode(String).
      Parameters:
      mode - one of auto, native, canonical
    • mode

      public void mode(String mode)
      Backward-compatible alias for outputMode(String).
      Parameters:
      mode - one of auto, native, canonical
    • setMode

      public void setMode(String mode)
      Groovy/Kotlin assignment-style alias for mode(String).
      Parameters:
      mode - one of auto, native, canonical
    • xirFormat

      public void xirFormat(String format)
      Sets S-expression output format for .xir group outputs (Gradle DSL friendly).
      Parameters:
      format - one of compact, beautified
    • outputFormat

      public void outputFormat(String format)
      Sets S-expression output format using canonical DSL name.
      Parameters:
      format - one of compact, beautified
    • setOutputFormat

      public void setOutputFormat(String format)
      Groovy/Kotlin assignment-style alias for outputFormat(String).
      Parameters:
      format - one of compact, beautified
    • xformat

      public void xformat(String format)
      Backward-compatible alias for outputFormat(String).
      Parameters:
      format - one of compact, beautified
    • setXformat

      public void setXformat(String format)
      Groovy/Kotlin assignment-style alias for xformat(String).
      Parameters:
      format - one of compact, beautified
    • phase

      public void phase(String value)
      Sets Schematron phase used by on-the-fly SEL compilation.
      Parameters:
      value - phase id, #DEFAULT, or #ALL
    • extract

      public void extract()
      Runs SEL extraction for all configured source files.