KickJava   Java API By Example, From Geeks To Geeks.

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


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
22 /**
23  * FaceletFactory for producing Facelets relative to the context of the
24  * underlying implementation.
25  *
26  * @author Jacob Hookom
27  * @version $Id: FaceletFactory.java,v 1.3 2005/11/30 23:36:39 jhook Exp $
28  */

29 public abstract class FaceletFactory {
30
31     private static ThreadLocal JavaDoc Instance = new ThreadLocal JavaDoc();
32
33     /**
34      * Return a Facelet instance as specified by the file at the passed URI.
35      *
36      * @param uri
37      * @return
38      * @throws IOException
39      * @throws FaceletException
40      * @throws FacesException
41      * @throws ELException
42      */

43     public abstract Facelet getFacelet(String JavaDoc uri) throws IOException JavaDoc,
44             FaceletException, FacesException, ELException;
45
46     /**
47      * Set the static instance
48      *
49      * @param factory
50      */

51     public static final void setInstance(FaceletFactory factory) {
52         Instance.set(factory);
53     }
54
55     /**
56      * Get the static instance
57      *
58      * @return
59      */

60     public static final FaceletFactory getInstance() {
61         return (FaceletFactory) Instance.get();
62     }
63 }
64
Popular Tags