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.tag;
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: import com.sun.facelets.FaceletContext;
22: import com.sun.facelets.FaceletException;
23: import com.sun.facelets.FaceletHandler;
24:
25: /**
26: * A FaceletHandler that is derived of 1 or more, inner FaceletHandlers. This
27: * class would be found if the next FaceletHandler is structually, a body
28: * with multiple child elements as defined in XML.
29: *
30: * @author Jacob Hookom
31: * @version $Id: CompositeFaceletHandler.java,v 1.4 2005/08/24 04:38:46 jhook Exp $
32: */
33: public final class CompositeFaceletHandler implements FaceletHandler {
34:
35: private final FaceletHandler[] children;
36: private final int len;
37:
38: public CompositeFaceletHandler(FaceletHandler[] children) {
39: this .children = children;
40: this .len = children.length;
41: }
42:
43: public void apply(FaceletContext ctx, UIComponent parent)
44: throws IOException, FacesException, FaceletException,
45: ELException {
46: for (int i = 0; i < len; i++) {
47: this .children[i].apply(ctx, parent);
48: }
49: }
50:
51: public FaceletHandler[] getHandlers() {
52: return this.children;
53: }
54: }
|