Class AnnotationPreflight
java.lang.Object
org.j7m.middleware.application.components.AnnotationPreflight
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordSafe deterministic diagnostic; arbitrary annotation arguments and exception messages are omitted.static final recordFull erased method identity; overloads, declaring owners and contract versions remain distinct.static enumVersioned validation mode; selecting managed mode is an explicit caller action.static final recordImmutable validation result, not runtime acceptance or deployment authorization.static enumDiagnostic severity; only ERROR prevents requireValid from returning normally. -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationPreflight(AnnotationPolicyRegistry registry) Creates a validator with explicitly trusted host setup; no runtime behaviour is installed. -
Method Summary
-
Constructor Details
-
AnnotationPreflight
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 modecontractId- stable identifier, at most128 characterscontractVersion- positive contract versionimplementation- concrete inspected typecontracts- explicit implemented interface roots, at most32- Returns:
- immutable deterministic report without arbitrary annotation values
- Throws:
IllegalArgumentException- for malformed input, nonimplemented contracts or excessive surface
-