Class CommentUtils


  • public class CommentUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      CommentUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String fixupAnnoations​(java.lang.String rawCommentText, Program program)
      Makes adjustments as necessary to any annotations in the given text.
      static java.lang.String getDisplayString​(java.lang.String rawCommentText, Program program)
      Returns the display string for the given raw annotation text.
      static FieldElement parseTextForAnnotations​(java.lang.String text, Program program, AttributedString prototypeString, int row)
      Parses the given text looking for annotations.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommentUtils

        public CommentUtils()
    • Method Detail

      • fixupAnnoations

        public static java.lang.String fixupAnnoations​(java.lang.String rawCommentText,
                                                       Program program)
        Makes adjustments as necessary to any annotations in the given text.
        Parameters:
        rawCommentText - the text to be updated
        program - the program associated with the comment
        Returns:
        the updated string
      • getDisplayString

        public static java.lang.String getDisplayString​(java.lang.String rawCommentText,
                                                        Program program)
        Returns the display string for the given raw annotation text. Annotations are encoded strings that fit this pattern: {@name text}. This method will parse the given text, converting any annotations into their display version.
        Parameters:
        rawCommentText - text that may include annotations
        program - the program
        Returns:
        the display string
      • parseTextForAnnotations

        public static FieldElement parseTextForAnnotations​(java.lang.String text,
                                                           Program program,
                                                           AttributedString prototypeString,
                                                           int row)
        Parses the given text looking for annotations.
        Parameters:
        text - The text to parse.
        program - the program from which to get information
        prototypeString - The reference string used to determine the attributes of any newly created AttributedString.
        row - the row of the newly created FieldElement
        Returns:
        A field element containing AttributedStrings