Class Checker<I>
java.lang.Object
ca.mcscert.jpipe.compiler.model.Transformation<I,I>
ca.mcscert.jpipe.compiler.model.Checker<I>
- Type Parameters:
I- the type being checked.
- Direct Known Subclasses:
CompletenessChecker, ConsistencyChecker, HaltAndCatchFire
An idempotent pipeline step: inspects the value without modifying it.
Subclasses implement check(I, CompilationContext). The run(I, CompilationContext) implementation
delegates to check and returns the input unchanged, enforcing
idempotency by construction.
Checks may report non-fatal diagnostics via ctx rather than throwing,
allowing the pipeline to accumulate multiple errors before deciding whether
to abort.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface for theTransformation.of(Transformation.Step)factory.Nested classes/interfaces inherited from class Transformation
Transformation.Step<I,O> -
Field Summary
Fields inherited from class Transformation
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidcheck(I input, CompilationContext ctx) Perform the check.static <I> Checker<I> checking(Checker.Check<I> check) Create aCheckerfrom a lambda or method reference.protected final Irun(I input, CompilationContext ctx) Business logic of this step.
-
Constructor Details
-
Checker
public Checker()
-
-
Method Details
-
checking
Create aCheckerfrom a lambda or method reference. -
run
Description copied from class:TransformationBusiness logic of this step. Must not returnnull; may throw any exception. Usectxto report non-fatal diagnostics or inspect previously accumulated errors.- Specified by:
runin classTransformation<I,I> - Parameters:
input- the value produced by the previous step.ctx- compilation context carrying the source path and diagnostic bag.- Returns:
- the transformed value — never
null.
-
check
Perform the check. Must not modifyinput. Non-fatal issues should be reported viactx.error()rather than thrown; throw (or callctx.fatal()) only for unrecoverable failures.- Parameters:
input- the value to inspect.ctx- compilation context for reporting diagnostics.
-