if (note != null) {
int fieldMod = forClass.getDeclaredFields()[i].getModifiers();
if (Modifier.isPrivate(fieldMod) && !Modifier.isFinal(fieldMod) && !Modifier.isStatic(fieldMod)) {
if (note.type().equals(CorbaUnionElementType.discriminator)) {
if (discriminatorPresent) {
throw new RequestConfigurationException(
"More than one discriminators declared on: " + forClass);
}
discriminatorPresent = true;
} else {
atLeastOneOption = true;
}
} else {
throw new RequestConfigurationException(
"Annotated union field should be private, not final and no static on class: " + forClass);
}
}
}
if (atLeastOneOption && !discriminatorPresent) {
throw new RequestConfigurationException("No discriminator annotation found on: " + forClass);
} else if (!atLeastOneOption && discriminatorPresent) {
throw new RequestConfigurationException("No union option found on: " + forClass);
} else if (discriminatorPresent && atLeastOneOption) {
return true;
} else {
return false;
}