GrailsControllerClass (Grails 6.0.0)

Package: grails.core

## [Java] Interface GrailsControllerClass

- grails.core.support.GrailsApplicationAware

- All Superinterfaces:
    InjectableGrailsClass, GrailsClass, GrailsApplicationAware

      public interface GrailsControllerClass
      extends InjectableGrailsClass

  Represents a controller class in Grails.

  Authors:
    Steven Devijver
    Graeme Rocher
  Since:
    1.0

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `java.lang.String` | `ACTION` | The general name to use when referring to action artefacts.
    `java.lang.String` | `AFTER_INTERCEPTOR` | The name of the after interceptor property.
    `java.lang.String` | `BEFORE_INTERCEPTOR` | The name of the before interceptor property.
    `java.lang.String` | `CONTROLLER` | The general name to use when referring to controller artefacts.
    `java.lang.String` | `INDEX_ACTION` | The name of the index action.
    `java.lang.String` | `NAMESPACE_PROPERTY` | The name of the namespace property
    `java.lang.String` | `VIEW` | The general name to use when referring to action view.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public java.lang.String` | `actionUriToViewName(java.lang.String actionUri)`
    `` | `public java.util.Set<java.lang.String>` | `getActions()` Returns: The action names
    `` | `public java.lang.String` | `getDefaultAction()` Returns the default action for this Controller.
    `` | `public java.lang.String` | `getNamespace()` Returns: the namespace of this controller, null if none was specified
    `` | `public java.lang.String` | `getScope()` Returns: The scope of the controller, defaults to singleton
    `` | `public void` | `initialize()` Initialize the controller class
    `` | `public java.lang.Object` | `invoke(java.lang.Object controller, java.lang.String action)` Invokes a controller action on the given controller instance
    `` | `public boolean` | `isSingleton()` Returns: Whether the scope is singleton
    `` | `public boolean` | `mapsToURI(java.lang.String uri)` Tests if a controller maps to a given URI.
    `` | `public void` | `registerUrlConverter(UrlConverter urlConverter)` Register a new UrlConverter with the controller

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface InjectableGrailsClass` | `byName, byType, getAvailable`
    `interface GrailsClass` | `getApplication, getClazz, getFullName, getLogicalPropertyName, getMetaClass, getName, getNaturalName, getPackageName, getPluginName, getPropertyName, getPropertyValue, getPropertyValue, getReferenceInstance, getShortName, hasProperty, isAbstract, newInstance`
    `interface GrailsApplicationAware` | `setGrailsApplication`

- - ### Field Detail

    - #### java.lang.String ACTION

      The general name to use when referring to action artefacts.

    - #### java.lang.String AFTER_INTERCEPTOR

      The name of the after interceptor property.

    - #### java.lang.String BEFORE_INTERCEPTOR

      The name of the before interceptor property.

    - #### java.lang.String CONTROLLER

      The general name to use when referring to controller artefacts.

    - #### java.lang.String INDEX_ACTION

      The name of the index action.

    - #### java.lang.String NAMESPACE_PROPERTY

      The name of the namespace property

    - #### java.lang.String VIEW

      The general name to use when referring to action view.

  - ### Method Detail

    - #### public java.lang.String actionUriToViewName(java.lang.String actionUri)

    - #### public java.util.Set<java.lang.String> getActions()

      Returns:
        The action names

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

      Returns the default action for this Controller.

      Returns:
        The default action

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

      Returns:
        the namespace of this controller, null if none was specified

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

      Returns:
        The scope of the controller, defaults to singleton

    - #### public void initialize()

      Initialize the controller class

    - #### public java.lang.Object invoke(java.lang.Object controller, java.lang.String action)

      Invokes a controller action on the given controller instance

      throws:
        Throwable Thrown when an error occurs invoking the action
      Parameters:
        `controller` - The controller instance
        `action` - The action
      Returns:
        The result of the action

    - #### public boolean isSingleton()

      Returns:
        Whether the scope is singleton

    - #### public boolean mapsToURI(java.lang.String uri)

      Tests if a controller maps to a given URI.

      Returns:
        true if controller maps to URI

    - #### public void registerUrlConverter(UrlConverter urlConverter)

      Register a new UrlConverter with the controller

      Parameters:
        `urlConverter` - The UrlConverter to register