/**
* Enforces the VersionRequired annotation for control fields.
*/
private void enforceVersionRequired( FieldDeclaration f, InterfaceDeclaration controlIntf )
{
VersionRequired versionRequired = f.getAnnotation(VersionRequired.class);
Version versionPresent = controlIntf.getAnnotation(Version.class);
if (versionRequired != null) {
int majorRequired = -1;
try {
majorRequired = versionRequired.major();
}
catch(NullPointerException ignore) {
/*
the major version annotation is required and if unspecified, will
throw an NPE when it is quereid but not provided. this error will
be caught during syntactic validation perfoemed by javac, so ignore
it if an NPE is caught here
*/
return;
}
int minorRequired = versionRequired.minor();
/* no version requirement, so return */
if(majorRequired < 0)
return;