Package org.codehaus.groovy.tools.groovydoc

# Class SimpleGroovyFieldDoc

java.lang.Object
org.codehaus.groovy.tools.groovydoc.SimpleGroovyDoc
org.codehaus.groovy.tools.groovydoc.SimpleGroovyProgramElementDoc
org.codehaus.groovy.tools.groovydoc.SimpleGroovyAbstractableElementDoc
org.codehaus.groovy.tools.groovydoc.SimpleGroovyMemberDoc
org.codehaus.groovy.tools.groovydoc.SimpleGroovyFieldDoc

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

public class SimpleGroovyFieldDoc extends SimpleGroovyMemberDoc implements GroovyFieldDoc
Default `GroovyFieldDoc` implementation.

- ## Field Summary

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

  `belongsToClass`

  ### 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
  `SimpleGroovyFieldDoc(String name, GroovyClassDoc belongsToClass)`
  Creates a documented field owned by the supplied class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `constantValue()`
  Returns the constant value of this field when one is available.
  `String`
  `constantValueExpression()`
  Returns the source expression used to define the constant value.
  `boolean`
  `isTransient()`
  Indicates whether this field is declared `transient`.
  `boolean`
  `isVolatile()`
  Indicates whether this field is declared `volatile`.
  `void`
  `setConstantValueExpression(String constantValueExpression)`
  Stores the source expression used to initialize this field's constant value.
  `void`
  `setType(GroovyType type)`
  Sets the resolved type for this field.
  `GroovyType`
  `type()`
  Returns the declared type of this field.

  ### Methods inherited from class org.codehaus.groovy.tools.groovydoc.SimpleGroovyMemberDoc

  `commentText, firstSentenceCommentText, isSynthetic`

  ### Methods inherited from class org.codehaus.groovy.tools.groovydoc.SimpleGroovyAbstractableElementDoc

  `isAbstract, setAbstract`

  ### Methods inherited from class org.codehaus.groovy.tools.groovydoc.SimpleGroovyProgramElementDoc

  `addAnnotationRef, annotations, containingClass, containingPackage, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, modifiers, modifierSpecifier, qualifiedName, setContainingPackage, setFinal, setPackagePrivate, setPrivate, setProtected, setPublic, setStatic`

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

  `calculateFirstSentence, compareTo, 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`

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

  `isSynthetic`

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

  `annotations, containingClass, containingPackage, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, modifiers, modifierSpecifier, qualifiedName`

- ## Constructor Details

  - ### SimpleGroovyFieldDoc

    public SimpleGroovyFieldDoc(String name, GroovyClassDoc belongsToClass)
    Creates a documented field owned by the supplied class.
    Parameters:
      `name` - the field name
      `belongsToClass` - the declaring class

- ## Method Details

  - ### constantValue

    public Object constantValue()
    Returns the constant value of this field when one is available.
    Specified by:
      `constantValue` in interface `GroovyFieldDoc`
    Returns:
      the constant value, or `null` if none is defined

  - ### setConstantValueExpression

    public void setConstantValueExpression(String constantValueExpression)
    Stores the source expression used to initialize this field's constant value.
    Parameters:
      `constantValueExpression` - the constant value expression

  - ### constantValueExpression

    public String constantValueExpression()
    Returns the source expression used to define the constant value.
    Specified by:
      `constantValueExpression` in interface `GroovyFieldDoc`
    Returns:
      the constant value expression, or `null` if none is available

  - ### isTransient

    public boolean isTransient()
    Indicates whether this field is declared `transient`.
    Specified by:
      `isTransient` in interface `GroovyFieldDoc`
    Returns:
      `true` if this field is transient

  - ### isVolatile

    public boolean isVolatile()
    Indicates whether this field is declared `volatile`.
    Specified by:
      `isVolatile` in interface `GroovyFieldDoc`
    Returns:
      `true` if this field is volatile

  - ### type

    public GroovyType type()
    Returns the declared type of this field.
    Specified by:
      `type` in interface `GroovyFieldDoc`
    Returns:
      the field type

  - ### setType

    public void setType(GroovyType type)
    Sets the resolved type for this field.
    Parameters:
      `type` - the field type