English 中文(简体)
• 如何让Eclipse向Javadoc展示javax说明
原标题:How to get Eclipse to show Javadoc for javax annotations

我确实喜欢Eclipse为Java图书馆各类课程提供流行的Javadoc文件。 然而,我也利用日本宇宙航空研究开发局和日本宇宙航空研究开发机构的说明,如@Entity和@XMLType。 Eclipse承认这些说法是有效的,因为我可以打上tr光空间,而且可以穿透。 我也拿到 Java子。

但是,这些说明没有 Java印......仅报告 Java木无法找到。

我先下载了javadoc,将其安装在我的系统上,并与我的Java6系统图书馆(唯一安装的图书馆)的所有JAR有关。

任何想法? 很难相信,没有瓦 Java图可以说明。

最佳回答

@Entity isn tmark with the @Documented annotation.

@Target(TYPE) 
@Retention(RUNTIME)
public @interface Entity {

如果你试着@javax。 反之,请见JavaDoc,因为它标有@Documented。

@Target({ METHOD, CONSTRUCTOR, FIELD })
@Retention(RUNTIME)
@Documented
public @interface Inject {}

The @Documented annotation with JavaDoc:

/**
 * Indicates that annotations with a type are to be documented by javadoc
 * and similar tools by default.  This type should be used to annotate the 
 * declarations of types whose annotations affect the use of annotated
 * elements by their clients.  If a type declaration is annotated with
 * Documented, its annotations become part of the public API
 * of the annotated elements.
 *
 * @author  Joshua Bloch
 * @version 1.6, 11/17/05
 * @since 1.5
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Documented {
}

解决办法是进口 Java源,而不是进口 Java。 然后,它将按照你的期望开展工作。

问题回答

暂无回答




相关问题
Generate class diagram from existing javadocs

I m using an external java library for which I only have the javadocs and do not have the source code. I d like to generate a UML diagram from the existing javadocs so that I can visualize the class ...

Should JUnit tests be javadocced?

I have a number of JUnit test cases that are currently not documented with Javadoc comments. The rest of my code is documented, but I m wondering if it s even worth the effort to document these tests....

Does Javadoc have an equivalent to <![CDATA[ ... ]]>?

Unfortunately, there is no CDATA in HTML. This is a pity, because it would be perfect for adding javadoc comments that include XML, so you don t have to escape the < and >, for example: /**<![...

javadoc: show also descriptions of methods from parent class

Is there a way to produce javadoc so that all methods accessible from the class are listed with their full description? Usually only the methods defined in that class are listed and the rest are only ...

Is there a central javadoc repository online?

I found some sample code that uses an interface named com.sun.jersey.spi.container.ContainerRequestFilter. Someone was nice enough to post the javadoc here, but it just looks like it was some ...

热门标签