|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ArtefactHandler
The ArtefactHandler interface's purpose is to allow the analysis of conventions within a Grails application. An artefact is represented by the GrailsClass interface and this interface provides methods that allow artefacts to be identified, created and initialized.
Artefacts need to provide info about themselves, and some callbacks are required to verify whether or not a class is that kind of artefact/p>
GrailsApplication.registerArtefactHandler(ArtefactHandler)
Method Summary | |
---|---|
GrailsClass |
getArtefactForFeature(Object feature)
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() |
String |
getPluginName()
Obtains the plugin name that deals with this artefact |
String |
getType()
Implementations must return a name such as "Domain" to indicate the type of artefact they represent |
void |
initialize(ArtefactInfo artefacts)
Called whenever the list of artefacts has changed or been reloaded. |
boolean |
isArtefact(Class aClass)
This method will be called by the GrailsApplication whenever it needs to know if a given class is considered to be the kind of artefact represented by this handler. |
boolean |
isArtefactGrailsClass(GrailsClass artefactGrailsClass)
Called to check if the specified GrailsClass is one managed by this artefact handler |
GrailsClass |
newArtefactClass(Class artefactClass)
Called by GrailsApplication when a new class is found and a GrailsClass wrapping it is required |
Method Detail |
---|
String getPluginName()
String getType()
Implementations must return a name such as "Domain" to indicate the type of artefact they represent
boolean isArtefact(Class aClass)
This method will be called by the GrailsApplication whenever it needs to know if a given class is considered to be the kind of artefact represented by this handler.
Typically you will check the name of the class and some other properties to see if it is of the correct artefact type
aClass
- A class to test
GrailsClass newArtefactClass(Class artefactClass)
Called by GrailsApplication when a new class is found and a GrailsClass wrapping it is required
artefactClass
- The new class that has been loaded
void initialize(ArtefactInfo artefacts)
Called whenever the list of artefacts has changed or been reloaded.
It must be safe to call this method multiple times and have any internal data structures reset.
artefacts
- The collection of artefact classes for this handlerGrailsClass getArtefactForFeature(Object feature)
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()
feature
- Any object that acts as a key
boolean isArtefactGrailsClass(GrailsClass artefactGrailsClass)
Called to check if the specified GrailsClass is one managed by this artefact handler
artefactGrailsClass
- A GrailsClass instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |