本文整理汇总了Java中org.springframework.core.SpringProperties类的典型用法代码示例。如果您正苦于以下问题:Java SpringProperties类的具体用法?Java SpringProperties怎么用?Java SpringProperties使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpringProperties类属于org.springframework.core包,在下文中一共展示了SpringProperties类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: SpringObjenesis
import org.springframework.core.SpringProperties; //导入依赖的package包/类
/**
* Create a new {@code SpringObjenesis} instance with the
* given standard instantiator strategy.
* @param strategy the instantiator strategy to use
*/
public SpringObjenesis(InstantiatorStrategy strategy) {
this.strategy = (strategy != null ? strategy : new StdInstantiatorStrategy());
// Evaluate the "spring.objenesis.ignore" property upfront...
if (SpringProperties.getFlag(SpringObjenesis.IGNORE_OBJENESIS_PROPERTY_NAME)) {
this.worthTrying = Boolean.FALSE;
}
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:14,代码来源:SpringObjenesis.java
示例2: getInputStream
import org.springframework.core.SpringProperties; //导入依赖的package包/类
@Test
public void getInputStream(){
ClassLoader cl = SpringProperties.class.getClassLoader();
URL url = cl.getResource("defaults/jdbc.properties");
if (url != null) {
System.out.println("OK.");
}else{
System.out.println("failure.");
}
}
开发者ID:leopardoooo,项目名称:easyooo-framework,代码行数:12,代码来源:ResourcePropertiesUtilTest.java
示例3: suppressGetenvAccessThroughSpringProperty
import org.springframework.core.SpringProperties; //导入依赖的package包/类
@Test
public void suppressGetenvAccessThroughSpringProperty() {
SpringProperties.setProperty("spring.getenv.ignore", "true");
assertTrue(environment.getSystemEnvironment().isEmpty());
SpringProperties.setProperty("spring.getenv.ignore", null);
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:7,代码来源:StandardEnvironmentTests.java
示例4: suppressGetenvAccessThroughSpringFlag
import org.springframework.core.SpringProperties; //导入依赖的package包/类
@Test
public void suppressGetenvAccessThroughSpringFlag() {
SpringProperties.setFlag("spring.getenv.ignore");
assertTrue(environment.getSystemEnvironment().isEmpty());
SpringProperties.setProperty("spring.getenv.ignore", null);
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:7,代码来源:StandardEnvironmentTests.java
示例5: suppressGetenvAccess
import org.springframework.core.SpringProperties; //导入依赖的package包/类
/**
* Determine whether to suppress {@link System#getenv()}/{@link System#getenv(String)}
* access for the purposes of {@link #getSystemEnvironment()}.
* <p>If this method returns {@code true}, an empty dummy Map will be used instead
* of the regular system environment Map, never even trying to call {@code getenv}
* and therefore avoiding security manager warnings (if any).
* <p>The default implementation checks for the "spring.getenv.ignore" system property,
* returning {@code true} if its value equals "true" in any case.
* @see #IGNORE_GETENV_PROPERTY_NAME
* @see SpringProperties#getFlag
*/
protected boolean suppressGetenvAccess() {
return SpringProperties.getFlag(IGNORE_GETENV_PROPERTY_NAME);
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:15,代码来源:AbstractEnvironment.java
注:本文中的org.springframework.core.SpringProperties类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论