KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > facelets > TemplateClient


1 /**
2  * Licensed under the Common Development and Distribution License,
3  * you may not use this file except in compliance with the License.
4  * You may obtain a copy of the License at
5  *
6  * http://www.sun.com/cddl/
7  *
8  * Unless required by applicable law or agreed to in writing, software
9  * distributed under the License is distributed on an "AS IS" BASIS,
10  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11  * implied. See the License for the specific language governing
12  * permissions and limitations under the License.
13  */

14
15 package com.sun.facelets;
16
17 import java.io.IOException JavaDoc;
18
19 import javax.el.ELException;
20 import javax.faces.FacesException;
21 import javax.faces.component.UIComponent;
22
23 /**
24  * FaceletHandlers can implement this contract and push themselves into the
25  * FaceletContext for participating in templating. Templates will attempt to
26  * resolve content for a specified name until one of the TemplatClients return
27  * 'true'.
28  *
29  * @author Jacob Hookom
30  * @version $Id: TemplateClient.java,v 1.2 2006/03/29 04:10:11 jhook Exp $
31  */

32 public interface TemplateClient {
33
34     /**
35      * This contract is much like the normal FaceletHandler.apply method, but it
36      * takes in an optional String name which tells this instance what
37      * fragment/definition it's looking for. If you are a match, apply your
38      * logic to the passed UIComponent and return true, otherwise do nothing and
39      * return false.
40      *
41      * @param ctx
42      * the FaceletContext of <i>your</i> instance, not the
43      * templates'
44      * @param parent
45      * current UIComponent instance to be applied
46      * @param name
47      * the String name or null if the whole body should be included
48      * @return true if this client matched/applied the definition for the passed
49      * name
50      * @throws IOException
51      * @throws FacesException
52      * @throws FaceletException
53      * @throws ELException
54      */

55     public boolean apply(FaceletContext ctx, UIComponent parent, String JavaDoc name)
56             throws IOException JavaDoc, FacesException, FaceletException, ELException;;
57 }
58
Popular Tags