@java.lang.SuppressWarnings( "deprecation" ) public class ArtefactHandlerAdapter extends java.lang.Object implements ArtefactHandler
Adapter for the ArtefactHandler interface
Modifiers | Name | Description |
---|---|---|
protected boolean |
allowAbstract |
|
protected java.lang.String |
artefactSuffix |
|
protected java.lang.Class<?> |
grailsClassImpl |
|
protected java.lang.Class<?> |
grailsClassType |
|
protected java.lang.String |
type |
Constructor and description |
---|
ArtefactHandlerAdapter
(java.lang.String type, java.lang.Class<? extends GrailsClass> grailsClassType, java.lang.Class<?> grailsClassImpl, java.lang.String artefactSuffix) |
ArtefactHandlerAdapter
(java.lang.String type, java.lang.Class<? extends GrailsClass> grailsClassType, java.lang.Class<?> grailsClassImpl, java.lang.String artefactSuffix, boolean allowAbstract) |
Type Params | Return Type | Name and description |
---|---|---|
|
public GrailsClass |
getArtefactForFeature(java.lang.Object feature) |
|
public java.lang.String |
getPluginName() |
|
public java.lang.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(org.codehaus.groovy.ast.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(java.lang.Class aClass) |
|
public boolean |
isArtefactClass(java.lang.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(org.codehaus.groovy.ast.ClassNode classNode, int modifiers) |
|
public GrailsClass |
newArtefactClass(java.lang.Class artefactClass) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
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