我已经建立了一个自定义注释,例如
package com.uc4.ucdf.control.xgui;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface XGUIElement {
public String Name();
public String Description();
public XGUIAttribute[] Attributes();
public String CodeSnipet();
}
和
package com.uc4.ucdf.control.xgui;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface XGUIAttribute {
public String Name();
public String ValueType();
public String Description();
}
在我的类文件中,我得到了这个注释
@XGUIElement( Name = "dialog",
Description = "this component provides a empty internal window with a title and some properties like if its minimizable, maximizable",
CodeSnipet = "<dialog id=\"myDialog\" text=\"Hello World\">",
Attributes = {
@XGUIAttribute(Description = "Set the width of the Dialog", Name = "width", ValueType = "Integer"),
@XGUIAttribute(Description = "Set the height of the Dialog", Name = "height", ValueType = "Integer"),
@XGUIAttribute(Description = "1 for true; 0 for false", Name = "top", ValueType = "Integer"),
@XGUIAttribute(Description = "Set the left position of this dialog", Name = "left", ValueType = "Integer"),
@XGUIAttribute(Description = "Allows you to set the dialog over all not ontop dialogs 1 for true; 0 for false ", Name = "ontop", ValueType = "Integer")
}
)
这工作创建,我可以读取我的 swingComponent 中的单个值,但我应该将此注释带入使用 Doxygen 构建的 javaDoc 中。
那么为什么我在我的 javadoc 中看不到注释以及如何将其转换为所有属性的表格列表。