if (constraintAliases.containsKey(constraintType)) {
List aliasConstraints = (List) constraintAliases.get(constraintType);
int i = 1;
for (Iterator it = aliasConstraints.iterator(); it.hasNext(); i++) {
Constraint constraint = (Constraint) it.next();
getLogger().debug("new alias constraint " + (constraints.size() + i) + ". " + String.valueOf(constraint.getType()) + "[" + String.valueOf(constraint) + "]");
}
constraints.addAll(aliasConstraints);
}
else {
Constraint constraint = constraintFactory.createConstraintInstance(constraintType, constraintName, constraintContext, configurationHandler.getConfiguration());
if (constraint instanceof LogEnabled) {
((LogEnabled) constraint).enableLogging(getLogger());
}
if (constraint instanceof Configurable) {
try {
((Configurable) constraint).configure(configurationHandler.getConfiguration());
}
catch (Throwable t) {
getLogger().error("", t);
}
}
if (constraint != null) {
getLogger().debug("new simple constraint " + (constraints.size() + 1) + ". " + String.valueOf(constraint.getType()) + "[" + String.valueOf(constraint) + "]");
constraints.add(constraint);
}
else {
throw new SAXException("could not create constraint " + String.valueOf(constraintType));
}