public class ArtefactHandlerAdapter extends Object implements ArtefactHandler
Adapter for the ArtefactHandler interface
| Modifiers | Name | Description |
|---|---|---|
protected boolean |
allowAbstract |
|
protected String |
artefactPath |
|
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)Adapter for the ArtefactHandler interface |
ArtefactHandlerAdapter(String type, Class<? extends GrailsClass> grailsClassType, Class<?> grailsClassImpl, String artefactSuffix, String artefactPath)Adapter for the ArtefactHandler interface |
ArtefactHandlerAdapter(String type, Class<? extends GrailsClass> grailsClassType, Class<?> grailsClassImpl, String artefactSuffix, boolean allowAbstract)Adapter for the ArtefactHandler interface |
ArtefactHandlerAdapter(String type, Class<? extends GrailsClass> grailsClassType, Class<?> grailsClassImpl, String artefactSuffix, String artefactPath, boolean allowAbstract)Adapter for the ArtefactHandler interface |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public GrailsClass |
getArtefactForFeature(Object feature) |
|
public String |
getPluginName() |
|
public String |
getType() |
|
protected boolean |
hasArtefactAnnotation(Class<?> clazz) |
|
protected boolean |
hasArtefactAnnotation(Class<?> clazz, String value) |
|
protected boolean |
hasArtefactAnnotation(ClassNode classNode) |
|
protected boolean |
hasArtefactAnnotation(ClassNode classNode, String value) |
|
public void |
initialize(ArtefactInfo artefacts)Sets up the relationships between the domain classes, this has to be done after the initial creation to avoid looping. |
|
public boolean |
isArtefact(ClassNode classNode)Default implementation of ArtefactHandler.isArtefact which returns true if the ClassNode is Grails resource and the name of the ClassNode ends with the artefactSuffix |
|
public boolean |
isArtefact(Class<?> clazz) |
|
protected boolean |
isArtefactClass(ClassNode classNode)Subclasses can override to narrow down whether the given resource is an artefact of this type. |
|
public boolean |
isArtefactClass(Class<?> clazz) |
|
public boolean |
isArtefactGrailsClass(GrailsClass artefactGrailsClass) |
|
protected boolean |
isValidArtefactClassNode(ClassNode classNode, int modifiers) |
|
public GrailsClass |
newArtefactClass(Class<?> artefactClass) |
Adapter for the ArtefactHandler interface
type - The type of Artefact, e.g. Application, ControllergrailsClassType - The Class InterfacegrailsClassImpl - The Class that GrailsClass to be implementsartefactSuffix - The suffix of ArtefactAdapter for the ArtefactHandler interface
type - The type of Artefact, e.g. Application, ControllergrailsClassType - The Class InterfacegrailsClassImpl - The Class that GrailsClass to be implementsartefactSuffix - The suffix of ArtefactartefactPath - The path of Artefact withinAdapter for the ArtefactHandler interface
type - The type of Artefact, e.g. Application, ControllergrailsClassType - The Class InterfacegrailsClassImpl - The Class that GrailsClass to be implementsartefactSuffix - The suffix of ArtefactallowAbstract - weather allow abstract or notAdapter for the ArtefactHandler interface
type - The type of Artefact, e.g. Application, ControllergrailsClassType - The Class InterfacegrailsClassImpl - The Class that GrailsClass to be implementsartefactSuffix - The suffix of ArtefactartefactPath - The path of Artefact withinallowAbstract - weather allow abstract or notSets up the relationships between the domain classes, this has to be done after the initial creation to avoid looping.
Default implementation of ArtefactHandler.isArtefact which returns true if the ClassNode is Grails resource and the name of the ClassNode ends with the artefactSuffix
classNode - The ClassNode instanceSubclasses 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
classNode - The ClassNode to check
Checks that class's name ends in the suffix specified for this handler.
Override for more complex criteria
clazz - The class to check
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