2011-10-23 38 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

相關問題