public class ControllerArtefactHandler extends ArtefactHandlerAdapter implements GrailsApplicationAware
This class is responsible for looking up controller classes for uris.
Lookups are cached in non-development mode, and the cache size can be controlled using the grails.urlmapping.cache.maxsize config property.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PLUGIN_NAME |
static java.lang.String |
TYPE |
Constructor and Description |
---|
ControllerArtefactHandler() |
Modifier and Type | Method and Description |
---|---|
GrailsClass |
getArtefactForFeature(java.lang.Object feature)
Called to retrieve an artefact relating to some other key for example a URI or tag name
|
java.lang.String |
getPluginName()
Obtains the plugin name that deals with this artefact.
|
void |
initialize(ArtefactInfo artefacts)
Sets up the relationships between the domain classes, this has to be done after
the intial creation to avoid looping.
|
void |
setGrailsApplication(GrailsApplication grailsApplication)
This method is called by the
org.springframework.context.ApplicationContext that
loads the Grails application. |
getType, isArtefact, isArtefactClass, isArtefactGrailsClass, newArtefactClass
public static final java.lang.String TYPE
public static final java.lang.String PLUGIN_NAME
public void initialize(ArtefactInfo artefacts)
ArtefactHandlerAdapter
initialize
in interface ArtefactHandler
initialize
in class ArtefactHandlerAdapter
artefacts
- The collection of artefact classes for this handlerpublic java.lang.String getPluginName()
ArtefactHandler
getPluginName
in interface ArtefactHandler
getPluginName
in class ArtefactHandlerAdapter
public GrailsClass getArtefactForFeature(java.lang.Object feature)
ArtefactHandler
Called to retrieve an artefact relating to some other key for example a URI or tag name
Handlers are responsible for caching the appropriate information using the data passed to them in calls to initialize()
getArtefactForFeature
in interface ArtefactHandler
getArtefactForFeature
in class ArtefactHandlerAdapter
feature
- Any object that acts as a keypublic void setGrailsApplication(GrailsApplication grailsApplication)
GrailsApplicationAware
This method is called by the org.springframework.context.ApplicationContext
that
loads the Grails application. The GrailsApplication
instance that represents
the loaded Grails application is injected.
setGrailsApplication
in interface GrailsApplicationAware
grailsApplication
- the GrailsApplication
object that represents this Grails application