AbstractGrailsClass (Grails 6.0.0)

Package: org.grails.core

## [Java] Class AbstractGrailsClass

- org.grails.core.AbstractGrailsClass

- All Implemented Interfaces and Traits:
    GrailsClass

      public abstract class AbstractGrailsClass
      extends java.lang.Object
      implements GrailsClass

  Abstract base class for Grails types that provides common functionality for evaluating conventions within classes.

  Authors:
    Steven Devijver
    Graeme Rocher
  Since:
    0.1

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private org.grails.datastore.mapping.reflect.ClassPropertyFetcher` | `classPropertyFetcher` |
    `private java.lang.Class<?>` | `clazz` |
    `private java.lang.String` | `fullName` |
    `protected GrailsApplication` | `grailsApplication` |
    `private boolean` | `isAbstract` |
    `private java.lang.String` | `logicalPropertyName` |
    `private java.lang.String` | `name` |
    `private java.lang.String` | `naturalName` |
    `private java.lang.String` | `packageName` |
    `private java.lang.String` | `propertyName` |
    `private java.lang.String` | `shortName` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `AbstractGrailsClass (java.lang.Class<?> clazz, java.lang.String trailingName)` Used by all child classes to create a new instance and get the name right.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public GrailsApplication` | `getApplication()`
    `` | `public java.lang.Class<?>` | `getClazz()`
    `` | `public java.lang.String` | `getFullName()`
    `` | `public java.lang.String` | `getLogicalPropertyName()`
    `` | `public groovy.lang.MetaClass` | `getMetaClass()` Returns: the metaClass
    `` | `public java.util.List<groovy.lang.MetaProperty>` | `getMetaProperties()`
    `` | `public java.lang.String` | `getName()`
    `` | `public java.lang.String` | `getNaturalName()`
    `` | `public java.lang.String` | `getPackageName()`
    `` | `public java.lang.String` | `getPluginName()`
    `` | `public java.beans.PropertyDescriptor[]` | `getPropertyDescriptors()` deprecated: Use getMetaProperties() instead
    `` | `public java.lang.String` | `getPropertyName()`
    `<T>` | `protected T` | `getPropertyOrStaticPropertyOrFieldValue(java.lang.String name, java.lang.Class<T> type)`
    `` | `public java.lang.Class<?>` | `getPropertyType(java.lang.String typeName)`
    `<T>` | `public T` | `getPropertyValue(java.lang.String propName, java.lang.Class<T> type)` Get the value of the named property, with support for static properties in both Java and Groovy classes (which as of Groovy JSR 1.0 RC 01 only have getters in the metaClass)
    `` | `public java.lang.Object` | `getPropertyValue(java.lang.String propName)`
    `` | `public java.lang.Object` | `getPropertyValueObject(java.lang.String propertyNAme)`
    `` | `public java.lang.Object` | `getReferenceInstance()`
    `` | `public java.lang.String` | `getShortName()`
    `<T>` | `public T` | `getStaticPropertyValue(java.lang.String propName, java.lang.Class<T> type)` Get the value of the named static property.
    `` | `public boolean` | `hasMetaMethod(java.lang.String methodName)`
    `` | `public boolean` | `hasMetaMethod(java.lang.String methodName, java.lang.Object[] args)`
    `` | `public boolean` | `hasMetaProperty(java.lang.String propName)`
    `` | `public boolean` | `hasProperty(java.lang.String propName)`
    `` | `public boolean` | `isAbstract()`
    `` | `public boolean` | `isActionMethod(java.lang.String methodName)`
    `` | `public boolean` | `isReadableProperty(java.lang.String propName)`
    `` | `public java.lang.Object` | `newInstance()`
    `` | `private org.grails.datastore.mapping.reflect.ClassPropertyFetcher` | `resolvePropertyFetcher()`
    `` | `public void` | `setGrailsApplication(GrailsApplication grailsApplication)`
    `` | `public java.lang.String` | `toString()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### private org.grails.datastore.mapping.reflect.ClassPropertyFetcher classPropertyFetcher

    - #### private final java.lang.Class<?> clazz

    - #### private final java.lang.String fullName

    - #### protected GrailsApplication grailsApplication

    - #### private boolean isAbstract

    - #### private final java.lang.String logicalPropertyName

    - #### private final java.lang.String name

    - #### private final java.lang.String naturalName

    - #### private final java.lang.String packageName

    - #### private final java.lang.String propertyName

    - #### private final java.lang.String shortName

  - ### Constructor Detail

    - #### public AbstractGrailsClass(java.lang.Class<?> clazz, java.lang.String trailingName)

      Used by all child classes to create a new instance and get the name right.

      Parameters:
        `clazz` - the Grails class
        `trailingName` - the trailing part of the name for this class type

  - ### Method Detail

    - #### @java.lang.Override public GrailsApplication getApplication()

    - #### public java.lang.Class<?> getClazz()

    - #### public java.lang.String getFullName()

    - #### public java.lang.String getLogicalPropertyName()

    - #### public groovy.lang.MetaClass getMetaClass()

      Returns:
        the metaClass

    - #### public java.util.List<groovy.lang.MetaProperty> getMetaProperties()

    - #### public java.lang.String getName()

    - #### public java.lang.String getNaturalName()

    - #### public java.lang.String getPackageName()

    - #### @java.lang.Override public java.lang.String getPluginName()

    - #### @java.lang.Deprecated public java.beans.PropertyDescriptor[] getPropertyDescriptors()

      deprecated:
        Use getMetaProperties() instead

    - #### public java.lang.String getPropertyName()

    - #### <T> protected T getPropertyOrStaticPropertyOrFieldValue(java.lang.String name, java.lang.Class<T> type)

      Looks for a property of the reference instance with a given name and type.

      If found its value is returned. We follow the Java bean conventions with augmentation for groovy support and static fields/properties. We will therefore match, in this order:

      1. Public static field
      2. Public static property with getter method
      3. Standard public bean property (with getter or just public field, using normal introspection)
      Returns:
        property value or null if no property or static field was found

    - #### public java.lang.Class<?> getPropertyType(java.lang.String typeName)

    - #### <T> public T getPropertyValue(java.lang.String propName, java.lang.Class<T> type)

      Get the value of the named property, with support for static properties in both Java and Groovy classes (which as of Groovy JSR 1.0 RC 01 only have getters in the metaClass)

      Parameters:
        propName
        type
      Returns:
        The property value or null

    - #### public java.lang.Object getPropertyValue(java.lang.String propName)

    - #### public java.lang.Object getPropertyValueObject(java.lang.String propertyNAme)

    - #### public java.lang.Object getReferenceInstance()

    - #### public java.lang.String getShortName()

    - #### <T> public T getStaticPropertyValue(java.lang.String propName, java.lang.Class<T> type)

      Get the value of the named static property.

      Parameters:
        propName
        type
      Returns:
        The property value or null

    - #### public boolean hasMetaMethod(java.lang.String methodName)

    - #### public boolean hasMetaMethod(java.lang.String methodName, java.lang.Object[] args)

    - #### public boolean hasMetaProperty(java.lang.String propName)

    - #### public boolean hasProperty(java.lang.String propName)

    - #### public boolean isAbstract()

    - #### public boolean isActionMethod(java.lang.String methodName)

    - #### public boolean isReadableProperty(java.lang.String propName)

    - #### public java.lang.Object newInstance()

    - #### private org.grails.datastore.mapping.reflect.ClassPropertyFetcher resolvePropertyFetcher()

    - #### public void setGrailsApplication(GrailsApplication grailsApplication)

    - #### @java.lang.Override public java.lang.String toString()