Class AnnotationPolicyRegistry
java.lang.Object
org.j7m.middleware.application.components.AnnotationPolicyRegistry
Immutable, explicitly trusted host setup for annotation preflight. Named policies describe
available configuration identities; capabilities declare which annotation behaviours the caller's
actual host supplies. Neither registration nor successful preflight installs an interceptor,
creates a component or proves runtime enforcement. Application annotations never grant capabilities.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumIndependent policy namespaces; the same name may exist in different kinds. -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationPolicyRegistry(Map<AnnotationPolicyRegistry.Kind, ? extends Collection<String>> namedPolicies, Collection<? extends Class<? extends Annotation>> trustedHostCapabilities) Creates bounded, defensive host setup; no annotation values are included in errors. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(AnnotationPolicyRegistry.Kind kind, String name) Tests an exact namespace/name without unnamed fallback.static AnnotationPolicyRegistryempty()Creates setup with no policies or claimed annotation behaviours.booleansupports(Class<? extends Annotation> annotation) Tests an explicit host declaration, not actual runtime enforcement.
-
Constructor Details
-
AnnotationPolicyRegistry
public AnnotationPolicyRegistry(Map<AnnotationPolicyRegistry.Kind, ? extends Collection<String>> namedPolicies, Collection<? extends Class<? extends Annotation>> trustedHostCapabilities) Creates bounded, defensive host setup; no annotation values are included in errors.- Parameters:
namedPolicies- policy names by independent namespace, at most 128 names per kindtrustedHostCapabilities- explicitly supplied runtime-retained annotation types, at most 256- Throws:
IllegalArgumentException- for null, duplicate, malformed or excessive entries
-
-
Method Details
-
empty
Creates setup with no policies or claimed annotation behaviours.- Returns:
- immutable empty host setup
-
contains
Tests an exact namespace/name without unnamed fallback.- Parameters:
kind- policy namespacename- bounded policy identifier- Returns:
- whether that exact policy exists
- Throws:
IllegalArgumentException- for a null kind or malformed identifier
-
supports
Tests an explicit host declaration, not actual runtime enforcement.- Parameters:
annotation- annotation type- Returns:
- whether the host declared this annotation behaviour
- Throws:
IllegalArgumentException- for null
-