1 package org.apache.beehive.controls.runtime.bean; 2 19 20 import java.lang.reflect.AnnotatedElement ; 21 import org.apache.beehive.controls.api.context.ControlBeanContext; 22 import org.apache.beehive.controls.api.properties.PropertyMap; 23 import org.apache.beehive.controls.api.properties.AnnotatedElementMap; 24 import org.apache.beehive.controls.api.versioning.VersionRequired; 25 import org.apache.beehive.controls.api.versioning.Version; 26 27 33 abstract public class ClientInitializer 34 { 35 41 protected static void enforceVersionRequired( ControlBean control, VersionRequired versionRequired ) 42 { 43 Class controlIntf = control.getMostDerivedInterface( control.getControlInterface() ); 44 45 Version versionPresent = (Version) controlIntf.getAnnotation( Version.class ); 46 if ( versionPresent != null ) 47 { 48 ControlBean.enforceVersionRequired( controlIntf.getCanonicalName(), versionPresent, versionRequired ); 49 } 50 } 51 52 55 public static PropertyMap getAnnotationMap(ControlBeanContext cbc, AnnotatedElement annotElem) 56 { 57 if ( cbc == null ) 58 return new AnnotatedElementMap(annotElem); 59 60 return cbc.getAnnotationMap(annotElem); 61 } 62 } 63 | Popular Tags |