public class ArtefactHandlerAdapter extends Object implements ArtefactHandler
Adapter for the ArtefactHandler interface
Modifiers | Name | Description |
---|---|---|
protected boolean |
allowAbstract |
|
protected String |
artefactSuffix |
|
protected Class<?> |
grailsClassImpl |
|
protected Class<?> |
grailsClassType |
|
protected String |
type |
Constructor and description |
---|
ArtefactHandlerAdapter(String type, Class<? extends GrailsClass> grailsClassType, Class<?> grailsClassImpl, String artefactSuffix) |
ArtefactHandlerAdapter(String type, Class<? extends GrailsClass> grailsClassType, Class<?> grailsClassImpl, String artefactSuffix, boolean allowAbstract) |
Type Params | Return Type | Name and description |
---|---|---|
|
public GrailsClass |
getArtefactForFeature(Object feature) |
|
public String |
getPluginName() |
|
public String |
getType() |
|
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. |
|
public boolean |
isArtefact(ClassNode classNode) Default implementation of ArtefactHandler.isArtefact which returns true if the ClassNode passes the isArtefactResource(org.grails.io.support.Resource) method and the name of the ClassNode ends with the artefactSuffix |
|
public final boolean |
isArtefact(Class<?> aClass) |
|
public boolean |
isArtefactClass(Class<?> clazz) |
|
public boolean |
isArtefactGrailsClass(GrailsClass artefactGrailsClass) |
|
protected boolean |
isArtefactResource(Resource resource) Subclasses can override to narrow down whether the given resource is an artefact of this type. |
|
protected boolean |
isValidArtefactClassNode(ClassNode classNode, int modifiers) |
|
public GrailsClass |
newArtefactClass(Class<?> artefactClass) |
Sets up the relationships between the domain classes, this has to be done after the intial creation to avoid looping.
Default implementation of ArtefactHandler.isArtefact which returns true if the ClassNode passes the isArtefactResource(org.grails.io.support.Resource) method and the name of the ClassNode ends with the artefactSuffix
classNode
- The ClassNode instance
Checks that class's name ends in the suffix specified for this handler.
Override for more complex criteria
clazz
- The class to checkSubclasses can override to narrow down whether the given resource is an artefact of this type. The default is to consider all files under "grails-app" to be a resource
resource
- The resource
Creates new GrailsClass derived object using the type supplied in constructor. May not perform optimally but is a convenience.
artefactClass
- Creates a new artefact for the given class