Class AnnotationPolicyRegistry

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

public final class AnnotationPolicyRegistry extends Object
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.
  • 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 kind
      trustedHostCapabilities - explicitly supplied runtime-retained annotation types, at most 256
      Throws:
      IllegalArgumentException - for null, duplicate, malformed or excessive entries
  • Method Details

    • empty

      public static AnnotationPolicyRegistry empty()
      Creates setup with no policies or claimed annotation behaviours.
      Returns:
      immutable empty host setup
    • contains

      public boolean contains(AnnotationPolicyRegistry.Kind kind, String name)
      Tests an exact namespace/name without unnamed fallback.
      Parameters:
      kind - policy namespace
      name - bounded policy identifier
      Returns:
      whether that exact policy exists
      Throws:
      IllegalArgumentException - for a null kind or malformed identifier
    • supports

      public boolean supports(Class<? extends Annotation> annotation)
      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