public class DefaultGrailsControllerClass extends AbstractInjectableGrailsClass implements GrailsControllerClass
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTROLLER |
AFTER_INTERCEPTOR, BEFORE_INTERCEPTOR, INDEX_ACTION, VIEW
Constructor and Description |
---|
DefaultGrailsControllerClass(java.lang.Class<?> clazz) |
Modifier and Type | Method and Description |
---|---|
Closure |
getAfterInterceptor(GroovyObject controller)
Retrieves the after interceptor for the specified controller instance.
|
Closure |
getBeforeInterceptor(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,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[] |
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(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(GroovyObject controller,
java.lang.String action)
Checks whether the specified action is intercepted after for the specified
controller instance.
|
boolean |
isInterceptedBefore(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, getAvailable
getClazz, getFullName, getGrailsApplication, getLogicalPropertyName, getMetaClass, getName, getNaturalName, getPackageName, getPropertyDescriptors, getPropertyName, getPropertyType, getPropertyValue, getPropertyValue, getPropertyValueObject, getReference, getReferenceInstance, getShortName, getStaticPropertyValue, hasMetaMethod, hasMetaMethod, hasMetaProperty, hasProperty, isAbstract, isActionMethod, isReadableProperty, newInstance, setGrailsApplication, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
byName, byType, getAvailable
getClazz, getFullName, getGrailsApplication, getLogicalPropertyName, getMetaClass, getName, getNaturalName, getPackageName, getPropertyName, getPropertyValue, getPropertyValue, getReference, getReferenceInstance, getShortName, hasProperty, isAbstract, newInstance
setGrailsApplication
public static final java.lang.String CONTROLLER
public DefaultGrailsControllerClass(java.lang.Class<?> clazz)
public void setDefaultActionName(java.lang.String defaultActionName)
GrailsControllerClass
setDefaultActionName
in interface GrailsControllerClass
defaultActionName
- The default action namepublic void initialize()
GrailsControllerClass
initialize
in interface GrailsControllerClass
public java.lang.String[] getURIs()
GrailsControllerClass
getURIs
in interface GrailsControllerClass
public boolean mapsToURI(java.lang.String uri)
GrailsControllerClass
mapsToURI
in interface GrailsControllerClass
public java.lang.String getViewByURI(java.lang.String uri)
GrailsControllerClass
getViewByURI
in interface GrailsControllerClass
uri
- the name of URIpublic java.lang.String getMethodActionName(java.lang.String uri)
GrailsControllerClass
getMethodActionName
in interface GrailsControllerClass
uri
- the URI of the requestpublic java.lang.String getViewByName(java.lang.String viewName)
GrailsControllerClass
getViewByName
in interface GrailsControllerClass
viewName
- The name of the closurepublic boolean isInterceptedBefore(GroovyObject controller, java.lang.String action)
GrailsControllerClass
isInterceptedBefore
in interface GrailsControllerClass
controller
- The instance of the controlleraction
- The action to checkpublic boolean isHttpMethodAllowedForAction(GroovyObject controller, java.lang.String httpMethod, java.lang.String actionName)
GrailsControllerClass
isHttpMethodAllowedForAction
in interface GrailsControllerClass
controller
- The instance of the controllerhttpMethod
- The http request methodactionName
- The action to checkpublic boolean isInterceptedAfter(GroovyObject controller, java.lang.String action)
GrailsControllerClass
isInterceptedAfter
in interface GrailsControllerClass
controller
- The controller instanceaction
- The action to checkpublic Closure getBeforeInterceptor(GroovyObject controller)
GrailsControllerClass
getBeforeInterceptor
in interface GrailsControllerClass
controller
- The controller instancepublic Closure getAfterInterceptor(GroovyObject controller)
GrailsControllerClass
getAfterInterceptor
in interface GrailsControllerClass
controller
- The controller instance@Deprecated public java.util.Set getCommandObjectActions()
getCommandObjectActions
in interface GrailsControllerClass
@Deprecated public java.util.Set getCommandObjectClasses()
getCommandObjectClasses
in interface GrailsControllerClass
public java.util.Map<java.lang.String,Closure> getFlows()
GrailsControllerClass
Returns 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 GrailsControllerClass
public boolean isFlowAction(java.lang.String actionName)
GrailsControllerClass
isFlowAction
in interface GrailsControllerClass
actionName
- The name of the actionpublic java.lang.String getDefaultAction()
GrailsControllerClass
getDefaultAction
in interface GrailsControllerClass
public void registerMapping(java.lang.String actionName)
GrailsControllerClass
registerMapping
in interface GrailsControllerClass
actionName
- The actionName