Package: org.codehaus.groovy.tools.groovydoc

## [Java] Class SimpleGroovyDoc

- org.codehaus.groovy.tools.groovydoc.SimpleGroovyDoc

- All Implemented Interfaces and Traits:
    GroovyDoc

      public class SimpleGroovyDoc
      extends Object
      implements GroovyDoc

  Base implementation of the GroovyDoc contract.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static int` | `ANNOTATION_DEF` | Token type used for annotation types.
    `static int` | `CLASS_DEF` | Token type used for ordinary classes.
    `static int` | `ENUM_DEF` | Token type used for enums.
    `static int` | `INTERFACE_DEF` | Token type used for interfaces.
    `static int` | `RECORD_DEF` | Token type used for records.
    `static int` | `TRAIT_DEF` | Token type used for traits.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `SimpleGroovyDoc(String name)` Creates a documented element with the supplied name.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static String` | `calculateFirstSentence(String raw)` Extracts the first sentence from a raw documentation comment.
    `` | `public String` | `commentText()` Returns the processed comment text for this element. Returns: the rendered comment text
    `` | `public int` | `compareTo(GroovyDoc that)` {@inheritDoc}
    `` | `public String` | `firstSentenceCommentText()` Returns the first sentence of the processed comment text. Returns: the first sentence summary
    `` | `public String` | `getRawCommentText()` Returns the raw documentation comment for this element. Returns: the raw comment text
    `` | `public String` | `getTypeDescription()` Returns a human-readable description of this element's kind.
    `` | `public String` | `getTypeSourceDescription()` Returns the source-level keyword used to declare this element.
    `` | `public boolean` | `isAnnotationType()` Indicates whether this element represents an annotation type. Returns: `true` if this element is an annotation type
    `` | `public boolean` | `isAnnotationTypeElement()` Indicates whether this element represents an annotation type member. Returns: `true` if this element is an annotation type element
    `` | `public boolean` | `isClass()` Indicates whether this element represents a class. Returns: `true` if this element is a class
    `` | `public boolean` | `isConstructor()` Indicates whether this element represents a constructor. Returns: `true` if this element is a constructor
    `` | `public boolean` | `isDeprecated()` Indicates whether this element is marked as deprecated. Returns: `true` if this element is deprecated
    `` | `public boolean` | `isEnum()` Indicates whether this element represents an enum type. Returns: `true` if this element is an enum
    `` | `public boolean` | `isEnumConstant()` Indicates whether this element represents an enum constant. Returns: `true` if this element is an enum constant
    `` | `public boolean` | `isError()` Indicates whether this element represents an error type. Returns: `true` if this element is an error
    `` | `public boolean` | `isException()` Indicates whether this element represents an exception type. Returns: `true` if this element is an exception
    `` | `public boolean` | `isField()` Indicates whether this element represents a field. Returns: `true` if this element is a field
    `` | `public boolean` | `isHidden()` Indicates whether this doc element should be retained for internal model lookups but excluded from rendered output.
    `` | `public boolean` | `isIncluded()` Indicates whether this element is included in the generated output. Returns: `true` if this element is included
    `` | `public boolean` | `isInterface()` Indicates whether this element represents an interface. Returns: `true` if this element is an interface
    `` | `public boolean` | `isMarkdown()` Indicates whether this documentation comment should be rendered as Markdown.
    `` | `public boolean` | `isMethod()` Indicates whether this element represents a method. Returns: `true` if this element is a method
    `` | `public boolean` | `isOrdinaryClass()` Indicates whether this element represents an ordinary class. Returns: `true` if this element is an ordinary class
    `` | `public boolean` | `isRecord()` Indicates whether this element represents a record type. Returns: `true` if this element is a record
    `` | `public boolean` | `isScript()` Indicates whether this documented element represents a Groovy script.
    `` | `public boolean` | `isTrait()` Indicates whether this documented element represents a trait.
    `` | `public String` | `name()` Returns the simple name of this documented element. Returns: the element name
    `` | `protected void` | `setCommentText(String commentText)` Stores the rendered comment text for this element.
    `` | `public void` | `setDeprecated(boolean deprecated)` Marks this documented element as deprecated or not deprecated.
    `` | `protected void` | `setFirstSentenceCommentText(String firstSentenceCommentText)` Stores the first-sentence summary for this element.
    `` | `public void` | `setHidden(boolean hidden)` Sets whether this doc element should be hidden from rendered output while remaining available for internal resolution such as `inheritDoc`.
    `` | `public void` | `setMarkdown(boolean markdown)` Sets whether this documentation comment should be rendered as Markdown.
    `` | `public void` | `setRawCommentText(String rawCommentText)` Replaces the raw documentation comment for this element. Parameters: `arg0` - the raw comment text to store
    `` | `public void` | `setScript(boolean script)` Marks this documented element as a script or ordinary class.
    `` | `public void` | `setTokenType(int t)` Sets the parsed token type for this element.
    `` | `public GroovyTag[]` | `tags()` Returns the block tags parsed from the raw comment text.
    `` | `public String` | `toString()` Returns a debug-friendly representation of this documented element.
    `` | `public int` | `tokenType()` Returns the parsed token type for this element.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### public static final int ANNOTATION_DEF

      Token type used for annotation types.

    - #### public static final int CLASS_DEF

      Token type used for ordinary classes.

    - #### public static final int ENUM_DEF

      Token type used for enums.

    - #### public static final int INTERFACE_DEF

      Token type used for interfaces.

    - #### public static final int RECORD_DEF

      Token type used for records.

    - #### public static final int TRAIT_DEF

      Token type used for traits.

  - ### Constructor Detail

    - #### public SimpleGroovyDoc(String name)

      Creates a documented element with the supplied name.

      Parameters:
        `name` - the element name

  - ### Method Detail

    - #### public static String calculateFirstSentence(String raw)

      Extracts the first sentence from a raw documentation comment.

      Parameters:
        `raw` - the raw documentation comment
      Returns:
        the calculated first sentence

    - #### public String commentText()

      Returns the processed comment text for this element.

      Returns:
        the rendered comment text

    - #### public int compareTo(GroovyDoc that)

      {@inheritDoc}

    - #### public String firstSentenceCommentText()

      Returns the first sentence of the processed comment text.

      Returns:
        the first sentence summary

    - #### public String getRawCommentText()

      Returns the raw documentation comment for this element.

      Returns:
        the raw comment text

    - #### public String getTypeDescription()

      Returns a human-readable description of this element's kind.

      Returns:
        the element kind description

    - #### public String getTypeSourceDescription()

      Returns the source-level keyword used to declare this element.

      Returns:
        the declaration keyword or descriptor

    - #### public boolean isAnnotationType()

      Indicates whether this element represents an annotation type.

      Returns:
        `true` if this element is an annotation type

    - #### public boolean isAnnotationTypeElement()

      Indicates whether this element represents an annotation type member.

      Returns:
        `true` if this element is an annotation type element

    - #### public boolean isClass()

      Indicates whether this element represents a class.

      Returns:
        `true` if this element is a class

    - #### public boolean isConstructor()

      Indicates whether this element represents a constructor.

      Returns:
        `true` if this element is a constructor

    - #### public boolean isDeprecated()

      Indicates whether this element is marked as deprecated.

      Returns:
        `true` if this element is deprecated

    - #### public boolean isEnum()

      Indicates whether this element represents an enum type.

      Returns:
        `true` if this element is an enum

    - #### public boolean isEnumConstant()

      Indicates whether this element represents an enum constant.

      Returns:
        `true` if this element is an enum constant

    - #### public boolean isError()

      Indicates whether this element represents an error type.

      Returns:
        `true` if this element is an error

    - #### public boolean isException()

      Indicates whether this element represents an exception type.

      Returns:
        `true` if this element is an exception

    - #### public boolean isField()

      Indicates whether this element represents a field.

      Returns:
        `true` if this element is a field

    - #### public boolean isHidden()

      Indicates whether this doc element should be retained for internal model lookups but excluded from rendered output.

      Returns:
        `true` if this element is hidden from published docs
      Since:
        6.0.0

    - #### public boolean isIncluded()

      Indicates whether this element is included in the generated output.

      Returns:
        `true` if this element is included

    - #### public boolean isInterface()

      Indicates whether this element represents an interface.

      Returns:
        `true` if this element is an interface

    - #### public boolean isMarkdown()

      Indicates whether this documentation comment should be rendered as Markdown.

      Returns:
        `true` if Markdown rendering is enabled
      Since:
        6.0.0

    - #### public boolean isMethod()

      Indicates whether this element represents a method.

      Returns:
        `true` if this element is a method

    - #### public boolean isOrdinaryClass()

      Indicates whether this element represents an ordinary class.

      Returns:
        `true` if this element is an ordinary class

    - #### public boolean isRecord()

      Indicates whether this element represents a record type.

      Returns:
        `true` if this element is a record

    - #### public boolean isScript()

      Indicates whether this documented element represents a Groovy script.

      Returns:
        `true` if this element is a script

    - #### public boolean isTrait()

      Indicates whether this documented element represents a trait.

      Returns:
        `true` if this element is a trait

    - #### public String name()

      Returns the simple name of this documented element.

      Returns:
        the element name

    - #### protected void setCommentText(String commentText)

      Stores the rendered comment text for this element.

      Parameters:
        `commentText` - the rendered comment text

    - #### public void setDeprecated(boolean deprecated)

      Marks this documented element as deprecated or not deprecated.

      Parameters:
        `deprecated` - `true` if the element is deprecated

    - #### protected void setFirstSentenceCommentText(String firstSentenceCommentText)

      Stores the first-sentence summary for this element.

      Parameters:
        `firstSentenceCommentText` - the summary text

    - #### public void setHidden(boolean hidden)

      Sets whether this doc element should be hidden from rendered output while remaining available for internal resolution such as `inheritDoc`.

      Parameters:
        `hidden` - `true` if this element should be hidden
      Since:
        6.0.0

    - #### public void setMarkdown(boolean markdown)

      Sets whether this documentation comment should be rendered as Markdown.

      Parameters:
        `markdown` - `true` to enable Markdown rendering
      Since:
        6.0.0

    - #### public void setRawCommentText(String rawCommentText)

      Replaces the raw documentation comment for this element.

      Parameters:
        `arg0` - the raw comment text to store

    - #### public void setScript(boolean script)

      Marks this documented element as a script or ordinary class.

      Parameters:
        `script` - `true` if this element represents a script

    - #### public void setTokenType(int t)

      Sets the parsed token type for this element.

      Parameters:
        `t` - the token type

    - #### public GroovyTag[] tags()

      Returns the block tags parsed from the raw comment text.

      Returns:
        a defensive copy of the parsed tags, or `null` if tags have not been calculated

    - #### public String toString()

      Returns a debug-friendly representation of this documented element.

      Returns:
        the string form of this element

    - #### public int tokenType()

      Returns the parsed token type for this element.

      Returns:
        the token type