Package name.jurgenei.gradle.xml
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 ClassesModifier and TypeClassDescriptionstatic enumJSON 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
ConstructorsConstructorDescriptionCreates extraction task with fail-fast behavior enabled by default. -
Method Summary
Modifier and TypeMethodDescriptionvoidextract()Runs SEL extraction for all configured source files.abstract org.gradle.api.provider.Property<Boolean> Controls build failure behavior when extraction errors occur.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> getMode()Backward-compatible alias forgetOutputMode().abstract org.gradle.api.file.DirectoryPropertyOutput directory root for grouped extraction documents.org.gradle.api.provider.Property<String> Canonical output-format alias forgetXirFormat().org.gradle.api.provider.Property<String> Canonical output-mode alias forgetJsonMode().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> getPhase()Active Schematron phase used for on-the-fly SEL compilation.abstract org.gradle.api.file.RegularFilePropertySchematron schema containing SEL rule metadata.abstract org.gradle.api.file.ConfigurableFileCollectionCanonical sources used for extraction.abstract org.gradle.api.file.RegularFilePropertygetStyle()Optional precompiled extraction stylesheet.org.gradle.api.provider.Property<String> Backward-compatible alias forgetOutputFormat().abstract org.gradle.api.provider.Property<String> Optional XIR output format used when emitting.xirgroup outputs.voidgroupOutput(String group, String relativePath) Configures output path mapping for a logical group.voidSets JSON routing mode (Gradle DSL friendly).voidBackward-compatible alias foroutputMode(String).voidoutputFormat(String format) Sets S-expression output format using canonical DSL name.voidoutputMode(String mode) Sets JSON routing mode using canonical DSL name.voidoutputNamespacePrefix(String value) Sets SEL output namespace prefix override.voidoutputNamespaceUri(String value) Sets SEL output namespace URI override.voidSets Schematron phase used by on-the-fly SEL compilation.voidSets Schematron schema file.voidGroovy/Kotlin assignment-style alias formode(String).voidsetOutputFormat(String format) Groovy/Kotlin assignment-style alias foroutputFormat(String).voidsetOutputMode(String mode) Groovy/Kotlin assignment-style alias foroutputMode(String).voidsetXformat(String format) Groovy/Kotlin assignment-style alias forxformat(String).voidAdds input source(s) using Gradle file notation.voidsource(Object sourceDir, org.gradle.api.Action<? super org.gradle.api.tasks.util.PatternFilterable> action) Adds source file tree include/exclude configuration.voidSets precompiled extraction stylesheet file.voidBackward-compatible alias foroutputFormat(String).voidSets S-expression output format for.xirgroup 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, usesServiceMethods 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, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
Group-to-relative-path mapping for emitted SEL documents.- Returns:
- group output mapping
-
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
Controls build failure behavior when extraction errors occur.- Returns:
- fail-on-error property
-
getJsonMode
Optional JSON mode controlling how .json input is parsed.- Returns:
- JSON mode property: auto, native, canonical
-
getOutputMode
Canonical output-mode alias forgetJsonMode().- Returns:
- JSON routing mode property
-
getMode
Backward-compatible alias forgetOutputMode().- Returns:
- JSON routing mode property
-
getXirFormat
Optional XIR output format used when emitting.xirgroup outputs.Supported values are
compact(default) andbeautified.- Returns:
- XIR serializer output format property
-
getOutputFormat
Canonical output-format alias forgetXirFormat().- Returns:
- XIR serializer output format property
-
getXformat
Backward-compatible alias forgetOutputFormat().- Returns:
- XIR serializer output format property
-
getPhase
Active Schematron phase used for on-the-fly SEL compilation.Supported values:
#DEFAULT(default) — usessch: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
Sets Schematron schema file.- Parameters:
path- file notation accepted byProject.file.
-
style
Sets precompiled extraction stylesheet file.- Parameters:
path- file notation accepted byProject.file.
-
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
Configures output path mapping for a logical group.- Parameters:
group- SEL group key.relativePath- output path under each input-stem root.
-
outputNamespaceUri
Sets SEL output namespace URI override.- Parameters:
value- namespace URI
-
outputNamespacePrefix
Sets SEL output namespace prefix override.- Parameters:
value- prefix (empty string for default namespace output)
-
jsonMode
Sets JSON routing mode (Gradle DSL friendly).- Parameters:
mode- one of auto, native, canonical
-
outputMode
Sets JSON routing mode using canonical DSL name.- Parameters:
mode- one of auto, native, canonical
-
setOutputMode
Groovy/Kotlin assignment-style alias foroutputMode(String).- Parameters:
mode- one of auto, native, canonical
-
mode
Backward-compatible alias foroutputMode(String).- Parameters:
mode- one of auto, native, canonical
-
setMode
Groovy/Kotlin assignment-style alias formode(String).- Parameters:
mode- one of auto, native, canonical
-
xirFormat
Sets S-expression output format for.xirgroup outputs (Gradle DSL friendly).- Parameters:
format- one of compact, beautified
-
outputFormat
Sets S-expression output format using canonical DSL name.- Parameters:
format- one of compact, beautified
-
setOutputFormat
Groovy/Kotlin assignment-style alias foroutputFormat(String).- Parameters:
format- one of compact, beautified
-
xformat
Backward-compatible alias foroutputFormat(String).- Parameters:
format- one of compact, beautified
-
setXformat
Groovy/Kotlin assignment-style alias forxformat(String).- Parameters:
format- one of compact, beautified
-
phase
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.
-