Class Whitelist

    • Constructor Detail

      • Whitelist

        public Whitelist()
    • Method Detail

      • permitsMethod

        public abstract boolean permitsMethod​(@NonNull
                                              Method method,
                                              @NonNull
                                              Object receiver,
                                              @NonNull
                                              Object[] args)
        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.

        Parameters:
        method - a method defined in the JVM
        receiver - this, the receiver of the method call
        args - zero or more arguments
        Returns:
        true to allow the method to be called, false to reject it
      • permitsConstructor

        public abstract boolean permitsConstructor​(@NonNull
                                                   Constructor<?> constructor,
                                                   @NonNull
                                                   Object[] args)
      • permitsStaticMethod

        public abstract boolean permitsStaticMethod​(@NonNull
                                                    Method method,
                                                    @NonNull
                                                    Object[] args)
      • permitsFieldGet

        public abstract boolean permitsFieldGet​(@NonNull
                                                Field field,
                                                @NonNull
                                                Object receiver)
      • permitsFieldSet

        public abstract boolean permitsFieldSet​(@NonNull
                                                Field field,
                                                @NonNull
                                                Object receiver,
                                                @CheckForNull
                                                Object value)
      • permitsStaticFieldGet

        public abstract boolean permitsStaticFieldGet​(@NonNull
                                                      Field field)
      • permitsStaticFieldSet

        public abstract boolean permitsStaticFieldSet​(@NonNull
                                                      Field field,
                                                      @CheckForNull
                                                      Object value)
      • all

        @NonNull
        public static Whitelist all()
        Checks for all whitelists registered as Extensions and aggregates them.
        Returns:
        an aggregated default list