in ti/phase2/jars/core/src/java/org/apache/ti/compiler/internal/AnnotationGrammar.java [284:359]
public final Object endCheck(AnnotationInstance annotation, AnnotationInstance[] parentAnnotations,
MemberDeclaration classMember, Set wasPresent, Map checkResults) {
//
// Check mutually-exclusive attributes and child annotations.
//
String[][] mutuallyExclusiveAttrs = getMutuallyExclusiveAttrs();
for (int i = 0; (mutuallyExclusiveAttrs != null) && (i < mutuallyExclusiveAttrs.length); ++i) {
String alreadyFound = null;
for (int j = 0; j < mutuallyExclusiveAttrs[i].length; ++j) {
String thisAttr = mutuallyExclusiveAttrs[i][j];
if (wasPresent.contains(thisAttr)) {
if (alreadyFound == null) {
alreadyFound = thisAttr;
} else {
String errorKey = "error.atmost-one-may-exist-" + mutuallyExclusiveAttrs[i].length;
getDiagnostics().addErrorArrayArgs(annotation, errorKey, mutuallyExclusiveAttrs[i]);
}
}
}
}
//
// Check required attributes and child annotations.
//
String[][] requiredAttrs = getRequiredAttrs();
for (int i = 0; (requiredAttrs != null) && (i < requiredAttrs.length); ++i) {
boolean foundOne = false;
for (int j = 0; j < requiredAttrs[i].length; ++j) {
String thisAttr = requiredAttrs[i][j];
if (wasPresent.contains(thisAttr)) {
foundOne = true;
break;
}
}
if (!foundOne) {
String errorKey = "error.atleast-one-must-exist-" + requiredAttrs[i].length;
getDiagnostics().addErrorArrayArgs(annotation, errorKey, requiredAttrs[i]);
}
}
//
// Check inter-dependencies for attributes and child annotations.
//
String[][] attrDependencies = getAttrDependencies();
for (int i = 0; (attrDependencies != null) && (i < attrDependencies.length); ++i) {
String thisAttr = attrDependencies[i][0];
if (wasPresent.contains(thisAttr)) {
boolean foundOne = false;
for (int j = 1; j < attrDependencies[i].length; ++j) {
if (wasPresent.contains(attrDependencies[i][j])) {
foundOne = true;
break;
}
}
if (!foundOne) {
String key = "error.attr-dependency-not-found-" + (attrDependencies[i].length - 1);
getDiagnostics().addErrorArrayArgs(annotation, key, attrDependencies[i]);
}
}
}
return onEndCheck(annotation, parentAnnotations, classMember, checkResults); // for derived classes
}