Extract ProblemCollector interface

This commit is contained in:
Chris Beams
2011-02-08 19:07:03 +00:00
parent 60414c9052
commit a2bc381ade
11 changed files with 55 additions and 19 deletions

View File

@@ -0,0 +1,35 @@
/*
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.parsing;
/**
* TODO SPR-7420: document
*
* @author Chris Beams
* @since 3.1
*/
public interface ProblemCollector {
void error(String message);
void error(String message, Throwable cause);
void reportProblems(ProblemReporter reporter);
boolean hasErrors();
}

View File

@@ -27,7 +27,7 @@ import org.springframework.core.io.DescriptiveResource;
* @author Chris Beams
* @since 3.1
*/
public class SimpleProblemCollector {
public class SimpleProblemCollector implements ProblemCollector {
private Location location = null;
private List<Problem> errors = new ArrayList<Problem>();