1 package org.apache.beehive.controls.runtime.generator; 2 19 20 import java.lang.reflect.Field ; 21 import java.util.ArrayList ; 22 23 28 public class ClientInitializer 29 { 30 34 protected ClientInitializer(AptControlClient controlClient) 35 { 36 super(); 37 38 assert controlClient != null; 39 40 _controlClient = controlClient; 41 _packageName = _controlClient.getPackage(); 42 _shortName = _controlClient.getShortName() + "ClientInitializer"; 43 _className = isRootPackage() ? _shortName : _packageName + "." + _shortName; 44 45 50 _reflectFields = new ArrayList <AptField>(); 51 for (AptField genField : _controlClient.getControls()) 52 _reflectFields.add(genField); 53 } 54 55 58 public String getPackage() { return _packageName; } 59 60 63 public boolean isRootPackage() { return getPackage().equals(""); } 64 65 68 public String getShortName() { return _shortName; } 69 70 73 public String getClassName() { return _className; } 74 75 78 public AptControlClient getControlClient() { return _controlClient; } 79 80 public ClientInitializer getSuperClass() { return null; } 81 82 86 static public boolean needsReflection(AptField genField) 87 { 88 String accessModifier = genField.getAccessModifier(); 93 if (accessModifier.equals("private")) 94 return true; 95 96 return false; 97 } 98 99 102 public ArrayList <AptField> getReflectFields() 103 { 104 return _reflectFields; 105 } 106 107 String _packageName; 108 String _shortName; 109 String _className; 110 AptControlClient _controlClient; 111 ArrayList <AptField> _reflectFields; 112 } 113 | Popular Tags |