/** * Raise a regular error. */ public void error(String message, @Nullable Object source, @Nullable ParseState parseState, @Nullable Throwable cause) { Location location = new Location(getResource(), source); this.problemReporter.error(new Problem(message, location, parseState, cause)); }
/** * Raise a fatal error. */ public void fatal(String message, @Nullable Object source, @Nullable ParseState parseState, @Nullable Throwable cause) { Location location = new Location(getResource(), source); this.problemReporter.fatal(new Problem(message, location, parseState, cause)); }
/** * Raise a non-critical warning. */ public void warning(String message, @Nullable Object source, @Nullable ParseState parseState, @Nullable Throwable cause) { Location location = new Location(getResource(), source); this.problemReporter.warning(new Problem(message, location, parseState, cause)); }
/** * Raise a regular error. */ public void error(String message, @Nullable Object source, @Nullable ParseState parseState, @Nullable Throwable cause) { Location location = new Location(getResource(), source); this.problemReporter.error(new Problem(message, location, parseState, cause)); }
/** * Raise a non-critical warning. */ public void warning(String message, @Nullable Object source, @Nullable ParseState parseState, @Nullable Throwable cause) { Location location = new Location(getResource(), source); this.problemReporter.warning(new Problem(message, location, parseState, cause)); }
/** * Raise a fatal error. */ public void fatal(String message, @Nullable Object source, @Nullable ParseState parseState, @Nullable Throwable cause) { Location location = new Location(getResource(), source); this.problemReporter.fatal(new Problem(message, location, parseState, cause)); }
public void validate(ProblemReporter problemReporter) { // A configuration class may not be final (CGLIB limitation) if (getMetadata().isAnnotated(Configuration.class.getName())) { if (getMetadata().isFinal()) { problemReporter.error(new FinalConfigurationProblem()); } } for (BeanMethod beanMethod : this.beanMethods) { beanMethod.validate(problemReporter); } }
public void warning(String message, Object source, ParseState parseState, Throwable cause) { Location location = new Location(getResource(), source); this.problemReporter.warning(new Problem(message, location, parseState, cause)); }
public void fatal(String message, Object source, ParseState parseState, Throwable cause) { Location location = new Location(getResource(), source); this.problemReporter.fatal(new Problem(message, location, parseState, cause)); }
@Override public void validate(ProblemReporter problemReporter) { if (getMetadata().isStatic()) { // static @Bean methods have no constraints to validate -> return immediately return; } if (this.configurationClass.getMetadata().isAnnotated(Configuration.class.getName())) { if (!getMetadata().isOverridable()) { // instance @Bean methods within @Configuration classes must be overridable to accommodate CGLIB problemReporter.error(new NonOverridableMethodError()); } } }
/** * Raise a non-critical warning. */ public void warning(String message, Object source, ParseState parseState, Throwable cause) { Location location = new Location(getResource(), source); this.problemReporter.warning(new Problem(message, location, parseState, cause)); }
/** * Raise a fatal error. */ public void fatal(String message, Object source, ParseState parseState, Throwable cause) { Location location = new Location(getResource(), source); this.problemReporter.fatal(new Problem(message, location, parseState, cause)); }
public void validate(ProblemReporter problemReporter) { // A configuration class may not be final (CGLIB limitation) if (getMetadata().isAnnotated(Configuration.class.getName())) { if (getMetadata().isFinal()) { problemReporter.error(new FinalConfigurationProblem()); } } for (BeanMethod beanMethod : this.beanMethods) { beanMethod.validate(problemReporter); } }
/** * Register member (nested) classes that happen to be configuration classes themselves. */ private void processMemberClasses(ConfigurationClass configClass, SourceClass sourceClass) throws IOException { Collection<SourceClass> memberClasses = sourceClass.getMemberClasses(); if (!memberClasses.isEmpty()) { List<SourceClass> candidates = new ArrayList<>(memberClasses.size()); for (SourceClass memberClass : memberClasses) { if (ConfigurationClassUtils.isConfigurationCandidate(memberClass.getMetadata()) && !memberClass.getMetadata().getClassName().equals(configClass.getMetadata().getClassName())) { candidates.add(memberClass); } } OrderComparator.sort(candidates); for (SourceClass candidate : candidates) { if (this.importStack.contains(configClass)) { this.problemReporter.error(new CircularImportProblem(configClass, this.importStack)); } else { this.importStack.push(configClass); try { processConfigurationClass(candidate.asConfigClass(configClass)); } finally { this.importStack.pop(); } } } } }
@Override public void validate(ProblemReporter problemReporter) { if (getMetadata().isStatic()) { // static @Bean methods have no constraints to validate -> return immediately return; } if (this.configurationClass.getMetadata().isAnnotated(Configuration.class.getName())) { if (!getMetadata().isOverridable()) { // instance @Bean methods within @Configuration classes must be overridable to accommodate CGLIB problemReporter.error(new NonOverridableMethodError()); } } }
/** * Register member (nested) classes that happen to be configuration classes themselves. */ private void processMemberClasses(ConfigurationClass configClass, SourceClass sourceClass) throws IOException { Collection<SourceClass> memberClasses = sourceClass.getMemberClasses(); if (!memberClasses.isEmpty()) { List<SourceClass> candidates = new ArrayList<>(memberClasses.size()); for (SourceClass memberClass : memberClasses) { if (ConfigurationClassUtils.isConfigurationCandidate(memberClass.getMetadata()) && !memberClass.getMetadata().getClassName().equals(configClass.getMetadata().getClassName())) { candidates.add(memberClass); } } OrderComparator.sort(candidates); for (SourceClass candidate : candidates) { if (this.importStack.contains(configClass)) { this.problemReporter.error(new CircularImportProblem(configClass, this.importStack)); } else { this.importStack.push(configClass); try { processConfigurationClass(candidate.asConfigClass(configClass)); } finally { this.importStack.pop(); } } } } }
this.problemReporter.error(new CircularImportProblem(configClass, this.importStack));
this.problemReporter.error(new CircularImportProblem(configClass, this.importStack));
public void error(String message, Object source, ParseState parseState, Throwable cause) { Location location = new Location(getResource(), source); this.problemReporter.error(new Problem(message, location, parseState, cause)); }
/** * Raise a regular error. */ public void error(String message, Object source, ParseState parseState, Throwable cause) { Location location = new Location(getResource(), source); this.problemReporter.error(new Problem(message, location, parseState, cause)); }