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

    Constructors 
    Constructor Description
    Comment​(Comment aComment)
    deep copy constructor
    Comment​(java.lang.String aText)  
  • 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()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Comment

      public Comment​(java.lang.String aText)
    • Comment

      public Comment​(Comment aComment)
      deep copy constructor
  • 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

      public 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. 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 class java.lang.Object