Class ParsedDocumentationComment


  • public class ParsedDocumentationComment
    extends java.lang.Object
    The parsed version of a JavaDoc-style Integrity documentation comment.
    Author:
    Rene Schneider - initial API and implementation
    • Field Detail

      • parseExceptions

        protected java.util.List<ParsedDocumentationComment.ParseException> parseExceptions
        Non-critical parse exceptions that were encountered while parsing the comment. These exceptions did not result in an abortion of the parsing process, but point to problems nevertheless.
      • rawText

        protected java.lang.String rawText
        The entire raw textual content (including @ elements, but excluding comment *s).
      • documentationText

        protected java.lang.String documentationText
        The core documentation text (non-parsed).
      • parameterDocumentationTexts

        protected java.util.Map<java.lang.String,​java.lang.String> parameterDocumentationTexts
        Documentation for parameters (@param).
      • resultDocumentationTexts

        protected java.util.Map<java.lang.String,​java.lang.String> resultDocumentationTexts
        Documentation for results (@result). The one for the default result is added with key null.
      • COMMENT_START

        protected static final java.lang.String COMMENT_START
        A documentation comment starts with this.
        See Also:
        Constant Field Values
      • COMMENT_END

        protected static final java.lang.String COMMENT_END
        A documentation comment ends with this.
        See Also:
        Constant Field Values
      • DOCUMENTATION_TAG_START

        protected static final java.lang.String DOCUMENTATION_TAG_START
        The prefix that starts a documentation tag.
        See Also:
        Constant Field Values
      • DOCUMENTATION_TAG_PARAMETER

        protected static final java.lang.String DOCUMENTATION_TAG_PARAMETER
        The documentation tag for parameter descriptions.
        See Also:
        Constant Field Values
      • DOCUMENTATION_TAG_RESULT

        protected static final java.lang.String DOCUMENTATION_TAG_RESULT
        The documentation tag for result descriptions.
        See Also:
        Constant Field Values
      • DOCUMENTATION_TAG_RETURN

        protected static final java.lang.String DOCUMENTATION_TAG_RETURN
        The documentation tag for result descriptions. Can be used alternatively to DOCUMENTATION_TAG_RESULT.
        See Also:
        Constant Field Values
      • DOC_COMMENT_TOKENIZER_PATTERN

        protected static final java.util.regex.Pattern DOC_COMMENT_TOKENIZER_PATTERN
        The pattern used to split documentation comments into elements.
    • Method Detail

      • parse

        protected void parse​(java.lang.String aCommentString,
                             ModelSourceInformationElement aModelSourceInfo,
                             boolean anAllowUnnamedResultsFlag)
                      throws ParsedDocumentationComment.ParseException
        Actually performs the heavy lifting.
        Parameters:
        aCommentString - the string to be parsed, right from the model element
        aModelSourceInfo - the information about the source of the element, if available
        anAllowUnnamedResultsFlag - whether to apply a heuristic in determining if we have an unnamed result (false = all results named)
        Throws:
        ParsedDocumentationComment.ParseException - in case of parsing errors
      • getRawText

        public java.lang.String getRawText()
      • getDocumentationText

        public java.lang.String getDocumentationText()
      • getJavadocStyleFullDocumentation

        public java.lang.String getJavadocStyleFullDocumentation()
        Generates a representation of this entire documentation comments' content in Javadoc-style HTML. This includes all known @ elements.
        Returns:
      • getParameterDocumentationTexts

        public java.util.Map<java.lang.String,​java.lang.String> getParameterDocumentationTexts()
      • getSortedParameterDocumentationTexts

        public java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.String>> getSortedParameterDocumentationTexts()
      • getResultDocumentationTexts

        public java.util.Map<java.lang.String,​java.lang.String> getResultDocumentationTexts()
      • getSortedResultDocumentationTexts

        public java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.String>> getSortedResultDocumentationTexts()
      • tokenizeCommentText

        protected java.util.List<ParsedDocumentationComment.DocCommentElement> tokenizeCommentText​(java.lang.String aText)
        Splits the documentation comment text into elements.
        Parameters:
        aText -
        Returns: