Class ExactClassAllowList

Object
ExactClassAllowList

public final class ExactClassAllowList extends Object
Utility for loading immutable exact-class allow-lists from built-in defaults plus optional runtime configuration.

The resulting allow-list always contains the supplied defaults and may be extended through a system property or, if the property is blank, an environment variable. Instances of ExactClassAllowList.Snapshot are immutable and therefore safe to share between threads.

  • Method Details

    • load

      public static ExactClassAllowList.Snapshot load(String propertyName, String envName, Set<String> defaults)
      Loads an immutable allow-list snapshot.

      System property values take precedence over environment variable values. Blank values are ignored. Runtime configuration extends the supplied defaults rather than replacing them.

      Parameters:
      propertyName - system property containing a comma-separated list of exact FQNs
      envName - environment variable containing a comma-separated list of exact FQNs
      defaults - built-in defaults that are always allowed; must not be null
      Returns:
      immutable snapshot of the resolved allow-list and its source
      Throws:
      NullPointerException - if defaults is null
    • load

      public static ExactClassAllowList.Snapshot load(String propertyName, String envName, Set<String> defaults, Set<String> contributedDefaults)
      Loads an immutable allow-list snapshot including SPI-contributed defaults.

      System property values take precedence over environment variable values. Blank values are ignored. Runtime configuration extends the supplied defaults and SPI-contributed values rather than replacing them.

      Parameters:
      propertyName - system property containing a comma-separated list of exact FQNs
      envName - environment variable containing a comma-separated list of exact FQNs
      defaults - built-in defaults that are always allowed; must not be null
      contributedDefaults - SPI-contributed defaults discovered at runtime; must not be null
      Returns:
      immutable snapshot of the resolved allow-list and its source
      Throws:
      NullPointerException - if defaults or contributedDefaults is null