KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > faces > component > _AttachedStateWrapper


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package javax.faces.component;
17
18 import java.io.Serializable JavaDoc;
19
20 /**
21  * @author Manfred Geiler (latest modification by $Author: mwessendorf $)
22  * @version $Revision: 1.4 $ $Date: 2004/07/01 22:00:49 $
23  */

24 class _AttachedStateWrapper
25         implements Serializable JavaDoc
26 {
27     private Class JavaDoc _class;
28     private Object JavaDoc _wrappedStateObject;
29
30     /**
31      * @param clazz null means wrappedStateObject is a List of state objects
32      * @param wrappedStateObject
33      */

34     public _AttachedStateWrapper(Class JavaDoc clazz, Object JavaDoc wrappedStateObject)
35     {
36         if (wrappedStateObject != null && !(wrappedStateObject instanceof Serializable JavaDoc))
37         {
38             throw new IllegalArgumentException JavaDoc("Attached state for Object of type " + clazz + " (Class " + wrappedStateObject.getClass().getName() + ") is not serializable");
39         }
40         _class = clazz;
41         _wrappedStateObject = wrappedStateObject;
42     }
43
44     public Class JavaDoc getClazz()
45     {
46         return _class;
47     }
48
49     public Object JavaDoc getWrappedStateObject()
50     {
51         return _wrappedStateObject;
52     }
53 }
54
Popular Tags