当前位置: 首页>>代码示例>>Java>>正文


Java ContextConfigurationAttributes.hasClasses方法代码示例

本文整理汇总了Java中org.springframework.test.context.ContextConfigurationAttributes.hasClasses方法的典型用法代码示例。如果您正苦于以下问题:Java ContextConfigurationAttributes.hasClasses方法的具体用法?Java ContextConfigurationAttributes.hasClasses怎么用?Java ContextConfigurationAttributes.hasClasses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.test.context.ContextConfigurationAttributes的用法示例。


在下文中一共展示了ContextConfigurationAttributes.hasClasses方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processContextConfiguration

import org.springframework.test.context.ContextConfigurationAttributes; //导入方法依赖的package包/类
@Override
public void processContextConfiguration(ContextConfigurationAttributes configAttributes) {
	// Detect default XML configuration files:
	super.processContextConfiguration(configAttributes);

	// Detect default configuration classes:
	if (!configAttributes.hasClasses() && isGenerateDefaultLocations()) {
		configAttributes.setClasses(detectDefaultConfigurationClasses(configAttributes.getDeclaringClass()));
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:HybridContextLoader.java

示例2: processContextConfiguration

import org.springframework.test.context.ContextConfigurationAttributes; //导入方法依赖的package包/类
/**
 * Process <em>annotated classes</em> in the supplied {@link ContextConfigurationAttributes}.
 *
 * <p>If the <em>annotated classes</em> are {@code null} or empty and
 * {@link #isGenerateDefaultLocations()} returns {@code true}, this
 * {@code SmartContextLoader} will attempt to {@linkplain
 * #detectDefaultConfigurationClasses detect default configuration classes}.
 * If defaults are detected they will be
 * {@linkplain ContextConfigurationAttributes#setClasses(Class[]) set} in the
 * supplied configuration attributes. Otherwise, properties in the supplied
 * configuration attributes will not be modified.
 *
 * @param configAttributes the context configuration attributes to process
 * @see org.springframework.test.context.SmartContextLoader#processContextConfiguration(ContextConfigurationAttributes)
 * @see #isGenerateDefaultLocations()
 * @see #detectDefaultConfigurationClasses(Class)
 */
@Override
public void processContextConfiguration(ContextConfigurationAttributes configAttributes) {
	if (!configAttributes.hasClasses() && isGenerateDefaultLocations()) {
		configAttributes.setClasses(detectDefaultConfigurationClasses(configAttributes.getDeclaringClass()));
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:24,代码来源:AnnotationConfigWebContextLoader.java

示例3: processContextConfiguration

import org.springframework.test.context.ContextConfigurationAttributes; //导入方法依赖的package包/类
/**
 * Process <em>annotated classes</em> in the supplied {@link ContextConfigurationAttributes}.
 *
 * <p>If the <em>annotated classes</em> are {@code null} or empty and
 * {@link #isGenerateDefaultLocations()} returns {@code true}, this
 * {@code SmartContextLoader} will attempt to {@link
 * #detectDefaultConfigurationClasses detect default configuration classes}.
 * If defaults are detected they will be
 * {@link ContextConfigurationAttributes#setClasses(Class[]) set} in the
 * supplied configuration attributes. Otherwise, properties in the supplied
 * configuration attributes will not be modified.
 *
 * @param configAttributes the context configuration attributes to process
 * @see org.springframework.test.context.SmartContextLoader#processContextConfiguration(ContextConfigurationAttributes)
 * @see #isGenerateDefaultLocations()
 * @see #detectDefaultConfigurationClasses(Class)
 */
@Override
public void processContextConfiguration(ContextConfigurationAttributes configAttributes) {
	if (!configAttributes.hasClasses() && isGenerateDefaultLocations()) {
		configAttributes.setClasses(detectDefaultConfigurationClasses(configAttributes.getDeclaringClass()));
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:24,代码来源:AnnotationConfigContextLoader.java


注:本文中的org.springframework.test.context.ContextConfigurationAttributes.hasClasses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。