Interface ModelAdapter

All Known Implementing Classes:
GitConfigAdapter, MavenSettingsAdapter, PomModelAdapter

public interface ModelAdapter
Plan-time adapter for a single model-managed file type.

Where TierHandler operates on raw bytes and hashes, ModelAdapter understands the structure of its file — Maven settings.xml, POMs, git config — and plans per-element changes. The adapter knows how to:

Adapters are pure — they must not touch disk.

  • Method Details

    • modelName

      String modelName()
      Model name this adapter handles, matching ManifestEntry.model() (e.g. "maven-settings-4").
      Returns:
      the model name; never null
    • plan

      ModelPlanResult plan(ManifestEntry entry, Path resolvedDest, byte[] currentContent, LockfileEntry priorEntry, String currentStandardsVersion)
      Plan a single model-managed entry.
      Parameters:
      entry - the manifest entry; must have ScaffoldTier.MODEL_MANAGED tier and model() equal to modelName()
      resolvedDest - absolute destination path (placeholders already expanded)
      currentContent - bytes currently on disk at resolvedDest, or null if no file exists
      priorEntry - lockfile entry from the last publish, or null if never applied
      currentStandardsVersion - the standards-version of the current manifest; stamped on newly-installed elements so drift can be reasoned about later
      Returns:
      a ModelPlanResult with both a TierAction and the element-level provenance for the lockfile
      Throws:
      ScaffoldException - if the document cannot be parsed or the ensure-rules are malformed