KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > pageflow > internal > CachedFacesBackingInfo


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 * $Header:$
17 */

18 package org.apache.beehive.netui.pageflow.internal;
19
20 import javax.servlet.ServletContext JavaDoc;
21 import java.lang.reflect.Field JavaDoc;
22
23
24 /**
25  * Information that is cached per pageflow class.
26  */

27 public class CachedFacesBackingInfo
28         extends CachedSharedFlowRefInfo
29 {
30     /**
31      * The PageFlowController-initialized member field -- may or may not be present.
32      */

33     private Field JavaDoc _pageFlowMemberField;
34     
35     
36     public CachedFacesBackingInfo( Class JavaDoc facesBackingClass, ServletContext JavaDoc servletContext )
37     {
38         Field JavaDoc[] fields = facesBackingClass.getDeclaredFields();
39         AnnotationReader annReader = AnnotationReader.getAnnotationReader( facesBackingClass, servletContext );
40         
41         for ( int i = 0; i < fields.length; i++ )
42         {
43             Field JavaDoc field = fields[i];
44             
45             if ( annReader.getJpfAnnotation( field, "PageFlowField" ) != null )
46             {
47                 _pageFlowMemberField = field;
48                 _pageFlowMemberField.setAccessible( true );
49             }
50         }
51         
52         initSharedFlowFields( annReader, fields );
53     }
54     
55     public Field JavaDoc getPageFlowMemberField()
56     {
57         return _pageFlowMemberField;
58     }
59 }
60
61
Popular Tags