/** * Set the {@link ProblemReporter} to use. * <p>Used to register any problems detected with {@link Configuration} or {@link Bean} * declarations. For instance, an @Bean method marked as {@code final} is illegal * and would be reported as a problem. Defaults to {@link FailFastProblemReporter}. */ public void setProblemReporter(@Nullable ProblemReporter problemReporter) { this.problemReporter = (problemReporter != null ? problemReporter : new FailFastProblemReporter()); }
@Test public void testWarn() throws Exception { Problem problem = new Problem("VGER", new Location(new DescriptiveResource("here")), null, new IllegalArgumentException()); Log log = mock(Log.class); FailFastProblemReporter reporter = new FailFastProblemReporter(); reporter.setLogger(log); reporter.warning(problem); verify(log).warn(any(), isA(IllegalArgumentException.class)); }
@Test(expected = BeanDefinitionParsingException.class) public void testError() throws Exception { FailFastProblemReporter reporter = new FailFastProblemReporter(); reporter.error(new Problem("VGER", new Location(new DescriptiveResource("here")), null, new IllegalArgumentException())); }
@Override public void fatal(Problem problem) { if (isMissingParser(problem)) { problem = extendProblemDetails(problem); } super.fatal(problem); }
@Override public void fatal(Problem problem) { if (isMissingParser(problem)) { problem = extendProblemDetails(problem); } super.fatal(problem); }
/** * Specify which {@link org.springframework.beans.factory.parsing.ProblemReporter} to use. * <p>The default implementation is {@link org.springframework.beans.factory.parsing.FailFastProblemReporter} * which exhibits fail fast behaviour. External tools can provide an alternative implementation * that collates errors and warnings for display in the tool UI. */ public void setProblemReporter(@Nullable ProblemReporter problemReporter) { this.problemReporter = (problemReporter != null ? problemReporter : new FailFastProblemReporter()); }
@Override public void fatal(Problem problem) { if (isMissingParser(problem)) { problem = extendProblemDetails(problem); } super.fatal(problem); }
/** * Set the {@link ProblemReporter} to use. * <p>Used to register any problems detected with {@link Configuration} or {@link Bean} * declarations. For instance, an @Bean method marked as {@code final} is illegal * and would be reported as a problem. Defaults to {@link FailFastProblemReporter}. */ public void setProblemReporter(@Nullable ProblemReporter problemReporter) { this.problemReporter = (problemReporter != null ? problemReporter : new FailFastProblemReporter()); }
/** * Specify which {@link org.springframework.beans.factory.parsing.ProblemReporter} to use. * <p>The default implementation is {@link org.springframework.beans.factory.parsing.FailFastProblemReporter} * which exhibits fail fast behaviour. External tools can provide an alternative implementation * that collates errors and warnings for display in the tool UI. */ public void setProblemReporter(@Nullable ProblemReporter problemReporter) { this.problemReporter = (problemReporter != null ? problemReporter : new FailFastProblemReporter()); }
@Override protected ConfigurationClassParser newParser() { return new ConfigurationClassParser( new CachingMetadataReaderFactory(), new FailFastProblemReporter(), new StandardEnvironment(), new DefaultResourceLoader(), new AnnotationBeanNameGenerator(), new DefaultListableBeanFactory()); }
/** * Specify which {@link org.springframework.beans.factory.parsing.ProblemReporter} to use. * <p>The default implementation is {@link org.springframework.beans.factory.parsing.FailFastProblemReporter} * which exhibits fail fast behaviour. External tools can provide an alternative implementation * that collates errors and warnings for display in the tool UI. */ public void setProblemReporter(ProblemReporter problemReporter) { this.problemReporter = (problemReporter != null ? problemReporter : new FailFastProblemReporter()); }
static ParserContext createFakeParserContext() { return new ParserContext( new XmlReaderContext(thisClassAsResource(), new FailFastProblemReporter(), null, null, null, null), null); }
/** * Specify which {@link org.springframework.beans.factory.parsing.ProblemReporter} to use. * <p>The default implementation is {@link org.springframework.beans.factory.parsing.FailFastProblemReporter} * which exhibits fail fast behaviour. External tools can provide an alternative implementation * that collates errors and warnings for display in the tool UI. */ public void setProblemReporter(ProblemReporter problemReporter) { this.problemReporter = (problemReporter != null ? problemReporter : new FailFastProblemReporter()); }
/** * Set the {@link ProblemReporter} to use. * <p>Used to register any problems detected with {@link Configuration} or {@link Bean} * declarations. For instance, an @Bean method marked as {@code final} is illegal * and would be reported as a problem. Defaults to {@link FailFastProblemReporter}. */ public void setProblemReporter(@Nullable ProblemReporter problemReporter) { this.problemReporter = (problemReporter != null ? problemReporter : new FailFastProblemReporter()); }