Syntax of Custom Signatures Files

Forbidden API Checker allows to define custom signatures files. Depending on the type of task (Ant, Maven, or Gradle), you can add them via references to local files from your project directory. Maven also supports to refer to them using Maven coordinates.

The syntax of those files is: Each line that is not empty, does not start with a # or @ symbol is treated as a signature. The following types of signatures are supported:

The error message displayed when the signature matches can be given at the end of each signature line using "@" as separator:

  java.lang.String @ You are crazy that you disallow strings

To not repeat the same message after each signature, you can prepend signatures with a default message. Use a line starting with "@defaultMessage".

  @defaultMessage You are crazy that you disallow substrings
  java.lang.String#substring(int)
  java.lang.String#substring(int,int)