1 18 package org.apache.beehive.netui.pageflow.internal; 19 20 import org.apache.beehive.netui.compiler.schema.annotations.ProcessedAnnotation; 21 22 import javax.servlet.ServletContext ; 23 import java.util.List ; 24 import java.util.ArrayList ; 25 import java.lang.reflect.Field ; 26 27 public class CachedSharedFlowRefInfo 28 { 29 public static class SharedFlowFieldInfo 30 { 31 public Field field; 32 public String sharedFlowName; 33 } 34 35 38 private SharedFlowFieldInfo[] _sharedFlowMemberFields; 39 40 protected void initSharedFlowFields( AnnotationReader annReader, Field [] fields ) 41 { 42 List sharedFlowFields = null; 43 44 for ( int i = 0; i < fields.length; i++ ) 45 { 46 Field field = fields[i]; 47 48 ProcessedAnnotation sharedFlowFieldAnn = annReader.getJpfAnnotation( field, "SharedFlowField" ); 49 50 if ( sharedFlowFieldAnn != null ) 51 { 52 field.setAccessible( true ); 53 if ( sharedFlowFields == null ) sharedFlowFields = new ArrayList (); 54 SharedFlowFieldInfo info = new SharedFlowFieldInfo(); 55 info.field = field; 56 info.sharedFlowName = AnnotationReader.getStringAttribute( sharedFlowFieldAnn, "name" ); 57 sharedFlowFields.add( info ); 58 } 59 else if ( field.getName().equals( InternalConstants.GLOBALAPP_MEMBER_NAME ) ) 60 { 61 field.setAccessible( true ); 65 if ( sharedFlowFields == null ) sharedFlowFields = new ArrayList (); 66 SharedFlowFieldInfo info = new SharedFlowFieldInfo(); 67 info.field = field; 68 info.sharedFlowName = null; 69 sharedFlowFields.add( info ); 70 } 71 } 72 73 if ( sharedFlowFields != null ) 74 { 75 _sharedFlowMemberFields = ( SharedFlowFieldInfo[] ) sharedFlowFields.toArray( new SharedFlowFieldInfo[ sharedFlowFields.size() ] ); 76 } 77 } 78 79 public SharedFlowFieldInfo[] getSharedFlowMemberFields() 80 { 81 return _sharedFlowMemberFields; 82 } 83 } 84 | Popular Tags |