public boolean violated(final Element root,
final ErrorReporter errorReporter) {
// Use an array to allow the result to be modified by the visitor
final boolean[] result = new boolean[1];
Visitor visitor = new SimpleVisitor() {
// javadoc inherited
public Visitor.Action visit(Element element) {
Object elementConstraints = constraints.get(element.getName());
Visitor.Action action = Visitor.Action.CONTINUE;