Class SplicePlan

java.lang.Object
io.jenkins.plugins.configsplice.engine.SplicePlan

public final class SplicePlan extends Object
An ordered set of non-overlapping replacements to apply to one document (SRS section 10.1).

Edits are applied in descending start-offset order so that each splice leaves the offsets of every not-yet-applied edit valid. Overlap is rejected rather than resolved: two substitutions competing for the same source range means the user's intent is ambiguous, and guessing would silently discard one of them.

  • Method Details

    • builder

      public static SplicePlan.Builder builder()
    • edits

      public List<SplicePlan.Edit> edits()
    • isEmpty

      public boolean isEmpty()
    • applyTo

      public String applyTo(String text) throws SpliceException
      Applies every edit to text.

      The caller is responsible for having built the plan against this exact text; ranges are bounds-checked here so a mismatch fails loudly instead of producing a mangled file.

      Throws:
      SpliceException