Annotation Interface SuppressForbidden


@Documented @Retention(CLASS) @Target({TYPE,FIELD,METHOD,CONSTRUCTOR}) public @interface SuppressForbidden
Marks a member with a public contract that is a user-supplied regular expression, for example the patterns given to RegexNameFinder or the alphanumeric Pattern accepted by the tokenizer factories.

Production code scans text with code-point loops and the opennlp.tools.util.StringUtil helpers instead of java.util.regex. The build enforces this rule with forbiddenapis, using the signatures in dev/forbidden-regex.txt (OPENNLP-1935). An annotated member is exempt from that check. Apply it to the narrowest member (field, constructor, or method) that needs it rather than to the enclosing class, so a regular expression added to another member of the same class is still reported.

The annotation is kept in class files and read by the build only; it has no effect at runtime.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Element Details

    • value

      String value
      Returns:
      The public contract that requires the regular expression.