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:
20: /**
21: * FaceletFactory for producing Facelets relative to the context of the
22: * underlying implementation.
23: *
24: * @author Jacob Hookom
25: * @version $Id: FaceletFactory.java,v 1.3 2005/11/30 23:36:39 jhook Exp $
26: */
27: public abstract class FaceletFactory {
28:
29: private static ThreadLocal Instance = new ThreadLocal();
30:
31: /**
32: * Return a Facelet instance as specified by the file at the passed URI.
33: *
34: * @param uri
35: * @return
36: * @throws IOException
37: * @throws FaceletException
38: * @throws FacesException
39: * @throws ELException
40: */
41: public abstract Facelet getFacelet(String uri) throws IOException,
42: FaceletException, FacesException, ELException;
43:
44: /**
45: * Set the static instance
46: *
47: * @param factory
48: */
49: public static final void setInstance(FaceletFactory factory) {
50: Instance.set(factory);
51: }
52:
53: /**
54: * Get the static instance
55: *
56: * @return
57: */
58: public static final FaceletFactory getInstance() {
59: return (FaceletFactory) Instance.get();
60: }
61: }
|