Package org.springframework.beans.factory.parsing

Examples of org.springframework.beans.factory.parsing.Location


                GroovyShell shell = classLoader == null ? new GroovyShell(b) : new GroovyShell(classLoader, b);
                shell.evaluate(new InputStreamReader(resource.getInputStream(), "UTF-8"));
            }
            catch (Throwable e) {
                throw new BeanDefinitionParsingException(
                        new Problem("Error evaluating bean definition script: " + e.getMessage(), new Location(resource), null, e));
            }
        }
    }
View Full Code Here


    public InvalidConfigurationImportProblem(String className, Resource resource, AnnotationMetadata metadata) {
      super(String.format("%s was @Import'ed but is not annotated with @Configuration " +
          "nor does it declare any @Bean methods; it does not implement ImportSelector " +
          "or extend ImportBeanDefinitionRegistrar. Update the class to meet one of these requirements " +
          "or do not attempt to @Import it.", className), new Location(resource, metadata));
    }
View Full Code Here

   */
  private class FinalConfigurationProblem extends Problem {

    public FinalConfigurationProblem() {
      super(String.format("@Configuration class '%s' may not be final. Remove the final modifier to continue.",
          getSimpleName()), new Location(getResource(), getMetadata()));
    }
View Full Code Here

    public CircularImportProblem(ConfigurationClass attemptedImport, Stack<ConfigurationClass> importStack, AnnotationMetadata metadata) {
      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.peek().getSimpleName(),
          attemptedImport.getSimpleName(), attemptedImport.getSimpleName(), importStack),
          new Location(importStack.peek().getResource(), metadata));
    }
View Full Code Here

      GroovyShell shell = new GroovyShell(getResourceLoader().getClassLoader(), binding);
      shell.evaluate(encodedResource.getReader(), encodedResource.getResource().getFilename());
    }
    catch (Throwable ex) {
      throw new BeanDefinitionParsingException(new Problem("Error evaluating Groovy script: " + ex.getMessage(),
          new Location(encodedResource.getResource()), null, ex));
    }
    return getRegistry().getBeanDefinitionCount() - countBefore;
  }
View Full Code Here

          throw new IllegalArgumentException("Namespace definition must supply a non-null URI");
        }
        NamespaceHandler namespaceHandler = this.xmlBeanDefinitionReader.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);
      }
    }
  }
View Full Code Here

 
    public InvalidConfigurationImportProblem(String className, Resource resource, AnnotationMetadata metadata) {
      super(String.format("%s was imported as a Configuration class but is not annotated " +
          "with @Configuration nor does it declare any @Bean methods. Update the class to " +
          "meet either of these requirements or do not attempt to import it.", className),
          new Location(resource, metadata));
    }
View Full Code Here

  /** Configuration classes must be non-final to accommodate CGLIB subclassing. */
  private class FinalConfigurationProblem extends Problem {

    public FinalConfigurationProblem() {
      super(String.format("@Configuration class '%s' may not be final. Remove the final modifier to continue.",
          getSimpleName()), new Location(getResource(), getMetadata()));
    }
View Full Code Here

  private class BeanMethodOverloadingProblem extends Problem {

    public BeanMethodOverloadingProblem(String methodName, int count) {
      super(String.format("@Configuration class '%s' has %s overloaded @Bean methods named '%s'. " +
          "Only one @Bean method of a given name is allowed within each @Configuration class.",
          getSimpleName(), count, methodName), new Location(getResource(), getMetadata()));
    }
View Full Code Here

  public ConfigurationClass getConfigurationClass() {
    return this.configurationClass;
  }

  public Location getResourceLocation() {
    return new Location(this.configurationClass.getResource(), metadata);
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.parsing.Location

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.