01: /**
02: * Licensed under the Common Development and Distribution License,
03: * you may not use this file except in compliance with the License.
04: * You may obtain a copy of the License at
05: *
06: * http://www.sun.com/cddl/
07: *
08: * Unless required by applicable law or agreed to in writing, software
09: * 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: */package com.sun.facelets;
14:
15: import java.io.IOException;
16:
17: import javax.el.ELException;
18: import javax.faces.FacesException;
19: import javax.faces.component.UIComponent;
20:
21: /**
22: * FaceletHandlers can implement this contract and push themselves into the
23: * FaceletContext for participating in templating. Templates will attempt to
24: * resolve content for a specified name until one of the TemplatClients return
25: * 'true'.
26: *
27: * @author Jacob Hookom
28: * @version $Id: TemplateClient.java,v 1.2 2006/03/29 04:10:11 jhook Exp $
29: */
30: public interface TemplateClient {
31:
32: /**
33: * This contract is much like the normal FaceletHandler.apply method, but it
34: * takes in an optional String name which tells this instance what
35: * fragment/definition it's looking for. If you are a match, apply your
36: * logic to the passed UIComponent and return true, otherwise do nothing and
37: * return false.
38: *
39: * @param ctx
40: * the FaceletContext of <i>your</i> instance, not the
41: * templates'
42: * @param parent
43: * current UIComponent instance to be applied
44: * @param name
45: * the String name or null if the whole body should be included
46: * @return true if this client matched/applied the definition for the passed
47: * name
48: * @throws IOException
49: * @throws FacesException
50: * @throws FaceletException
51: * @throws ELException
52: */
53: public boolean apply(FaceletContext ctx, UIComponent parent,
54: String name) throws IOException, FacesException,
55: FaceletException, ELException;;
56: }
|