001/* 002 * Copyright 2002-2012 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.beans.factory.parsing; 018 019/** 020 * SPI interface allowing tools and other external processes to handle errors 021 * and warnings reported during bean definition parsing. 022 * 023 * @author Rob Harrop 024 * @author Juergen Hoeller 025 * @since 2.0 026 * @see Problem 027 */ 028public interface ProblemReporter { 029 030 /** 031 * Called when a fatal error is encountered during the parsing process. 032 * <p>Implementations must treat the given problem as fatal, 033 * i.e. they have to eventually raise an exception. 034 * @param problem the source of the error (never {@code null}) 035 */ 036 void fatal(Problem problem); 037 038 /** 039 * Called when an error is encountered during the parsing process. 040 * <p>Implementations may choose to treat errors as fatal. 041 * @param problem the source of the error (never {@code null}) 042 */ 043 void error(Problem problem); 044 045 /** 046 * Called when a warning is raised during the parsing process. 047 * <p>Warnings are <strong>never</strong> considered to be fatal. 048 * @param problem the source of the warning (never {@code null}) 049 */ 050 void warning(Problem problem); 051 052}