public class JavadocComment extends AbstractComment
CommentStructure
This class is responsible of adding the right JavaDoc syntax in its proper
place inside the structure. Having this in mind, adding manually any syntax
*is discouraged*.
Please, avoid using specific system line separators. Use
`org.apache.commons.io.IOUtils.LINE_SEPARATOR` to specify line breaks.| Constructor and Description |
|---|
JavadocComment()
Default empty constructor.
|
JavadocComment(String comment)
Used to add the full JavaDoc comment during the instantiation.
|
JavadocComment(String description,
ConstructorMetadata constructor)
Constructor used to generate full javadoc for a constructor
|
JavadocComment(String description,
List<String> paramsInfo,
String returnInfo,
List<String> throwsTypes)
Constructor used to generate a full Javadoc with description, params,
return and throws.
|
JavadocComment(String description,
MethodMetadata method)
Constructor used to generate full javadoc for a method
|
getComment, toStringpublic JavadocComment()
public JavadocComment(String comment)
comment - the String with the comment to add as JavaDoc syntax.public JavadocComment(String description, MethodMetadata method)
description - method - public JavadocComment(String description, ConstructorMetadata constructor)
description - constructor - public JavadocComment(String description, List<String> paramsInfo, String returnInfo, List<String> throwsTypes)
description - the `String` with the block description to add. Please, use
`org.apache.commons.io.IOUtils.LINE_SEPARATOR` for line breaks.paramsInfo - the `ListreturnInfo - the `String` with the return info. JavaDoc ` * @return`
syntax will be automatically added.throwsInfo - the `Listpublic static CommentStructure create(String messageFormat, Object... args)
CommentStructure with a JavaDoc with message
using String.format(String, Object...) functionmessage - public static CommentStructure create(ConstructorMetadata constructor, String messageFormat, Object... args)
CommentStructure with a JavaDoc for constructor with message
using String.format(String, Object...) functionmessage - public static CommentStructure create(MethodMetadata metadata, String messageFormat, Object... args)
CommentStructure with a JavaDoc for method with message
using String.format(String, Object...) functionmessage - protected void loadFromDefinitions()
public void setComment(String comment)
setComment in class AbstractCommentpublic String getDescription()
public void setDescription(String description)
public String getReturnInfo()
public void setReturnInfo(String returnInfo)
Copyright © 2009–2018 Pivotal Software, Inc.. All rights reserved.