String key = parser.nextKey();
if (key.equals("relativebase")) {
if (relativeBaseDN != null) {
// Relative base DN specified more than once.
throw new InputMismatchException();
}
relativeBaseDN = DN.decode(parser.nextStringValue());
} else if (key.equals("minimum")) {
if (minimum != -1) {
// Minimum specified more than once.
throw new InputMismatchException();
}
minimum = parser.nextInt();
} else if (key.equals("maximum")) {
if (maximum != -1) {
// Maximum specified more than once.
throw new InputMismatchException();
}
maximum = parser.nextInt();
} else if (key.equals("specificationfilter")) {
if (filter != null) {
// Filter specified more than once.
throw new InputMismatchException();
}
filter = SearchFilter.createFilterFromString(parser
.nextStringValue());
} else if (key.equals("specificexclusions")) {
if (!chopBefore.isEmpty() || !chopAfter.isEmpty()) {
// Specific exclusions specified more than once.
throw new InputMismatchException();
}
parser.nextSpecificExclusions(chopBefore, chopAfter);
} else {
throw new InputMismatchException();
}
}
// Make default minimum value is 0.
if (minimum < 0) {