UseCasePlugin class

Manages use case generation for the domain layer.

Inheritance

Constructors

UseCasePlugin({required String outputDir, GeneratorOptions options = const GeneratorOptions()})

Properties

capabilities → List<ZuraffaCapability>
List of capabilities exposed by this plugin.
no setter
configKey → String?
The key in .zfa.json that enables this plugin by default (e.g., 'diByDefault').
no setterinherited
configSchema → JsonSchema
JSON Schema for this plugin's configuration.
no setter
customGenerator ↔ CustomUseCaseGenerator
latefinal
dependsOn → List<String>
List of plugin IDs that must run BEFORE this plugin.
no setterinherited
entityGenerator ↔ EntityUseCaseGenerator
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id → String
Unique identifier for the plugin (e.g., 'usecase', 'di').
no setter
name → String
Human-readable name of the plugin.
no setter
options → GeneratorOptions
final
osBackgroundGenerator ↔ OsBackgroundTaskGenerator
latefinal
outputDir → String
final
runAfter → List<String>
List of plugin IDs that this plugin should run AFTER, if they are present. (Like dependsOn, but doesn't force the other plugin to be active).
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
streamGenerator ↔ StreamUseCaseGenerator
latefinal
version → String
Semantic version of the plugin.
no setter

Methods

afterGenerate(PluginContext context) → Future<void>
Hook called after generation completes successfully.
inherited
beforeGenerate(PluginContext context) → Future<void>
Hook called before generation starts.
inherited
createCommand() → Command
Creates the Command instance for this plugin.
generate(GeneratorConfig config, {PluginContext? context, void onInterfaceExpectation(UseCaseInterfaceExpectation expectation)?, bool quiet = false}) → Future<List<GeneratedFile>>
Legacy generation method for backward compatibility.
override
generateWithContext(PluginContext context) → Future<List<GeneratedFile>>
Generates files based on the provided context.
override
generateWithReport(GeneratorConfig config, {PluginContext? context, void onInterfaceExpectation(UseCaseInterfaceExpectation expectation)?, bool quiet = false}) → Future<UsecaseGenerationReport>
Spec #972 API: generate with the full machine report (per-method verdicts + guard outcome) for entity-based runs. Custom-usecase paths (orchestrator/polymorphic/stream/custom) carry no per-method vocabulary — the report wraps their files with empty verdicts.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onError(PluginContext context, Object error, StackTrace stackTrace) → Future<void>
Hook called if an error occurs during generation.
inherited
toString() → String
A string representation of this object.
inherited
validate(PluginContext context) → Future<ValidationResult>
Validates the plugin configuration against the context.
inherited
validateLegacy(GeneratorConfig config) → Future<ValidationResult>
Legacy validation method.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited