// cycle terms
for (int i = 0; i < terms.length; i++) {
if (terms[i].length() > 0) {
Matcher termMatcher = termPattern.matcher(terms[i]);
if (!termMatcher.matches()) {
throw new PermErrorException("Term [" + terms[i]
+ "] is not syntactically valid: "
+ termPattern.pattern());
}
// true if we matched a modifier, false if we matched a
// directive
String modifierString = termMatcher
.group(TERM_STEP_REGEX_MODIFIER_POS);
if (modifierString != null) {
// MODIFIER
Modifier mod = (Modifier) lookupAndCreateTerm(termMatcher,
TERM_STEP_REGEX_MODIFIER_POS);
if (mod.enforceSingleInstance()) {
Iterator it = result.getModifiers().iterator();
while (it.hasNext()) {
if (it.next().getClass().equals(mod.getClass())) {
throw new PermErrorException("More than one "
+ modifierString
+ " found in SPF-Record");
}
}
}