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.
  • 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