Package org.codehaus.groovy.tools.groovydoc

# Class SimpleGroovyProgramElementDoc

java.lang.Object
org.codehaus.groovy.tools.groovydoc.SimpleGroovyDoc
org.codehaus.groovy.tools.groovydoc.SimpleGroovyProgramElementDoc

All Implemented Interfaces:
  `Comparable<GroovyDoc>`, `GroovyDoc`, `GroovyProgramElementDoc`

Direct Known Subclasses:
  `SimpleGroovyAbstractableElementDoc`

public class SimpleGroovyProgramElementDoc extends SimpleGroovyDoc implements GroovyProgramElementDoc
Base implementation for documented program elements with modifiers, package ownership, and annotations.

- ## Field Summary

  ### Fields inherited from class org.codehaus.groovy.tools.groovydoc.SimpleGroovyDoc

  `ANNOTATION_DEF, CLASS_DEF, ENUM_DEF, INTERFACE_DEF, RECORD_DEF, TRAIT_DEF`

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addAnnotationRef(GroovyAnnotationRef ref)`
  Adds an annotation declared on this element.
  `GroovyAnnotationRef[]`
  `annotations()`
  Returns the annotations declared on this element.
  `GroovyClassDoc`
  `containingClass()`
  Returns the containing class for this element.
  `GroovyPackageDoc`
  `containingPackage()`
  Returns the package that contains this element.
  `boolean`
  `isFinal()`
  Indicates whether this element is declared `final`.
  `boolean`
  `isPackagePrivate()`
  Indicates whether this element has package-private visibility.
  `boolean`
  `isPrivate()`
  Indicates whether this element is declared `private`.
  `boolean`
  `isProtected()`
  Indicates whether this element is declared `protected`.
  `boolean`
  `isPublic()`
  Indicates whether this element is declared `public`.
  `boolean`
  `isStatic()`
  Indicates whether this element is declared `static`.
  `String`
  `modifiers()`
  Returns the rendered modifier text for this element.
  `int`
  `modifierSpecifier()`
  Returns the modifier flags for this element.
  `String`
  `qualifiedName()`
  Returns the fully qualified name of this element.
  `void`
  `setContainingPackage(GroovyPackageDoc packageDoc)`
  Associates this element with its containing package.
  `void`
  `setFinal(boolean b)`
  Sets whether this element is final.
  `void`
  `setPackagePrivate(boolean b)`
  Sets whether this element has package-private visibility.
  `void`
  `setPrivate(boolean b)`
  Sets whether this element is private.
  `void`
  `setProtected(boolean b)`
  Sets whether this element is protected.
  `void`
  `setPublic(boolean b)`
  Sets whether this element is public.
  `void`
  `setStatic(boolean b)`
  Sets whether this element is static.

  ### Methods inherited from class org.codehaus.groovy.tools.groovydoc.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, tokenType, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.lang.Comparable

  `compareTo`

  ### Methods inherited from interface org.codehaus.groovy.groovydoc.GroovyDoc

  `commentText, firstSentenceCommentText, getRawCommentText, isAnnotationType, isAnnotationTypeElement, isClass, isConstructor, isDeprecated, isEnum, isEnumConstant, isError, isException, isField, isIncluded, isInterface, isMethod, isOrdinaryClass, isRecord, name, setRawCommentText`

- ## Constructor Details

  - ### SimpleGroovyProgramElementDoc

    public SimpleGroovyProgramElementDoc(String name)
    Creates a documented program element with the supplied name.
    Parameters:
      `name` - the element name

- ## Method Details

  - ### containingPackage

    public GroovyPackageDoc containingPackage()
    Returns the package that contains this element.
    Specified by:
      `containingPackage` in interface `GroovyProgramElementDoc`
    Returns:
      the containing package, or `null` if none is available

  - ### setContainingPackage

    public void setContainingPackage(GroovyPackageDoc packageDoc)
    Associates this element with its containing package.
    Parameters:
      `packageDoc` - the containing package

  - ### setStatic

    public void setStatic(boolean b)
    Sets whether this element is static.
    Parameters:
      `b` - `true` if the element is static

  - ### isStatic

    public boolean isStatic()
    Indicates whether this element is declared `static`.
    Specified by:
      `isStatic` in interface `GroovyProgramElementDoc`
    Returns:
      `true` if this element is static

  - ### setFinal

    public void setFinal(boolean b)
    Sets whether this element is final.
    Parameters:
      `b` - `true` if the element is final

  - ### isFinal

    public boolean isFinal()
    Indicates whether this element is declared `final`.
    Specified by:
      `isFinal` in interface `GroovyProgramElementDoc`
    Returns:
      `true` if this element is final

  - ### setPublic

    public void setPublic(boolean b)
    Sets whether this element is public.
    Parameters:
      `b` - `true` if the element is public

  - ### isPublic

    public boolean isPublic()
    Indicates whether this element is declared `public`.
    Specified by:
      `isPublic` in interface `GroovyProgramElementDoc`
    Returns:
      `true` if this element is public

  - ### setProtected

    public void setProtected(boolean b)
    Sets whether this element is protected.
    Parameters:
      `b` - `true` if the element is protected

  - ### isProtected

    public boolean isProtected()
    Indicates whether this element is declared `protected`.
    Specified by:
      `isProtected` in interface `GroovyProgramElementDoc`
    Returns:
      `true` if this element is protected

  - ### setPackagePrivate

    public void setPackagePrivate(boolean b)
    Sets whether this element has package-private visibility.
    Parameters:
      `b` - `true` if the element is package-private

  - ### isPackagePrivate

    public boolean isPackagePrivate()
    Indicates whether this element has package-private visibility.
    Specified by:
      `isPackagePrivate` in interface `GroovyProgramElementDoc`
    Returns:
      `true` if this element is package-private

  - ### setPrivate

    public void setPrivate(boolean b)
    Sets whether this element is private.
    Parameters:
      `b` - `true` if the element is private

  - ### isPrivate

    public boolean isPrivate()
    Indicates whether this element is declared `private`.
    Specified by:
      `isPrivate` in interface `GroovyProgramElementDoc`
    Returns:
      `true` if this element is private

  - ### annotations

    public GroovyAnnotationRef[] annotations()
    Returns the annotations declared on this element.
    Specified by:
      `annotations` in interface `GroovyProgramElementDoc`
    Returns:
      the declared annotations

  - ### addAnnotationRef

    public void addAnnotationRef(GroovyAnnotationRef ref)
    Adds an annotation declared on this element.
    Parameters:
      `ref` - the annotation reference to add

  - ### containingClass

    public GroovyClassDoc containingClass()
    Returns the containing class for this element.
    Specified by:
      `containingClass` in interface `GroovyProgramElementDoc`
    Returns:
      the containing class, or `null` if this element is not nested within a class

  - ### modifiers

    public String modifiers()
    Returns the rendered modifier text for this element.
    Specified by:
      `modifiers` in interface `GroovyProgramElementDoc`
    Returns:
      the modifier text

  - ### modifierSpecifier

    public int modifierSpecifier()
    Returns the modifier flags for this element.
    Specified by:
      `modifierSpecifier` in interface `GroovyProgramElementDoc`
    Returns:
      the modifier bit set

  - ### qualifiedName

    public String qualifiedName()
    Returns the fully qualified name of this element.
    Specified by:
      `qualifiedName` in interface `GroovyProgramElementDoc`
    Returns:
      the qualified name