Groovy Documentation

org.codehaus.groovy.grails.commons
[Java] Class ArtefactHandlerAdapter

java.lang.Object
  org.codehaus.groovy.grails.commons.ArtefactHandlerAdapter
All Implemented Interfaces:
ArtefactHandler

public class ArtefactHandlerAdapter
extends java.lang.Object

Authors:
Marc Palmer (marc@anyware.co.uk)


Field Summary
protected org.apache.commons.logging.Log log

 
Constructor Summary
ArtefactHandlerAdapter(java.lang.String type, java.lang.Class grailsClassType, java.lang.Class grailsClassImpl, java.lang.String artefactSuffix)

ArtefactHandlerAdapter(java.lang.String type, java.lang.Class grailsClassType, java.lang.Class grailsClassImpl, java.lang.String artefactSuffix, boolean allowAbstract)

 
Method Summary
GrailsClass getArtefactForFeature(java.lang.Object feature)

java.lang.String getPluginName()

java.lang.String getType()

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(java.lang.Class aClass)

boolean isArtefactClass(java.lang.Class clazz)

Checks that class's name ends in the suffix specified for this handler.

boolean isArtefactGrailsClass(GrailsClass artefactGrailsClass)

GrailsClass newArtefactClass(java.lang.Class artefactClass)

Creates new GrailsClass derived object using the type supplied in constructor.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), 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()
 

Field Detail

log

protected org.apache.commons.logging.Log log


 
Constructor Detail

ArtefactHandlerAdapter

public ArtefactHandlerAdapter(java.lang.String type, java.lang.Class grailsClassType, java.lang.Class grailsClassImpl, java.lang.String artefactSuffix)


ArtefactHandlerAdapter

public ArtefactHandlerAdapter(java.lang.String type, java.lang.Class grailsClassType, java.lang.Class grailsClassImpl, java.lang.String artefactSuffix, boolean allowAbstract)


 
Method Detail

getArtefactForFeature

public GrailsClass getArtefactForFeature(java.lang.Object feature)


getPluginName

public java.lang.String getPluginName()


getType

public java.lang.String getType()


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.


isArtefact

public final boolean isArtefact(@SuppressWarnings("rawtypes") java.lang.Class aClass)


isArtefactClass

public boolean isArtefactClass(@SuppressWarnings("rawtypes") java.lang.Class clazz)

Checks that class's name ends in the suffix specified for this handler.

Override for more complex criteria

Parameters:
clazz - The class to check
Returns:
True if it is an artefact of this type


isArtefactGrailsClass

public boolean isArtefactGrailsClass(GrailsClass artefactGrailsClass)


newArtefactClass

public GrailsClass newArtefactClass(@SuppressWarnings("rawtypes") java.lang.Class artefactClass)

Creates new GrailsClass derived object using the type supplied in constructor. May not perform optimally but is a convenience.

Parameters:
artefactClass - Creates a new artefact for the given class
Returns:
An instance of the GrailsClass interface representing the artefact


 

Groovy Documentation