Class SelectModel

java.lang.Object
ca.mcscert.jpipe.compiler.model.Transformation<Unit, JustificationModel<?>>
ca.mcscert.jpipe.compiler.steps.transformations.SelectModel

public class SelectModel extends Transformation<Unit, JustificationModel<?>>
Extracts a single JustificationModel from a Unit by name, or auto-selects it when the unit contains exactly one model and no name is given.

Use -m / --model on the CLI to supply the name.

  • Constructor Details

    • SelectModel

      public SelectModel(String diagramName)
      Parameters:
      diagramName - name of the model to select, or null to auto-select when unambiguous.
  • Method Details

    • run

      protected JustificationModel<?> run(Unit unit, CompilationContext ctx)
      Description copied from class: Transformation
      Business logic of this step. Must not return null; may throw any exception. Use ctx to report non-fatal diagnostics or inspect previously accumulated errors.
      Specified by:
      run in class Transformation<Unit, JustificationModel<?>>
      Parameters:
      unit - the value produced by the previous step.
      ctx - compilation context carrying the source path and diagnostic bag.
      Returns:
      the transformed value — never null.