[ http://issues.apache.org/jira/browse/BEEHIVE-179?page=comments#action_57793 ] Lawrence Jones commented on BEEHIVE-179: ----------------------------------------
Am I right in thinking that the only way I can check whether an annotation that is not declared as a PropertySet is present or not is through reflection on the interface? And also that if I happened to pass the class name of such an annotation to getControlPropertySet() then I would always get null regardless of whether the annotation was present or not? If so then that's fine. I do not wish the user to be able to set the value of this annotation any way other than via placing the annotation on the JCX (I do not want setters to work at a later time etc.) - so I think I should remove the PropertySet meta-annotation and use reflection to get at the value at runtime? Nonetheless I think the original problem still remains - if I have an annotation that _has_ been defined as a PropertySet, then I should be able to tell whether the annotation is present or not. I am happy with the solution you suggested for this earlier - the 'optional' member on PropertySet. (In particular if the PropertySet you wish to make available is a marker annotation - i.e. has no members - then you must use the optional member.) > context.getControlPropertySet() should return null for non-existent annotation > ------------------------------------------------------------------------------ > > Key: BEEHIVE-179 > URL: http://issues.apache.org/jira/browse/BEEHIVE-179 > Project: Beehive > Type: Bug > Components: Controls > Versions: V1Beta > Environment: Windows > Reporter: Lawrence Jones > Assignee: Kyle Marvin > Priority: Critical > > I call > ServiceControl.TypesJarName typesJarNameAnn = > (ServiceControl.TypesJarName)context. > getControlPropertySet(ServiceControl.TypesJarName.class); > in the Impl of my control (ServiceControl). TypesJarName is a valid > annotation which is defined in the public interface but not used in either > the public interface nor in the JCX. > I expected to receive null but instead I get a non-null object with defaulted > values for its members. > This is at odds with the javadoc for the API > ControlBeanContext.getControlPropertySet() and in any case you need a way to > be able to tell whether an annotation is present or not (especially if you > have marker annotations). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
