package com.futureprocessing.documentjuggler.commons;

import com.futureprocessing.documentjuggler.Context;
import com.futureprocessing.documentjuggler.annotation.Forbidden;

import java.lang.reflect.Method;

import static com.futureprocessing.documentjuggler.annotation.AnnotationReader.from;
import static java.util.Arrays.binarySearch;

public final class ForbiddenChecker {

    public static boolean isForbidden(Method method, Context context) {
        Forbidden forbidden = from(method).read(Forbidden.class);

        if (forbidden == null) {
            return false;
        }

        return binarySearch(forbidden.value(), context) >= 0;
    }

    private ForbiddenChecker() {
    }

    ;
}

@@ -200,16 +200,39 @@
 .Method;
+%0Aimport java.util.List;
 %0A%0Aimport
@@ -475,16 +475,21 @@
         
+List%3C
 Forbidde
@@ -489,16 +489,17 @@
 orbidden
+%3E
  forbidd
@@ -520,16 +520,19 @@
 od).read
+All
 (Forbidd
@@ -568,16 +568,18 @@
 dden
- == null
+.isEmpty()
 ) %7B%0A
@@ -623,23 +623,64 @@
         
-return 
+for (Forbidden f : forbidden) %7B%0A            if (
 binarySe
@@ -685,24 +685,16 @@
 Search(f
-orbidden
 .value()
@@ -708,16 +708,94 @@
 xt) %3E= 0
+) %7B%0A                return true;%0A            %7D%0A        %7D%0A%0A        return false
 ;%0A    %7D%0A

Extend forbidden check