|
Griffon 0.9.5-rc2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
griffon.core.ApplicationHandlergriffon.core.ArtifactHandler
public interface ArtifactHandler extends ApplicationHandler
The ArtifactHandler interface's purpose is to allow the analysis of conventions within a Griffon application.
An artifact is represented by the GriffonClass interface and this interface provides methods that allow artifacts to be identified, created and initialized.
Method Summary | |
---|---|
GriffonClass
|
findClassFor(String propertyName)
Finds an artifact by its property name. |
GriffonClass
|
getClassFor(Class clazz)
Finds an artifact if the target clazz is handled by this ArtifactHandler. |
GriffonClass
|
getClassFor(String fqnClassName)
Finds an artifact by class name if it represents a class that is handled by this ArtifactHandler. |
GriffonClass[]
|
getClasses()
Returns the set of all artifact classes this handler manages. |
String
|
getTrailing()
Get the trailing suffix that identifies the artifact. |
String
|
getType()
Get the type of artifact this handler processes. |
void
|
initialize(ArtifactInfo[] artifacts)
Initializes the handler with a collection of all available artifacts this handler can process. |
boolean
|
isArtifact(Class clazz)
Returns true if the target Class is a class artifact handled by this object. |
boolean
|
isArtifact(GriffonClass clazz)
Returns true if the target GriffonClass is a class artifact handled by this object. |
Methods inherited from interface ApplicationHandler | |
---|---|
getApp |
Method Detail |
---|
public GriffonClass findClassFor(String propertyName)
Examples: findClassfor("fooService") returns an artifact class that can handle FooService.
Should propertyName contain any dots then the portion after the last dot will be considered only.
propertyName
- the property representation of an artifact, e.g. 'fooService'
public GriffonClass getClassFor(Class clazz)
clazz
- a class object, i.e, BookController
public GriffonClass getClassFor(String fqnClassName)
fqnClassName
- a full qualified class name, i.e, "book.BookController"
public GriffonClass[] getClasses()
public String getTrailing()
May be empty but non-null.
public String getType()
public void initialize(ArtifactInfo[] artifacts)
This is a good time to pre-emptively instantiate beans or perform additional checks on artifacts.
artifacts
- an array of all artifacts this handler should manage
public boolean isArtifact(Class clazz)
clazz
- a Class instance
public boolean isArtifact(GriffonClass clazz)
clazz
- a GriffonClass instance
Groovy Documentation