多行代码的Javadoc格式问题
我有以下具有多行代码的Javadoc:多行代码的Javadoc格式问题,java,javadoc,Java,Javadoc,我有以下具有多行代码的Javadoc: * <p>Usage example: * <code> * ConfigurationProperty property = ConfigurationProperty.Builder * .create() * .withHotKey("testKey") *
* <p>Usage example:
* <code>
* ConfigurationProperty property = ConfigurationProperty.Builder
* .create()
* .withHotKey("testKey")
* .withRunnableContext("testContext")
* .withRunnableContextType("APPLICATION")
* .build();
* </code>
*
* The {@link ConfigurationProperty.Builder#withRunnableContextType(String type) method
* throws an {@link IllegalArgumentException} if the provided type is not supported in
* {@link ConfigurationProperty#RUNNABLE_CONTEXT_TYPE}
我的问题是代码在生成的Javadoc中没有正确的缩进显示。以下是我在生成的Javadoc中看到的内容,没有任何缩进:
Immutable implementation of a ConfigurationProperty. This class is
immutable, and so is thread safe. An instance of the ConfigurationProperty
can be obtained by using the ConfigurationProperty.Builder
Usage example: ConfigurationProperty property =
ConfigurationProperty.Builder .create() .withHotKey("testKey")
.withRunnableContext("testContext") .withRunnableContextType("APPLICATION")
.build(); } The method throws an IllegalArgumentException if the provided
type is not supported in ConfigurationProperty.RUNNABLE_CONTEXT_TYPE
如果我用pre标记替换代码,那么只显示第一行代码。
为什么会这样。我该如何解决这个问题?
有没有关于如何纠正这个问题的想法
请告知
谢谢 使用
而不是
通过使用大部分代码,代码被截断。为什么会这样?我现在只看到了以下内容:“ConfigurationProperty=ConfigurationProperty.Builder”,其余的javadoc都被删除了。我刚刚更新了我的答案,我必须说它对我来说很好。谢谢,我刚刚在原始帖子中添加了相同的代码,但没有看到它。。。。你知道为什么会这样吗?java版本或eclipse版本是否重要?我在java v1.7上..Eclipse Helios。。是否要检查javadoc依赖关系?我不确定为什么会发生这种情况。您是否尝试使用javadoc.exe
从控制台生成HTML javadoc?问题还存在吗?若并没有,那个么Java版本就可以了,问题可能出在Eclipse中。也许考虑更新你的IDE,也许它可能是一些已经解决的bug。另外,如果您感兴趣,我正在使用Java8和EclipseLuna。您也可以尝试安装Eclipse的干净版本,看看它是如何生成Javadoc的。如果操作正确,请尝试添加依赖项,看看是哪一个导致了问题。