首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >多行代码的Javadoc格式问题

多行代码的Javadoc格式问题
EN

Stack Overflow用户
提问于 2015-06-21 04:40:52
回答 1查看 223关注 0票数 0

我有下面的Javadoc,它有多行代码:

代码语言:javascript
复制
     * <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中看到的,没有任何缩进:

代码语言:javascript
复制
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标记替换代码,那么只显示第一行代码。

为什么会这样呢?我该如何解决这个问题?对如何纠正这个问题有什么想法吗?

请指教,

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2015-06-21 04:44:01

使用<pre>而不是<code>

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30958681

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档