org.codehaus.groovy.grails.commons
Class DomainClassArtefactHandler
java.lang.Object
org.codehaus.groovy.grails.commons.ArtefactHandlerAdapter
org.codehaus.groovy.grails.commons.DomainClassArtefactHandler
- All Implemented Interfaces:
- ArtefactHandler, GrailsConfigurationAware
- Direct Known Subclasses:
- AnnotationDomainClassArtefactHandler
public class DomainClassArtefactHandler
- extends ArtefactHandlerAdapter
- implements GrailsConfigurationAware
Evaluates the conventions that define a domain class in Grails
- Author:
- Graeme Rocher, Marc Palmer (marc@anyware.co.uk)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
DomainClassArtefactHandler
public DomainClassArtefactHandler()
newArtefactClass
public GrailsClass newArtefactClass(Class artefactClass)
- Description copied from class:
ArtefactHandlerAdapter
Creates new GrailsClass derived object using the type supplied in constructor. May not perform
optimally but is a convenience.
- Specified by:
newArtefactClass
in interface ArtefactHandler
- Overrides:
newArtefactClass
in class ArtefactHandlerAdapter
- Parameters:
artefactClass
- Creates a new artefact for the given class
- Returns:
- An instance of the GrailsClass interface representing the artefact
getDefaultConstraints
public Map getDefaultConstraints()
initialize
public void initialize(ArtefactInfo artefacts)
- Sets up the relationships between the domain classes, this has to be done after
the intial creation to avoid looping
- Specified by:
initialize
in interface ArtefactHandler
- Overrides:
initialize
in class ArtefactHandlerAdapter
- Parameters:
artefacts
- The collection of artefact classes for this handler
isArtefactClass
public boolean isArtefactClass(Class clazz)
- Description copied from class:
ArtefactHandlerAdapter
Checks that class's name ends in the suffix specified for this handler.
Override for more complex criteria
- Overrides:
isArtefactClass
in class ArtefactHandlerAdapter
- Parameters:
clazz
- The class to check
- Returns:
- True if it is an artefact of this type
isDomainClass
public static boolean isDomainClass(Class clazz)
setConfiguration
public void setConfiguration(groovy.util.ConfigObject co)
- Specified by:
setConfiguration
in interface GrailsConfigurationAware
Copyright (c) 2005-2009 The Grails project