Class SpringContextUtils

java.lang.Object
com.appjars.utils.SpringContextUtils
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Component public class SpringContextUtils extends Object implements org.springframework.context.ApplicationContextAware
  • Field Details

    • context

      protected static org.springframework.context.ApplicationContext context
  • Constructor Details

    • SpringContextUtils

      public SpringContextUtils()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
    • getApplicationContext

      public static org.springframework.context.ApplicationContext getApplicationContext()
    • getProperty

      public static String getProperty(String key, String defaultValue)
      Returns a property value from the Spring environment.
      Parameters:
      key - the property key
      defaultValue - the default value if the property is not found
      Returns:
      the property value or the default value
    • getProperty

      public static String getProperty(String key)
      Returns a property value from the Spring environment.
      Parameters:
      key - the property key
      Returns:
      the property value or null if not found