Package: org.codehaus.groovy.tools.groovydoc

## [Java] Class SimpleGroovyFieldDoc

- org.codehaus.groovy.tools.groovydoc.SimpleGroovyFieldDoc

- All Implemented Interfaces and Traits:
    GroovyFieldDoc

      public class SimpleGroovyFieldDoc
      extends SimpleGroovyMemberDoc
      implements GroovyFieldDoc

  Default GroovyFieldDoc implementation.

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

  - ### Constructor Summary

    Constructors
    Constructor and description
    `SimpleGroovyFieldDoc(String name, GroovyClassDoc belongsToClass)` Creates a documented field owned by the supplied class.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Object` | `constantValue()` * Returns the constant value of this field when one is available. * * Returns: the constant value, or `null` if none is defined
    `` | `public String` | `constantValueExpression()` * Returns the source expression used to define the constant value. * * Returns: the constant value expression, or `null` if none is available
    `` | `public boolean` | `isTransient()` * Indicates whether this field is declared `transient`. * * Returns: `true` if this field is transient
    `` | `public boolean` | `isVolatile()` * Indicates whether this field is declared `volatile`. * * Returns: `true` if this field is volatile
    `` | `public void` | `setConstantValueExpression(String constantValueExpression)` Stores the source expression used to initialize this field's constant value.
    `` | `public void` | `setType(GroovyType type)` Sets the resolved type for this field.
    `` | `public GroovyType` | `type()` * Returns the declared type of this field. * * Returns: the field type

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class SimpleGroovyMemberDoc` | `commentText, firstSentenceCommentText, isSynthetic`
    `class SimpleGroovyAbstractableElementDoc` | `isAbstract, setAbstract`
    `class SimpleGroovyProgramElementDoc` | `addAnnotationRef, annotations, containingClass, containingPackage, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, modifierSpecifier, modifiers, qualifiedName, setContainingPackage, setFinal, setPackagePrivate, setPrivate, setProtected, setPublic, setStatic`
    `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 SimpleGroovyFieldDoc(String name, GroovyClassDoc belongsToClass)

      Creates a documented field owned by the supplied class.

      Parameters:
        `name` - the field name
        `belongsToClass` - the declaring class

  - ### Method Detail

    - #### public Object constantValue()

      * Returns the constant value of this field when one is available. * *

      Returns:
        the constant value, or `null` if none is defined

    - #### public String constantValueExpression()

      * Returns the source expression used to define the constant value. * *

      Returns:
        the constant value expression, or `null` if none is available

    - #### public boolean isTransient()

      * Indicates whether this field is declared `transient`. * *

      Returns:
        `true` if this field is transient

    - #### public boolean isVolatile()

      * Indicates whether this field is declared `volatile`. * *

      Returns:
        `true` if this field is volatile

    - #### public void setConstantValueExpression(String constantValueExpression)

      Stores the source expression used to initialize this field's constant value.

      Parameters:
        `constantValueExpression` - the constant value expression

    - #### public void setType(GroovyType type)

      Sets the resolved type for this field.

      Parameters:
        `type` - the field type

    - #### public GroovyType type()

      * Returns the declared type of this field. * *

      Returns:
        the field type