3

There is a @ in my code example in javadoc:

 * <pre>
 * public class ArticleService<Article, ArticleDao> {
 *     @Autowired
 *     private ArticleDao articleDao;
 *     protected ArticleDao getDao() { return articleDao; }
 * }
 * </pre>

It breaks the javadoc, because the preview looks like:

enter image description here

How to fix it?

Freewind
  • 193,756
  • 157
  • 432
  • 708
  • 1
    already answered here http://stackoverflow.com/questions/2290757/how-can-you-escape-the-character-in-javadoc – wrschneider Dec 11 '11 at 02:59
  • first of al this post is to ambiguous and second of all that's definately not how you write javadoc, I suggest looking at some examples. – awiebe Dec 11 '11 at 02:59
  • @wrschneider99, this is a duplicated question because we can't search `@` in SO, or google. – Freewind Dec 11 '11 at 03:18

2 Answers2

7

Use the {@literal} tag:

 * <pre>
 *     {@literal @Autowired}
 *     private ArticleDao articleDao;
 * 
 *     protected ArticleDao getDao()
 *     {
 *         return articleDao;
 *     }
 * </pre>

I have just tested this to make sure it works... and it does

Bohemian
  • 412,405
  • 93
  • 575
  • 722
1

Simply replace @ with &#064;:

勿绮语
  • 9,170
  • 1
  • 29
  • 37