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 -- mutate Extension specs.
  • transformConstructor -- mutate Constructor specs.
  • transformLibrary -- mutate the Library spec itself.
  • onGenerateStart / onGenerateEnd -- lifecycle hooks for side effects (logging, metrics).

Constructors

ZorphyPlugin()

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 Class spec.
transformField(Spec spec, PluginContext context) → Spec
Transforms a Field spec.
transformMethod(Spec spec, PluginContext context) → Spec
Transforms a Method spec.

Operators

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