/** * Throws a {@link BeanDefinitionParsingException} detailing the error * that has occurred. * @param problem the source of the error */ @Override public void fatal(Problem problem) { throw new BeanDefinitionParsingException(problem); }
/** * Create a new BeanDefinitionParsingException. * @param problem the configuration problem that was detected during the parsing process */ public BeanDefinitionParsingException(Problem problem) { super(problem.getResourceDescription(), problem.toString(), problem.getRootCause()); }
/** * Delegates to {@link #getName}. */ @Override public String getDescription() { return getName(); }
/** * 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)); }
@Override public BeanDefinition[] getBeanDefinitions() { return new BeanDefinition[] {getBeanDefinition()}; }
@Override public String getName() { return getBeanName(); }
/** * Get the description of the bean configuration source that triggered the error, * as contained within this Problem's Location object. * @see #getLocation() */ public String getResourceDescription() { return getLocation().getResource().getDescription(); }
/** * Fire an import-processed event. */ public void fireImportProcessed(String importedResource, @Nullable Object source) { this.eventListener.importProcessed(new ImportDefinition(importedResource, source)); }
/** * Fire an alias-registered event. */ public void fireAliasRegistered(String beanName, String alias, @Nullable Object source) { this.eventListener.aliasRegistered(new AliasDefinition(beanName, alias, source)); }
/** * Create a new instance of {@link ParseState} which is an independent snapshot * of this instance. */ public ParseState snapshot() { return new ParseState(this); }
/** * Delegates to {@link #getDescription}. */ @Override public String toString() { return getDescription(); }
/** * Fire an component-registered event. */ public void fireComponentRegistered(ComponentDefinition componentDefinition) { this.eventListener.componentRegistered(componentDefinition); }
/** * Fire an defaults-registered event. */ public void fireDefaultsRegistered(DefaultsDefinition defaultsDefinition) { this.eventListener.defaultsRegistered(defaultsDefinition); }
/** * This implementation returns this ComponentDefinition's description. * @see #getDescription() */ @Override public String toString() { return getDescription(); }
@Override public String getDescription() { return getShortDescription(); }
/** * Throws a {@link BeanDefinitionParsingException} detailing the error * that has occurred. * @param problem the source of the error */ @Override public void error(Problem problem) { throw new BeanDefinitionParsingException(problem); }
/** * Fire an import-processed event. */ public void fireImportProcessed(String importedResource, Resource[] actualResources, @Nullable Object source) { this.eventListener.importProcessed(new ImportDefinition(importedResource, actualResources, source)); }
@Override public void fatal(Problem problem) { throw new BeanDefinitionParsingException(problem); }