Class AbstractWhitelist

  • All Implemented Interfaces:

    public abstract class AbstractWhitelist
    extends Whitelist
    Convenience whitelist base class that denies everything by default. Thus you need only override things you wish to explicitly allow. Also reduces the risk of incompatibilities in case further abstract methods are added to Whitelist.
    • Constructor Detail

      • AbstractWhitelist

        public AbstractWhitelist()
    • Method Detail

      • permitsMethod

        public boolean permitsMethod​(@NonNull
                                     Method method,
                                     Object receiver,
                                     Object[] args)
        Description copied from class: Whitelist
        Checks whether a given virtual method may be invoked.

        Note that method should not be implementing or overriding a method in a supertype; in such a case the caller must pass that supertype method instead. In other words, call site selection is the responsibility of the caller (such as GroovySandbox), not the whitelist.

        Specified by:
        permitsMethod in class Whitelist
        method - a method defined in the JVM
        receiver - this, the receiver of the method call
        args - zero or more arguments
        true to allow the method to be called, false to reject it