Class ContextUtils


  • public class ContextUtils
    extends java.lang.Object
    Created by Navid Mitchell on 7/7/20
    • Constructor Summary

      Constructors 
      Constructor Description
      ContextUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.springframework.core.env.MapPropertySource getGrindPropertySource​(org.springframework.context.support.GenericApplicationContext applicationContext)
      Returns the MapPropertySource used internally by "Grind" to store property values during Task execution
      static <T> T getProperty​(java.lang.String propertyName, org.springframework.context.support.GenericApplicationContext applicationContext)
      Gets a property from the given active context.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ContextUtils

        public ContextUtils()
    • Method Detail

      • getProperty

        public static <T> T getProperty​(java.lang.String propertyName,
                                        org.springframework.context.support.GenericApplicationContext applicationContext)
        Gets a property from the given active context.
        Type Parameters:
        T - type of the property expected
        Parameters:
        propertyName - the name of the property to retrieve
        Returns:
        the property or null if not value is found for the given name
      • getGrindPropertySource

        public static org.springframework.core.env.MapPropertySource getGrindPropertySource​(org.springframework.context.support.GenericApplicationContext applicationContext)
        Returns the MapPropertySource used internally by "Grind" to store property values during Task execution
        Parameters:
        applicationContext - to get the MapPropertySource from
        Returns:
        the MapPropertySource