Package: org.codehaus.groovy.tools.groovydoc

## [Java] Class SimpleGroovyProgramElementDoc

- org.codehaus.groovy.tools.groovydoc.SimpleGroovyProgramElementDoc

- All Implemented Interfaces and Traits:
    GroovyProgramElementDoc

      public class SimpleGroovyProgramElementDoc
      extends SimpleGroovyDoc
      implements GroovyProgramElementDoc

  Base implementation for documented program elements with modifiers, package ownership, and annotations.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class SimpleGroovyDoc` | `ANNOTATION_DEF, CLASS_DEF, ENUM_DEF, INTERFACE_DEF, RECORD_DEF, TRAIT_DEF`

  - ### Constructor Summary

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

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `addAnnotationRef(GroovyAnnotationRef ref)` Adds an annotation declared on this element.
    `` | `public GroovyAnnotationRef[]` | `annotations()` Returns the annotations declared on this element. Returns: the declared annotations
    `` | `public GroovyClassDoc` | `containingClass()` Returns the containing class for this element. Returns: the containing class, or `null` if this element is not nested within a class
    `` | `public GroovyPackageDoc` | `containingPackage()` Returns the package that contains this element. Returns: the containing package, or `null` if none is available
    `` | `public boolean` | `isFinal()` Indicates whether this element is declared `final`. Returns: `true` if this element is final
    `` | `public boolean` | `isPackagePrivate()` Indicates whether this element has package-private visibility. Returns: `true` if this element is package-private
    `` | `public boolean` | `isPrivate()` Indicates whether this element is declared `private`. Returns: `true` if this element is private
    `` | `public boolean` | `isProtected()` Indicates whether this element is declared `protected`. Returns: `true` if this element is protected
    `` | `public boolean` | `isPublic()` Indicates whether this element is declared `public`. Returns: `true` if this element is public
    `` | `public boolean` | `isStatic()` Indicates whether this element is declared `static`. Returns: `true` if this element is static
    `` | `public int` | `modifierSpecifier()` Returns the modifier flags for this element. Returns: the modifier bit set
    `` | `public String` | `modifiers()` Returns the rendered modifier text for this element. Returns: the modifier text
    `` | `public String` | `qualifiedName()` Returns the fully qualified name of this element. Returns: the qualified name
    `` | `public void` | `setContainingPackage(GroovyPackageDoc packageDoc)` Associates this element with its containing package.
    `` | `public void` | `setFinal(boolean b)` Sets whether this element is final.
    `` | `public void` | `setPackagePrivate(boolean b)` Sets whether this element has package-private visibility.
    `` | `public void` | `setPrivate(boolean b)` Sets whether this element is private.
    `` | `public void` | `setProtected(boolean b)` Sets whether this element is protected.
    `` | `public void` | `setPublic(boolean b)` Sets whether this element is public.
    `` | `public void` | `setStatic(boolean b)` Sets whether this element is static.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class SimpleGroovyDoc` | `calculateFirstSentence, commentText, compareTo, firstSentenceCommentText, getRawCommentText, getTypeDescription, getTypeSourceDescription, isAnnotationType, isAnnotationTypeElement, isClass, isConstructor, isDeprecated, isEnum, isEnumConstant, isError, isException, isField, isHidden, isIncluded, isInterface, isMarkdown, isMethod, isOrdinaryClass, isRecord, isScript, isTrait, name, setCommentText, setDeprecated, setFirstSentenceCommentText, setHidden, setMarkdown, setRawCommentText, setScript, setTokenType, tags, toString, tokenType`

- - ### Constructor Detail

    - #### public SimpleGroovyProgramElementDoc(String name)

      Creates a documented program element with the supplied name.

      Parameters:
        `name` - the element name

  - ### Method Detail

    - #### public void addAnnotationRef(GroovyAnnotationRef ref)

      Adds an annotation declared on this element.

      Parameters:
        `ref` - the annotation reference to add

    - #### public GroovyAnnotationRef[] annotations()

      Returns the annotations declared on this element.

      Returns:
        the declared annotations

    - #### public GroovyClassDoc containingClass()

      Returns the containing class for this element.

      Returns:
        the containing class, or `null` if this element is not nested within a class

    - #### public GroovyPackageDoc containingPackage()

      Returns the package that contains this element.

      Returns:
        the containing package, or `null` if none is available

    - #### public boolean isFinal()

      Indicates whether this element is declared `final`.

      Returns:
        `true` if this element is final

    - #### public boolean isPackagePrivate()

      Indicates whether this element has package-private visibility.

      Returns:
        `true` if this element is package-private

    - #### public boolean isPrivate()

      Indicates whether this element is declared `private`.

      Returns:
        `true` if this element is private

    - #### public boolean isProtected()

      Indicates whether this element is declared `protected`.

      Returns:
        `true` if this element is protected

    - #### public boolean isPublic()

      Indicates whether this element is declared `public`.

      Returns:
        `true` if this element is public

    - #### public boolean isStatic()

      Indicates whether this element is declared `static`.

      Returns:
        `true` if this element is static

    - #### public int modifierSpecifier()

      Returns the modifier flags for this element.

      Returns:
        the modifier bit set

    - #### public String modifiers()

      Returns the rendered modifier text for this element.

      Returns:
        the modifier text

    - #### public String qualifiedName()

      Returns the fully qualified name of this element.

      Returns:
        the qualified name

    - #### public void setContainingPackage(GroovyPackageDoc packageDoc)

      Associates this element with its containing package.

      Parameters:
        `packageDoc` - the containing package

    - #### public void setFinal(boolean b)

      Sets whether this element is final.

      Parameters:
        `b` - `true` if the element is final

    - #### public void setPackagePrivate(boolean b)

      Sets whether this element has package-private visibility.

      Parameters:
        `b` - `true` if the element is package-private

    - #### public void setPrivate(boolean b)

      Sets whether this element is private.

      Parameters:
        `b` - `true` if the element is private

    - #### public void setProtected(boolean b)

      Sets whether this element is protected.

      Parameters:
        `b` - `true` if the element is protected

    - #### public void setPublic(boolean b)

      Sets whether this element is public.

      Parameters:
        `b` - `true` if the element is public

    - #### public void setStatic(boolean b)

      Sets whether this element is static.

      Parameters:
        `b` - `true` if the element is static