Package cruise.umple.compiler
Class Comment
java.lang.Object
cruise.umple.compiler.Comment
public class Comment
extends java.lang.Object
Represents a comment, such as those found around classes, methods, attributes and associations.
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description void
delete()
static java.lang.String
format(java.lang.String type, java.util.List<Comment> allComments)
Used to take a comment and process it into a format appropriate for displaying in generated code.static java.lang.String
format(java.lang.String type, java.util.List<Comment> allComments, boolean allowAnnotations)
boolean
getAnnotation()
boolean
getIsInline()
java.lang.String
getText()
The text associated with the comment.boolean
isAnnotation()
boolean
isIsInline()
boolean
setAnnotation(boolean aAnnotation)
boolean
setIsInline(boolean aIsInline)
boolean
setText(java.lang.String aText)
java.lang.String
toString()
-
Constructor Details
-
Method Details
-
setText
public boolean setText(java.lang.String aText) -
setAnnotation
public boolean setAnnotation(boolean aAnnotation) -
setIsInline
public boolean setIsInline(boolean aIsInline) -
getText
public java.lang.String getText()The text associated with the comment. -
getAnnotation
public boolean getAnnotation() -
getIsInline
public boolean getIsInline() -
isAnnotation
public boolean isAnnotation() -
isIsInline
public boolean isIsInline() -
delete
public void delete() -
format
Used to take a comment and process it into a format appropriate for displaying in generated code. For example, you may want a bunch of inline comments put together and displayed as Javadoc. This accomplishes that (among others).- Parameters:
type
- Indicates the type of comment which determines how the comments are formatted. The types are: Hash, Javadoc, Attribute Javadoc, Association Javadoc, Method Javadoc, RubyMultiline, RubyMultiline Internal and Multiline. Defaults to "//" if not specified.allComments
- A list of comments to be processed and formatted all together as one.- Returns:
- The processed/formatted comment appropriate for use in generated code output.
-
format
public static java.lang.String format(java.lang.String type, java.util.List<Comment> allComments, boolean allowAnnotations) -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-