/** * Determine if this {@code ContextConfigurationAttributes} instance has * either path-based resource locations or class-based resources. * @return {@code true} if either the {@link #getLocations() locations} * or the {@link #getClasses() classes} array is not empty * @see #hasLocations() * @see #hasClasses() */ public boolean hasResources() { return (hasLocations() || hasClasses()); }
public void processContextConfiguration(final ContextConfigurationAttributes configAttributes) { Assert.notNull(configAttributes, "configAttributes must not be null"); Assert.isTrue(!(configAttributes.hasLocations() && configAttributes.hasClasses()), () -> String.format("Cannot process locations AND classes for context configuration %s: " + "configure one or the other, but not both.", configAttributes)); if (configAttributes.hasLocations()) { delegateProcessing(getXmlLoader(), configAttributes); boolean xmlLoaderDetectedDefaults = configAttributes.hasLocations(); Assert.state(xmlLoaderDetectedDefaults || !configAttributes.hasLocations(), () -> String.format( "%s should NOT have detected default locations for context configuration %s.", name(getAnnotationConfigLoader()), configAttributes)); if (configAttributes.hasLocations() && configAttributes.hasClasses()) { String msg = String.format( "Configuration error: both default locations AND default configuration classes " +
@Override public void processContextConfiguration( final ContextConfigurationAttributes configAttributes) { Assert.notNull(configAttributes, "configAttributes must not be null"); Assert.isTrue(!(configAttributes.hasLocations() && configAttributes.hasClasses()), String.format( "Cannot process locations AND classes for context " + "configuration %s; configure one or the other, but not both.", configAttributes));
/** * Determine if this {@code ContextConfigurationAttributes} instance has * either path-based resource locations or class-based resources. * @return {@code true} if either the {@link #getLocations() locations} * or the {@link #getClasses() classes} array is not empty * @see #hasLocations() * @see #hasClasses() */ public boolean hasResources() { return (hasLocations() || hasClasses()); }
/** * Determine if this {@code ContextConfigurationAttributes} instance has * either path-based resource locations or class-based resources. * @return {@code true} if either the {@link #getLocations() locations} * or the {@link #getClasses() classes} array is not empty * @see #hasLocations() * @see #hasClasses() */ public boolean hasResources() { return (hasLocations() || hasClasses()); }
Assert.isTrue(!(configAttributes.hasLocations() && configAttributes.hasClasses()), String.format( "Cannot process locations AND configuration classes for context " + "configuration %s; configure one or the other, but not both.", configAttributes)); if (configAttributes.hasLocations()) { delegateProcessing(xmlLoader, configAttributes); boolean xmlLoaderDetectedDefaults = configAttributes.hasLocations(); if (!xmlLoaderDetectedDefaults && configAttributes.hasLocations()) { throw new IllegalStateException(String.format( "%s should NOT have detected default locations for context configuration %s.", if (configAttributes.hasLocations() && configAttributes.hasClasses()) { String message = String.format( "Configuration error: both default locations AND default configuration classes "
public void processContextConfiguration(final ContextConfigurationAttributes configAttributes) { Assert.notNull(configAttributes, "configAttributes must not be null"); Assert.isTrue(!(configAttributes.hasLocations() && configAttributes.hasClasses()), () -> String.format("Cannot process locations AND classes for context configuration %s: " + "configure one or the other, but not both.", configAttributes)); if (configAttributes.hasLocations()) { delegateProcessing(getXmlLoader(), configAttributes); boolean xmlLoaderDetectedDefaults = configAttributes.hasLocations(); Assert.state(xmlLoaderDetectedDefaults || !configAttributes.hasLocations(), () -> String.format( "%s should NOT have detected default locations for context configuration %s.", name(getAnnotationConfigLoader()), configAttributes)); if (configAttributes.hasLocations() && configAttributes.hasClasses()) { String msg = String.format( "Configuration error: both default locations AND default configuration classes " +
public void processContextConfiguration(final ContextConfigurationAttributes configAttributes) { Assert.notNull(configAttributes, "configAttributes must not be null"); Assert.isTrue(!(configAttributes.hasLocations() && configAttributes.hasClasses()), String.format( "Cannot process locations AND classes for context configuration %s: " + "configure one or the other, but not both.", configAttributes)); if (configAttributes.hasLocations()) { delegateProcessing(getXmlLoader(), configAttributes); boolean xmlLoaderDetectedDefaults = configAttributes.hasLocations(); if (!xmlLoaderDetectedDefaults && configAttributes.hasLocations()) { throw new IllegalStateException(String.format( "%s should NOT have detected default locations for context configuration %s.", if (configAttributes.hasLocations() && configAttributes.hasClasses()) { String msg = String.format( "Configuration error: both default locations AND default configuration classes " +