Package grails.core
Interface GrailsControllerClass
-
- All Superinterfaces:
org.springframework.beans.factory.Aware,GrailsApplicationAware,GrailsClass,InjectableGrailsClass
- All Known Implementing Classes:
DefaultGrailsControllerClass
public interface GrailsControllerClass extends InjectableGrailsClass
Represents a controller class in Grails.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACTIONThe general name to use when referring to action artefacts.static java.lang.StringAFTER_INTERCEPTORThe name of the after interceptor property.static java.lang.StringBEFORE_INTERCEPTORThe name of the before interceptor property.static java.lang.StringCONTROLLERThe general name to use when referring to controller artefacts.static java.lang.StringINDEX_ACTIONThe name of the index action.static java.lang.StringNAMESPACE_PROPERTYThe name of the namespace propertystatic java.lang.StringVIEWThe general name to use when referring to action view.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringactionUriToViewName(java.lang.String actionUri)java.util.Set<java.lang.String>getActions()java.lang.StringgetDefaultAction()Returns the default action for this Controller.java.lang.StringgetNamespace()java.lang.StringgetScope()voidinitialize()Initialize the controller classjava.lang.Objectinvoke(java.lang.Object controller, java.lang.String action)Invokes a controller action on the given controller instancebooleanisSingleton()booleanmapsToURI(java.lang.String uri)Tests if a controller maps to a given URI.voidregisterUrlConverter(UrlConverter urlConverter)Register a newUrlConverterwith the controller-
Methods inherited from interface grails.core.support.GrailsApplicationAware
setGrailsApplication
-
Methods inherited from interface grails.core.GrailsClass
getApplication, getClazz, getFullName, getLogicalPropertyName, getMetaClass, getName, getNaturalName, getPackageName, getPluginName, getPropertyName, getPropertyValue, getPropertyValue, getReferenceInstance, getShortName, hasProperty, isAbstract, newInstance
-
Methods inherited from interface grails.core.InjectableGrailsClass
byName, byType, getAvailable
-
-
-
-
Field Detail
-
INDEX_ACTION
static final java.lang.String INDEX_ACTION
The name of the index action.- See Also:
- Constant Field Values
-
BEFORE_INTERCEPTOR
static final java.lang.String BEFORE_INTERCEPTOR
The name of the before interceptor property.- See Also:
- Constant Field Values
-
AFTER_INTERCEPTOR
static final java.lang.String AFTER_INTERCEPTOR
The name of the after interceptor property.- See Also:
- Constant Field Values
-
CONTROLLER
static final java.lang.String CONTROLLER
The general name to use when referring to controller artefacts.- See Also:
- Constant Field Values
-
ACTION
static final java.lang.String ACTION
The general name to use when referring to action artefacts.- See Also:
- Constant Field Values
-
VIEW
static final java.lang.String VIEW
The general name to use when referring to action view.- See Also:
- Constant Field Values
-
NAMESPACE_PROPERTY
static final java.lang.String NAMESPACE_PROPERTY
The name of the namespace property- See Also:
- Constant Field Values
-
-
Method Detail
-
getActions
java.util.Set<java.lang.String> getActions()
- Returns:
- The action names
-
getNamespace
java.lang.String getNamespace()
- Returns:
- the namespace of this controller, null if none was specified
-
getScope
java.lang.String getScope()
- Returns:
- The scope of the controller, defaults to singleton
-
isSingleton
boolean isSingleton()
- Returns:
- Whether the scope is singleton
-
getDefaultAction
java.lang.String getDefaultAction()
Returns the default action for this Controller.- Returns:
- The default action
-
initialize
void initialize()
Initialize the controller class
-
mapsToURI
boolean mapsToURI(java.lang.String uri)
Tests if a controller maps to a given URI.- Returns:
- true if controller maps to URI
-
invoke
java.lang.Object invoke(java.lang.Object controller, java.lang.String action) throws java.lang.ThrowableInvokes a controller action on the given controller instance- Parameters:
controller- The controller instanceaction- The action- Returns:
- The result of the action
- Throws:
java.lang.Throwable- Thrown when an error occurs invoking the action
-
registerUrlConverter
void registerUrlConverter(UrlConverter urlConverter)
Register a newUrlConverterwith the controller- Parameters:
urlConverter- TheUrlConverterto register
-
actionUriToViewName
java.lang.String actionUriToViewName(java.lang.String actionUri)
-
-