Class CommentContextLoader


  • public class CommentContextLoader
    extends Object
    Computes the list of ContextLineInfo for a given comment, that is, the lines of the source file surrounding and including the area where the comment was written.
    • Method Detail

      • getContext

        public List<ContextLineInfo> getContext​(CommentInfo comment)
        Returns an empty list of ContextLineInfo. Clients are expected to call this method one or more times. Each call returns a reference to an empty List<ContextLineInfo>.

        A single call to fill() will cause all list references returned from this method to be populated. If a client calls this method again with a comment that was passed before calling fill(), the new populated list will be returned.

        Parameters:
        comment - the comment entity for which we want to load the context
        Returns:
        a list of ContextLineInfo
      • fill

        public void fill()
        A call to this method loads the context for all comments stored in candidates. This is useful so that the repository is opened once for all comments.