|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.grails.commons.ArtefactHandlerAdapter
public class ArtefactHandlerAdapter
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
log
|
Constructor Summary | |
---|---|
ArtefactHandlerAdapter(String type,
Class grailsClassType,
Class grailsClassImpl,
String artefactSuffix)
|
|
ArtefactHandlerAdapter(String type,
Class grailsClassType,
Class grailsClassImpl,
String artefactSuffix,
boolean allowAbstract)
|
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)
Sets up the relationships between the domain classes, this has to be done after the intial creation to avoid looping |
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 |
isArtefactClass(Class clazz)
Checks that class's name ends in the suffix specified for this handler. |
boolean |
isArtefactGrailsClass(GrailsClass artefactGrailsClass)
Called to check if the specified GrailsClass is one managed by this artefact handler |
GrailsClass |
newArtefactClass(Class artefactClass)
Creates new GrailsClass derived object using the type supplied in constructor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.commons.logging.Log log
Constructor Detail |
---|
public ArtefactHandlerAdapter(String type, Class grailsClassType, Class grailsClassImpl, String artefactSuffix)
public ArtefactHandlerAdapter(String type, Class grailsClassType, Class grailsClassImpl, String artefactSuffix, boolean allowAbstract)
Method Detail |
---|
public String getPluginName()
ArtefactHandler
getPluginName
in interface ArtefactHandler
public String getType()
ArtefactHandler
Implementations must return a name such as "Domain" to indicate the type of artefact they represent
getType
in interface ArtefactHandler
public final boolean isArtefact(Class aClass)
ArtefactHandler
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
isArtefact
in interface ArtefactHandler
aClass
- A class to test
public boolean isArtefactClass(Class clazz)
Checks that class's name ends in the suffix specified for this handler.
Override for more complex criteria
clazz
- The class to check
public GrailsClass newArtefactClass(Class artefactClass)
Creates new GrailsClass derived object using the type supplied in constructor. May not perform optimally but is a convenience.
newArtefactClass
in interface ArtefactHandler
artefactClass
- Creates a new artefact for the given class
public void initialize(ArtefactInfo artefacts)
initialize
in interface ArtefactHandler
artefacts
- The collection of artefact classes for this handlerpublic GrailsClass getArtefactForFeature(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
feature
- Any object that acts as a key
public boolean isArtefactGrailsClass(GrailsClass artefactGrailsClass)
ArtefactHandler
Called to check if the specified GrailsClass is one managed by this artefact handler
isArtefactGrailsClass
in interface ArtefactHandler
artefactGrailsClass
- A GrailsClass instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |