Search code examples
annotationsjavadoc

Force javadoc to ignore an annotation


I'm trying to document an annotated interface and include a sample of how it's used in the javadoc. e.g.

/**
 * Here's an example usage:
 *
 * <PRE>
 * @IFaceAnnotation(value="")
 * public interface IFace {
 *
 *     @MethodAnnotation("")
 *     public String Method();
 * }
 * </PRE>
 */

However, Javadoc treats my annotations as javadoc instructions (like @param etc.) and as a result only prints:

Here's an example usage:

In the generated documentation. The only way i've been able to stop this is by adding an extra char before the annotation e.g.

/**
 * Here's an example usage:
 *
 * <PRE>
 * \@IFaceAnnotation(value="")
 * public interface IFace {
 *
 *     \@MethodAnnotation("")
 *     public String Method();
 * }
 * </PRE>
 */

but this looks a bit messy.

Just wondered if anyone had any suggestions, Thanks.


Solution

  • You can use '&#064;' instead of the @, but thats even more ugly.