public class DefaultGrailsControllerClass extends AbstractInjectableGrailsClass implements GrailsControllerClass
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ALLOWED_HTTP_METHODS_PROPERTY |
static java.lang.String |
CONTROLLER |
grailsApplicationAFTER_INTERCEPTOR, BEFORE_INTERCEPTOR, INDEX_ACTION, NAMESPACE_PROPERTY, VIEW| Constructor and Description |
|---|
DefaultGrailsControllerClass(java.lang.Class<?> clazz) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
doCheckIsHttpMethodAllowedForAction(groovy.lang.GroovyObject controller,
java.lang.String httpMethod,
java.lang.String actionName) |
groovy.lang.Closure |
getAfterInterceptor(groovy.lang.GroovyObject controller)
Retrieves the after interceptor for the specified controller instance.
|
groovy.lang.Closure |
getBeforeInterceptor(groovy.lang.GroovyObject controller)
Retrieves the before interceptor for the specified controller instance.
|
java.util.Set |
getCommandObjectActions()
Deprecated.
This method is deprecated and will be removed in a future version of Grails
|
java.util.Set |
getCommandObjectClasses()
Deprecated.
This method is deprecated and will be removed in a future version of Grails
|
java.lang.String |
getDefaultAction()
Returns the default action for this Controller.
|
java.util.Map<java.lang.String,groovy.lang.Closure> |
getFlows()
Returns a map of the flows for this controller.
|
java.lang.String |
getMethodActionName(java.lang.String uri)
Returns a closure property name for a specific URI or null if the URI does not map to a closure.
|
java.lang.String |
getNamespace() |
java.lang.String[] |
getURIs()
Gets the list of all possible URI's available in this controller.
|
java.lang.String |
getViewByName(java.lang.String viewName)
Retrieves the view name for the specified closure name.
|
java.lang.String |
getViewByURI(java.lang.String uri)
Retrieves the view name for the specified URI.
|
void |
initialize()
Initialize the controller class
|
boolean |
isFlowAction(java.lang.String actionName)
Returns true if the given action name is a flow action.
|
boolean |
isHttpMethodAllowedForAction(groovy.lang.GroovyObject controller,
java.lang.String httpMethod,
java.lang.String actionName)
Checks to see if an action is accessible via a particular http method.
|
boolean |
isInterceptedAfter(groovy.lang.GroovyObject controller,
java.lang.String action)
Checks whether the specified action is intercepted after for the specified
controller instance.
|
boolean |
isInterceptedBefore(groovy.lang.GroovyObject controller,
java.lang.String action)
Checks whether the specified action is intercepted for the
specified controller instance.
|
boolean |
mapsToURI(java.lang.String uri)
Tests if a controller maps to a given URI.
|
void |
registerMapping(java.lang.String actionName)
Registers a new mapping onto this controller for the given actionName.
|
void |
setDefaultActionName(java.lang.String defaultActionName)
Sets the name of the default action.
|
byName, byType, getAvailablegetClazz, getFullName, getGrailsApplication, getLogicalPropertyName, getMetaClass, getName, getNaturalName, getPackageName, getPropertyDescriptors, getPropertyName, getPropertyOrStaticPropertyOrFieldValue, getPropertyType, getPropertyValue, getPropertyValue, getPropertyValueObject, getReference, getReferenceInstance, getShortName, getStaticPropertyValue, hasMetaMethod, hasMetaMethod, hasMetaProperty, hasProperty, isAbstract, isActionMethod, isReadableProperty, newInstance, setGrailsApplication, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbyName, byType, getAvailablegetClazz, getFullName, getGrailsApplication, getLogicalPropertyName, getMetaClass, getName, getNaturalName, getPackageName, getPropertyName, getPropertyValue, getPropertyValue, getReference, getReferenceInstance, getShortName, hasProperty, isAbstract, newInstancesetGrailsApplicationpublic static final java.lang.String CONTROLLER
public static final java.lang.String ALLOWED_HTTP_METHODS_PROPERTY
public DefaultGrailsControllerClass(java.lang.Class<?> clazz)
public void setDefaultActionName(java.lang.String defaultActionName)
GrailsControllerClasssetDefaultActionName in interface GrailsControllerClassdefaultActionName - The default action namepublic void initialize()
GrailsControllerClassinitialize in interface GrailsControllerClasspublic java.lang.String[] getURIs()
GrailsControllerClassgetURIs in interface GrailsControllerClasspublic boolean mapsToURI(java.lang.String uri)
GrailsControllerClassmapsToURI in interface GrailsControllerClasspublic java.lang.String getViewByURI(java.lang.String uri)
GrailsControllerClassgetViewByURI in interface GrailsControllerClassuri - the name of URIpublic java.lang.String getMethodActionName(java.lang.String uri)
GrailsControllerClassgetMethodActionName in interface GrailsControllerClassuri - the URI of the requestpublic java.lang.String getViewByName(java.lang.String viewName)
GrailsControllerClassgetViewByName in interface GrailsControllerClassviewName - The name of the closurepublic boolean isInterceptedBefore(groovy.lang.GroovyObject controller,
java.lang.String action)
GrailsControllerClassisInterceptedBefore in interface GrailsControllerClasscontroller - The instance of the controlleraction - The action to checkpublic boolean isHttpMethodAllowedForAction(groovy.lang.GroovyObject controller,
java.lang.String httpMethod,
java.lang.String actionName)
GrailsControllerClassisHttpMethodAllowedForAction in interface GrailsControllerClasscontroller - The instance of the controllerhttpMethod - The http request methodactionName - The action to checkprotected boolean doCheckIsHttpMethodAllowedForAction(groovy.lang.GroovyObject controller,
java.lang.String httpMethod,
java.lang.String actionName)
public boolean isInterceptedAfter(groovy.lang.GroovyObject controller,
java.lang.String action)
GrailsControllerClassisInterceptedAfter in interface GrailsControllerClasscontroller - The controller instanceaction - The action to checkpublic groovy.lang.Closure getBeforeInterceptor(groovy.lang.GroovyObject controller)
GrailsControllerClassgetBeforeInterceptor in interface GrailsControllerClasscontroller - The controller instancepublic groovy.lang.Closure getAfterInterceptor(groovy.lang.GroovyObject controller)
GrailsControllerClassgetAfterInterceptor in interface GrailsControllerClasscontroller - The controller instance@Deprecated public java.util.Set getCommandObjectActions()
getCommandObjectActions in interface GrailsControllerClass@Deprecated public java.util.Set getCommandObjectClasses()
getCommandObjectClasses in interface GrailsControllerClasspublic java.util.Map<java.lang.String,groovy.lang.Closure> getFlows()
GrailsControllerClassReturns a map of the flows for this controller. A flow is an action that ends with the convention "Flow". The keys in the map are the flow ids which are the text before the "Flow" suffix. For example a flow called "bookFlow" would have a key of "book"
The values within the Map are Groovy closures (@see groovy.lang.Closure) which represent the flow definition
getFlows in interface GrailsControllerClasspublic boolean isFlowAction(java.lang.String actionName)
GrailsControllerClassisFlowAction in interface GrailsControllerClassactionName - The name of the actionpublic java.lang.String getDefaultAction()
GrailsControllerClassgetDefaultAction in interface GrailsControllerClasspublic java.lang.String getNamespace()
getNamespace in interface GrailsControllerClasspublic void registerMapping(java.lang.String actionName)
GrailsControllerClassregisterMapping in interface GrailsControllerClassactionName - The actionName