concept weave - time error in category aspectj

appears as: weave-time errors, weave-time error
AspectJ in Action, Second Edition

This is an excerpt from Manning's book AspectJ in Action, Second Edition.

5.5. Declaring weave-time errors and warnings

AspectJ provides a static crosscutting mechanism to declare weave-time errors and warnings based on certain usage patterns. This mechanism is often used with the AspectJ compiler as the weaver and therefore is also referred to as a compile-time error and warning construct. With this mechanism, you can implement behavior similar to the #error and #warning preprocessor directives supported by some C/C++ preprocessors; you can also implement more complex and powerful directives.

The declare error construct provides a way to declare a weave-time error when the compiler detects the presence of a join point matching a given pointcut. The compiler issues an error, prints the given message for each detected use, and aborts the compilation process: