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
ConstructorsConstructorDescriptionCreates a documented program element with the supplied name. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an annotation declared on this element.Returns the annotations declared on this element.Returns the containing class for this element.Returns the package that contains this element.booleanisFinal()Indicates whether this element is declaredfinal.booleanIndicates whether this element has package-private visibility.booleanIndicates whether this element is declaredprivate.booleanIndicates whether this element is declaredprotected.booleanisPublic()Indicates whether this element is declaredpublic.booleanisStatic()Indicates whether this element is declaredstatic.Returns the rendered modifier text for this element.intReturns the modifier flags for this element.Returns the fully qualified name of this element.voidsetContainingPackage(GroovyPackageDoc packageDoc) Associates this element with its containing package.voidsetFinal(boolean b) Sets whether this element is final.voidsetPackagePrivate(boolean b) Sets whether this element has package-private visibility.voidsetPrivate(boolean b) Sets whether this element is private.voidsetProtected(boolean b) Sets whether this element is protected.voidsetPublic(boolean b) Sets whether this element is public.voidsetStatic(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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods 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
Creates a documented program element with the supplied name.- Parameters:
name- the element name
-
-
Method Details
-
containingPackage
Returns the package that contains this element.- Specified by:
containingPackagein interfaceGroovyProgramElementDoc- Returns:
- the containing package, or
nullif none is available
-
setContainingPackage
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-trueif the element is static
-
isStatic
public boolean isStatic()Indicates whether this element is declaredstatic.- Specified by:
isStaticin interfaceGroovyProgramElementDoc- Returns:
trueif this element is static
-
setFinal
public void setFinal(boolean b) Sets whether this element is final.- Parameters:
b-trueif the element is final
-
isFinal
public boolean isFinal()Indicates whether this element is declaredfinal.- Specified by:
isFinalin interfaceGroovyProgramElementDoc- Returns:
trueif this element is final
-
setPublic
public void setPublic(boolean b) Sets whether this element is public.- Parameters:
b-trueif the element is public
-
isPublic
public boolean isPublic()Indicates whether this element is declaredpublic.- Specified by:
isPublicin interfaceGroovyProgramElementDoc- Returns:
trueif this element is public
-
setProtected
public void setProtected(boolean b) Sets whether this element is protected.- Parameters:
b-trueif the element is protected
-
isProtected
public boolean isProtected()Indicates whether this element is declaredprotected.- Specified by:
isProtectedin interfaceGroovyProgramElementDoc- Returns:
trueif this element is protected
-
setPackagePrivate
public void setPackagePrivate(boolean b) Sets whether this element has package-private visibility.- Parameters:
b-trueif the element is package-private
-
isPackagePrivate
public boolean isPackagePrivate()Indicates whether this element has package-private visibility.- Specified by:
isPackagePrivatein interfaceGroovyProgramElementDoc- Returns:
trueif this element is package-private
-
setPrivate
public void setPrivate(boolean b) Sets whether this element is private.- Parameters:
b-trueif the element is private
-
isPrivate
public boolean isPrivate()Indicates whether this element is declaredprivate.- Specified by:
isPrivatein interfaceGroovyProgramElementDoc- Returns:
trueif this element is private
-
annotations
Returns the annotations declared on this element.- Specified by:
annotationsin interfaceGroovyProgramElementDoc- Returns:
- the declared annotations
-
addAnnotationRef
Adds an annotation declared on this element.- Parameters:
ref- the annotation reference to add
-
containingClass
Returns the containing class for this element.- Specified by:
containingClassin interfaceGroovyProgramElementDoc- Returns:
- the containing class, or
nullif this element is not nested within a class
-
modifiers
Returns the rendered modifier text for this element.- Specified by:
modifiersin interfaceGroovyProgramElementDoc- Returns:
- the modifier text
-
modifierSpecifier
public int modifierSpecifier()Returns the modifier flags for this element.- Specified by:
modifierSpecifierin interfaceGroovyProgramElementDoc- Returns:
- the modifier bit set
-
qualifiedName
Returns the fully qualified name of this element.- Specified by:
qualifiedNamein interfaceGroovyProgramElementDoc- Returns:
- the qualified name
-