public Location getResourceLocation() { return new Location(this.configurationClass.getResource(), this.metadata); }
/** * 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(); }
protected Problem extendProblemDetails(Problem problem) { try { String element = ((Element) problem.getLocation().getSource()).getLocalName(); String namespace = ((Element) problem.getLocation().getSource()).getNamespaceURI(); String message = "The element '" + element + "' does not have an associated Bean Definition Parser." + " " + getMissingModuleOrExtensionMessage(namespace); return new Problem(message, problem.getLocation(), problem.getParseState(), problem.getRootCause()); } catch (Exception e) { // fall back to previous message return problem; } }
protected Problem extendProblemDetails(Problem problem) { try { String element = ((Element) problem.getLocation().getSource()).getLocalName(); String namespace = ((Element) problem.getLocation().getSource()).getNamespaceURI(); String message = "The element '" + element + "' does not have an associated Bean Definition Parser." + " " + getMissingModuleOrExtensionMessage(namespace); return new Problem(message, problem.getLocation(), problem.getParseState(), problem.getRootCause()); } catch (Exception e) { // fall back to previous message return problem; } }
/** * 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)); }
/** * 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(); }
/** * 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)); }
/** * 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(); }
/** * 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)); }
/** * 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(); }
public Location getResourceLocation() { return new Location(this.configurationClass.getResource(), this.metadata); }
public FinalConfigurationProblem() { super(String.format("@Configuration class '%s' may not be final. Remove the final modifier to continue.", getSimpleName()), new Location(getResource(), getMetadata())); } }
/** * Define a Spring XML namespace definition to use. * @param definition the namespace definition */ public void xmlns(Map<String, String> definition) { if (!definition.isEmpty()) { for (Map.Entry<String,String> entry : definition.entrySet()) { String namespace = entry.getKey(); String uri = entry.getValue(); if (uri == null) { throw new IllegalArgumentException("Namespace definition must supply a non-null URI"); } NamespaceHandler namespaceHandler = this.groovyDslXmlBeanDefinitionReader.getNamespaceHandlerResolver().resolve(uri); if (namespaceHandler == null) { throw new BeanDefinitionParsingException(new Problem("No namespace handler found for URI: " + uri, new Location(new DescriptiveResource(("Groovy"))))); } this.namespaces.put(namespace, uri); } } }
/** * 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 FinalConfigurationProblem() { super(String.format("@Configuration class '%s' may not be final. Remove the final modifier to continue.", getSimpleName()), new Location(getResource(), getMetadata())); } }
/** * Define a Spring XML namespace definition to use. * @param definition the namespace definition */ public void xmlns(Map<String, String> definition) { if (!definition.isEmpty()) { for (Map.Entry<String,String> entry : definition.entrySet()) { String namespace = entry.getKey(); String uri = entry.getValue(); if (uri == null) { throw new IllegalArgumentException("Namespace definition must supply a non-null URI"); } NamespaceHandler namespaceHandler = this.groovyDslXmlBeanDefinitionReader.getNamespaceHandlerResolver().resolve(uri); if (namespaceHandler == null) { throw new BeanDefinitionParsingException(new Problem("No namespace handler found for URI: " + uri, new Location(new DescriptiveResource(("Groovy"))))); } this.namespaces.put(namespace, uri); } } }
public CircularImportProblem(ConfigurationClass attemptedImport, Deque<ConfigurationClass> importStack) { super(String.format("A circular @Import has been detected: " + "Illegal attempt by @Configuration class '%s' to import class '%s' as '%s' is " + "already present in the current import stack %s", importStack.element().getSimpleName(), attemptedImport.getSimpleName(), attemptedImport.getSimpleName(), importStack), new Location(importStack.element().getResource(), attemptedImport.getMetadata())); } }
new Location(encodedResource.getResource()), null, ex));