Annotation Type BlacklistPackage


@API(status=EXPERIMENTAL)
@Documented
@Retention(RUNTIME)
@Target({METHOD,TYPE,ANNOTATION_TYPE})
@Repeatable(BlacklistPackages.class)
public @interface BlacklistPackage
Allows to blacklist a package, possibly including all subpackages. The ArtemisSecurityManager will disallow any access for non-whitelisted callers outside the set of whitelisted packages. This annotation is Repeatable, and can be placed additively on the test class and test method.

You can use * and ** in the same way as in GLOB patterns just applied to packages where the delimiter is ".".

Use e.g. @BlacklistPackage("java.util") to disallow access to all classes in the package java.util and @BlacklistPackage("java.util**") to disallow access to classes in java.util and all its subpackages. @BlacklistPackage("**") will disallow any use of classes outside java.lang.

The access to java.lang is always allowed and by default, all packages can be used, apart from java.lang.reflect, and internal packages of AJTS.

This annotation will be overpowered any WhitelistPackage annotations.

Since:
0.5.1
Version:
1.1.0
Author:
Christian Femers
  • Required Element Summary

    Required Elements 
    Modifier and Type Required Element Description
    java.lang.String value  
  • Element Details

    • value

      java.lang.String value