|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.grails.commons.AbstractGrailsClass org.codehaus.groovy.grails.commons.AbstractInjectableGrailsClass org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass
public class DefaultGrailsControllerClass
A class that evaluates the conventions contained within controllers to perform auto-configuration
Field Summary | |
---|---|
static String |
CONTROLLER
|
Fields inherited from class org.codehaus.groovy.grails.commons.AbstractGrailsClass |
---|
LOG |
Fields inherited from interface org.codehaus.groovy.grails.commons.GrailsControllerClass |
---|
AFTER_INTERCEPTOR, BEFORE_INTERCEPTOR, INDEX_ACTION |
Constructor Summary | |
---|---|
DefaultGrailsControllerClass(Class clazz)
|
Method Summary | |
---|---|
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 |
String |
getClosurePropertyName(String uri)
Returns a closure property name for a specific URI or null if the URI does not map to a closure. |
Set |
getCommandObjectActions()
|
Set |
getCommandObjectClasses()
|
String |
getDefaultAction()
Returns the default action for this Controller |
Map |
getFlows()
Returns a map of the flows for this controller. |
String[] |
getURIs()
Gets the list of all possible URI's available in this controller. |
String |
getViewByName(String viewName)
Retrieves the view name for the specified closure name |
String |
getViewByURI(String uri)
Retrieves the view name for the specified URI |
boolean |
isFlowAction(String actionName)
Returns true if the given action name is a flow action |
boolean |
isHttpMethodAllowedForAction(groovy.lang.GroovyObject controller,
String httpMethod,
String actionName)
Checks to see if an action is accessible via a particular http method |
boolean |
isInterceptedAfter(groovy.lang.GroovyObject controller,
String action)
Checks whether the specified action is intercepted after for the specified controller instance |
boolean |
isInterceptedBefore(groovy.lang.GroovyObject controller,
String action)
Checks whether the specified action is intercepted for the specified controller instance |
boolean |
mapsToURI(String uri)
Tests if a controller maps to a given URI. |
void |
registerMapping(String actionName)
Registers a new mapping onto this controller for the given actionName |
void |
setDefaultActionName(String defaultActionName)
Sets the name of the default action |
Methods inherited from class org.codehaus.groovy.grails.commons.AbstractInjectableGrailsClass |
---|
byName, byType, getAvailable |
Methods inherited from class org.codehaus.groovy.grails.commons.AbstractGrailsClass |
---|
getClazz, getFullName, getLogicalPropertyName, getMetaClass, getName, getNaturalName, getPackageName, getPropertyDescriptors, getPropertyName, getPropertyOrStaticPropertyOrFieldValue, getPropertyType, getPropertyValue, getPropertyValue, getPropertyValueObject, getReference, getReferenceInstance, getShortName, hasMetaMethod, hasMetaMethod, hasMetaProperty, hasProperty, isReadableProperty, newInstance, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.codehaus.groovy.grails.commons.InjectableGrailsClass |
---|
byName, byType, getAvailable |
Methods inherited from interface org.codehaus.groovy.grails.commons.GrailsClass |
---|
getClazz, getFullName, getLogicalPropertyName, getMetaClass, getName, getNaturalName, getPackageName, getPropertyName, getPropertyValue, getPropertyValue, getReference, getReferenceInstance, getShortName, hasProperty, newInstance |
Field Detail |
---|
public static final String CONTROLLER
Constructor Detail |
---|
public DefaultGrailsControllerClass(Class clazz)
Method Detail |
---|
public void setDefaultActionName(String defaultActionName)
GrailsControllerClass
setDefaultActionName
in interface GrailsControllerClass
defaultActionName
- The default action namepublic String[] getURIs()
GrailsControllerClass
Gets the list of all possible URI's available in this controller.
getURIs
in interface GrailsControllerClass
public boolean mapsToURI(String uri)
GrailsControllerClass
Tests if a controller maps to a given URI.
mapsToURI
in interface GrailsControllerClass
public String getViewByURI(String uri)
GrailsControllerClass
getViewByURI
in interface GrailsControllerClass
uri
- the name of URI
public String getClosurePropertyName(String uri)
GrailsControllerClass
Returns a closure property name for a specific URI or null if the URI does not map to a closure.
getClosurePropertyName
in interface GrailsControllerClass
uri
- the URI of the request
public String getViewByName(String viewName)
GrailsControllerClass
getViewByName
in interface GrailsControllerClass
viewName
- The name of the closure
public boolean isInterceptedBefore(groovy.lang.GroovyObject controller, String action)
GrailsControllerClass
isInterceptedBefore
in interface GrailsControllerClass
controller
- The instance of the controlleraction
- The action to check
public boolean isHttpMethodAllowedForAction(groovy.lang.GroovyObject controller, String httpMethod, String actionName)
GrailsControllerClass
isHttpMethodAllowedForAction
in interface GrailsControllerClass
controller
- The instance of the controllerhttpMethod
- The http request methodactionName
- The action to check
public boolean isInterceptedAfter(groovy.lang.GroovyObject controller, String action)
GrailsControllerClass
isInterceptedAfter
in interface GrailsControllerClass
controller
- The controller instanceaction
- The action to check
public groovy.lang.Closure getBeforeInterceptor(groovy.lang.GroovyObject controller)
GrailsControllerClass
getBeforeInterceptor
in interface GrailsControllerClass
controller
- The controller instance
public groovy.lang.Closure getAfterInterceptor(groovy.lang.GroovyObject controller)
GrailsControllerClass
getAfterInterceptor
in interface GrailsControllerClass
controller
- The controller instance
public Set getCommandObjectActions()
getCommandObjectActions
in interface GrailsControllerClass
public Set getCommandObjectClasses()
getCommandObjectClasses
in interface GrailsControllerClass
public Map 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(String actionName)
GrailsControllerClass
isFlowAction
in interface GrailsControllerClass
actionName
- The name of the action
public String getDefaultAction()
GrailsControllerClass
getDefaultAction
in interface GrailsControllerClass
public void registerMapping(String actionName)
GrailsControllerClass
registerMapping
in interface GrailsControllerClass
actionName
- The actionName
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |