2011-10-23 39 views
68

使用JavaDoc,我如何引用类中最终静态字段的值?如何引用类中最终静态字段的值?

我希望本例中的???替换为STATIC_FIELD的值。

/** 
* This is a simple class with only one static field with the value ???. 
*/ 
public class Simple { 

    /** 
    * We can reference the value with {@value} here, 
    * but how do we reference it in the class JavaDoc? 
    */ 
    public static final String STATIC_FIELD = "simple static field"; 

} 

回答

125

你的意思是{@value #STATIC_FIELD}

+0

感谢您的回答!我编辑了我的问题,以便说清楚。如果该字段的值将直接显示在JavaDoc中,那将是完美的... – Simon

+17

{@value #STATIC_FIELD}''怎么办? –

+1

@PhilippReichart感谢您的纠正。 – EJP

相关问题