Class AnnotationPreflight

java.lang.Object
org.j7m.middleware.application.components.AnnotationPreflight

public final class AnnotationPreflight extends Object
Explicit version-one annotation contract preflight. It reads metadata only from supplied classes, their interfaces and superclasses, without construction, classpath scanning or opening JPMS packages. It is not wired into ApplicationManager; successful validation neither deploys an application nor proves that declared host capabilities are enforced. Instances are thread-safe.
  • Constructor Details

    • AnnotationPreflight

      public AnnotationPreflight(AnnotationPolicyRegistry registry)
      Creates a validator with explicitly trusted host setup; no runtime behaviour is installed.
      Parameters:
      registry - immutable host policy and capability declarations
      Throws:
      NullPointerException - if registry is null
  • Method Details

    • inspect

      public AnnotationPreflight.Report inspect(AnnotationPreflight.Profile profile, String contractId, int contractVersion, Class<?> implementation, List<Class<?>> contracts)
      Validates an explicit contract surface without constructing components or invoking hooks. Conflicting explicit scalar values reject across all relevant declaration levels; this baseline does not approve a narrowing/override without a future verified adapter contract. Only an interface contributing the inspected method participates in its type defaults. Roles/permissions are cumulative requirements, never an override that relaxes another declaration. Different trust domains, remote/local or idempotency declarations conflict. Custom composed annotations and Jakarta Inject are reported as unsupported, not silently treated as implemented. Cyclic metadata or metadata deeper than eight edges is rejected conservatively, even if no J7M marker has yet been found; reflection is not an untrusted-code sandbox.
      Parameters:
      profile - explicit legacy or strict managed mode
      contractId - stable identifier, at most128 characters
      contractVersion - positive contract version
      implementation - concrete inspected type
      contracts - explicit implemented interface roots, at most32
      Returns:
      immutable deterministic report without arbitrary annotation values
      Throws:
      IllegalArgumentException - for malformed input, nonimplemented contracts or excessive surface