Can't use @ character in javadocs: "wrong tag"?

Hello,

I was writing a javadoc for a class that includes a sample code which uses an annotation, like this:

/**
* <pre><code>public class Subclasse extends EnderecoAssociadoATipo {
*     @AttirbuteOverride(name = "ID_ASSOCIADO_ENDERECO", column = @Column(name = "NOME_CORRETO_DO_CAMPO"))
*     private EnderecoAssociadoATipo.Id id;
*     // resto da classe
* </code></pre>
*/
class BlaBla {

The line which start with '@' is marked with this message: "Wrong tag 'AttributeOverride'"

Is there a way to use @ without messing the javadoc's tag?

2 comments
Comment actions Permalink

according to javadoc specification: "The tag section starts with the first block tag, which is defined by the first

@
character that  begins a line (ignoring leading asterisks, white space, and leading separator"
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html

so the only way is to use unicode html code for '@' at the start of line

/**
* <pre><code>public class Subclasse extends EnderecoAssociadoATipo {
*     &#x0040;AttirbuteOverride(name = "ID_ASSOCIADO_ENDERECO", column = @Column(name = "NOME_CORRETO_DO_CAMPO"))
*     private EnderecoAssociadoATipo.Id id;
*     // resto da classe
* </code></pre>
*/
class BlaBla {

0
Comment actions Permalink

Thank you Wi Wi

0

Please sign in to leave a comment.