Java Code Examples for org.springframework.core.SpringProperties#getFlag()
The following examples show how to use
org.springframework.core.SpringProperties#getFlag() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SpringObjenesis.java From spring-analysis-note with MIT License | 5 votes |
/** * 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; } }
Example 2
Source File: SpringObjenesis.java From java-technology-stack with MIT License | 5 votes |
/** * 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; } }
Example 3
Source File: SpringObjenesis.java From lams with GNU General Public License v2.0 | 5 votes |
/** * 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; } }
Example 4
Source File: SpringObjenesis.java From spring4-understanding with Apache License 2.0 | 5 votes |
/** * 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; } }
Example 5
Source File: TestConstructorUtils.java From spring-analysis-note with MIT License | 3 votes |
/** * Determine if the supplied constructor for the given test class is * autowirable. * * <p>A constructor is considered to be autowirable if one of the following * conditions is {@code true}. * * <ol> * <li>The constructor is annotated with {@link Autowired @Autowired}.</li> * <li>{@link TestConstructor @TestConstructor} is <em>present</em> or * <em>meta-present</em> on the test class with * {@link TestConstructor#autowire autowire} set to {@code true}.</li> * <li>The default <em>test constructor autowire</em> mode is set to {@code true} * (see {@link TestConstructor#TEST_CONSTRUCTOR_AUTOWIRE_PROPERTY_NAME}).</li> * </ol> * * @param constructor a constructor for the test class * @param testClass the test class * @return {@code true} if the constructor is autowirable * @see #isAutowirableConstructor(Executable, Class) */ public static boolean isAutowirableConstructor(Constructor<?> constructor, Class<?> testClass) { // Is the constructor annotated with @Autowired? if (AnnotatedElementUtils.hasAnnotation(constructor, Autowired.class)) { return true; } // Is the test class annotated with @TestConstructor? TestConstructor testConstructor = AnnotatedElementUtils.findMergedAnnotation(testClass, TestConstructor.class); if (testConstructor != null) { return testConstructor.autowire(); } // Else use global default. return SpringProperties.getFlag(TestConstructor.TEST_CONSTRUCTOR_AUTOWIRE_PROPERTY_NAME); }
Example 6
Source File: AbstractEnvironment.java From spring-analysis-note with MIT License | 2 votes |
/** * 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); }
Example 7
Source File: AbstractEnvironment.java From java-technology-stack with MIT License | 2 votes |
/** * 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); }
Example 8
Source File: AbstractEnvironment.java From lams with GNU General Public License v2.0 | 2 votes |
/** * 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); }
Example 9
Source File: AbstractEnvironment.java From spring4-understanding with Apache License 2.0 | 2 votes |
/** * 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); }