ZorphyPlugin class abstract
Abstract contract for a Zorphy code-generation plugin.
Plugins inspect and mutate code_builder specs (classes, methods,
fields) before they are emitted. Each plugin declares:
- name -- unique identifier used for ordering and registration.
- decoratorNames -- which
@Zorphy(decorators: [...])names this plugin reacts to (used by the orchestrator to decide whether to run the plugin for a given class). Empty set means the plugin runs for every class. - runBefore / runAfter -- ordering constraints relative to other plugins by name. Processed via topological sort.
The transform hooks (transformClass, transformMethod, transformField) receive a mutable builder and a PluginContext, and must return the (possibly replaced) builder.
v2.1 Extension Surface
The following hooks are planned for v2.1 and are documented here as anchor points. They are not yet called by the orchestrator:
transformExtension-- mutateExtensionspecs.transformConstructor-- mutateConstructorspecs.transformLibrary-- mutate theLibraryspec itself.onGenerateStart/onGenerateEnd-- lifecycle hooks for side effects (logging, metrics).
Constructors
Properties
-
decoratorNames
→ Set<
String> -
Decorator names this plugin reacts to.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Unique name for this plugin (used in ordering and registration).
no setter
-
runAfter
→ Set<
String> -
Names of plugins that must run before this one.
no setter
-
runBefore
→ Set<
String> -
Names of plugins that must run after this one.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transformClass(
Spec spec, PluginContext context) → Spec -
Transforms a
Classspec. -
transformField(
Spec spec, PluginContext context) → Spec -
Transforms a
Fieldspec. -
transformMethod(
Spec spec, PluginContext context) → Spec -
Transforms a
Methodspec.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited