public class DomainClassArtefactHandler extends ArtefactHandlerAdapter implements GrailsApplicationAware
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TYPE |
Constructor and Description |
---|
DomainClassArtefactHandler() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(ArtefactInfo artefacts)
Sets up the relationships between the domain classes, this has to be done after
the intial creation to avoid looping
|
boolean |
isArtefactClass(java.lang.Class clazz)
Checks that class's name ends in the suffix specified for this handler.
|
static boolean |
isDomainClass(java.lang.Class clazz) |
GrailsClass |
newArtefactClass(java.lang.Class artefactClass)
Creates new GrailsClass derived object using the type supplied in constructor.
|
void |
setGrailsApplication(GrailsApplication grailsApplication)
This method is called by the
org.springframework.context.ApplicationContext that
loads the Grails application. |
getArtefactForFeature, getPluginName, getType, isArtefact, isArtefactGrailsClass
public static final java.lang.String TYPE
public 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 applicationpublic GrailsClass newArtefactClass(java.lang.Class artefactClass)
ArtefactHandlerAdapter
Creates new GrailsClass derived object using the type supplied in constructor. May not perform optimally but is a convenience.
newArtefactClass
in interface ArtefactHandler
newArtefactClass
in class ArtefactHandlerAdapter
artefactClass
- Creates a new artefact for the given classpublic void initialize(ArtefactInfo artefacts)
initialize
in interface ArtefactHandler
initialize
in class ArtefactHandlerAdapter
artefacts
- The collection of artefact classes for this handlerpublic boolean isArtefactClass(java.lang.Class clazz)
ArtefactHandlerAdapter
Checks that class's name ends in the suffix specified for this handler.
Override for more complex criteria
isArtefactClass
in class ArtefactHandlerAdapter
clazz
- The class to checkpublic static boolean isDomainClass(java.lang.Class clazz)