org.springframework.core

## 类 SpringProperties

- java.lang.Object
- - org.springframework.core.SpringProperties

-     public abstract class SpringProperties
      extends Object

  Static holder for local Spring properties, i.e. defined at the Spring library level.

  Reads a `spring.properties` file from the root of the Spring library classpath, and also allows for programmatically setting properties through `setProperty(java.lang.String, java.lang.String)`. When checking a property, local entries are being checked first, then falling back to JVM-level system properties through a `System.getProperty(java.lang.String)` check.

  This is an alternative way to set Spring-related system properties such as "spring.getenv.ignore" and "spring.beaninfo.ignore", in particular for scenarios where JVM system properties are locked on the target platform (e.g. WebSphere). See `setFlag(java.lang.String)` for a convenient way to locally set such flags to "true".

  从以下版本开始:
    3.2.7
  作者:
    Juergen Hoeller
  另请参阅:
    `AbstractEnvironment.IGNORE_GETENV_PROPERTY_NAME`, `org.springframework.beans.CachedIntrospectionResults#IGNORE_BEANINFO_PROPERTY_NAME`, `org.springframework.jdbc.core.StatementCreatorUtils#IGNORE_GETPARAMETERTYPE_PROPERTY_NAME`, `org.springframework.test.context.cache.ContextCache#MAX_CONTEXT_CACHE_SIZE_PROPERTY_NAME`

- - ### 构造器概要

    构造器
    构造器和说明
    `SpringProperties()`

  - ### 方法概要

    所有方法 静态方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static boolean` | `getFlag(String key)` Retrieve the flag for the given property key.
    `static String` | `getProperty(String key)` Retrieve the property value for the given key, checking local Spring properties first and falling back to JVM-level system properties.
    `static void` | `setFlag(String key)` Programmatically set a local flag to "true", overriding an entry in the `spring.properties` file (if any).
    `static void` | `setProperty(String key, String value)` Programmatically set a local property, overriding an entry in the `spring.properties` file (if any).

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### SpringProperties

          public SpringProperties()

  - ### 方法详细资料

    - #### setProperty

          public static void setProperty(String key,
                                         @Nullable
                                         String value)

      Programmatically set a local property, overriding an entry in the `spring.properties` file (if any).
      参数:
        `key` - the property key
        `value` - the associated property value, or `null` to reset it

    - #### getProperty

          @Nullable
          public static String getProperty(String key)

      Retrieve the property value for the given key, checking local Spring properties first and falling back to JVM-level system properties.
      参数:
        `key` - the property key
      返回:
        the associated property value, or `null` if none found

    - #### setFlag

          public static void setFlag(String key)

      Programmatically set a local flag to "true", overriding an entry in the `spring.properties` file (if any).
      参数:
        `key` - the property key

    - #### getFlag

          public static boolean getFlag(String key)

      Retrieve the flag for the given property key.
      参数:
        `key` - the property key
      返回:
        `true` if the property is set to "true", false otherwise