Normal gracelet views and tag files usually use groovy scripts and builders to construct a Facelets/JSF view. However, this does not mean it is the only
type of views that Gracelets can support. The Graclets system uses an API to create an application level GraceletHandlerFactory (
gracelets.api.facelets.GraceletsHandlerFactory
)
that is responsible for creating an appropriate GraceletHandler (
gracelets.api.facelets.GraceletHandler
) to handle a particular type of compiled class, generally
from a groovy source file (but it could be a compiled java class for instance). The handler factory is defined as follows:
GraceletHandlerFactory.javaToggle Line Numbers |
1
package gracelets.api.facelets; 2
3
import gracelets.api.resource.GraceletSource; 4
import gracelets.api.spi.GraceletsImplementation; 5
import groovy.lang.GroovyObject; 6
7
import java.util.ArrayList; 8
import java.util.List; 9
10
11
@link 12
@link@link 13
@link 14
15
@author 16
@author 17
@version 18
19
public abstract class GraceletsHandlerFactory { 20
21
protected List<GraceletHandlerInitializer> initializers = new ArrayList<GraceletHandlerInitializer>(); 22
23
24
25
26
27
@param 28
@param 29
@param 30
@return 31
32
public abstract GraceletHandler createHandler (GraceletSource src, String alias, Class<? extends GroovyObject> precompiled); 33
34
35
36
37
@param 38
39
public void register (GraceletHandlerInitializer initializer) { initializers.add(initializer); } 40
41
42
43
44
@param 45
46
public void unregister (GraceletHandlerInitializer initializer) { initializers.remove(initializer); } 47
48
}
|