Class SpringApplicationUtils

  • All Implemented Interfaces:
    io.microsphere.util.Utils

    public abstract class SpringApplicationUtils
    extends java.lang.Object
    implements io.microsphere.util.Utils
    SpringApplication Utilities class
    Since:
    1.0.0
    Author:
    Mercy
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addDefaultPropertiesResource​(java.lang.String resourceLocation)
      Add "defaultProperties" resource path
      static void addDefaultPropertiesResources​(java.lang.String... resourceLocations)
      Add one or more "defaultProperties" resource paths
      static java.util.Set<java.lang.String> getDefaultPropertiesResources()  
      static java.lang.String getLoggingLevel​(org.springframework.context.ConfigurableApplicationContext context)
      Get logging level with upper case from the Spring PropertySources
      static java.lang.String getLoggingLevel​(org.springframework.core.env.PropertyResolver propertyResolver)
      Get logging level(Upper case) from the Spring PropertySources
      static org.springframework.core.io.ResourceLoader getResourceLoader​(org.springframework.boot.SpringApplication springApplication)  
      static void log​(org.springframework.boot.SpringApplication springApplication, java.lang.String[] args, java.lang.String pattern, java.lang.Object... patternArgs)
      Log SpringApplication
      static void log​(org.springframework.boot.SpringApplication springApplication, java.lang.String[] args, org.springframework.context.ConfigurableApplicationContext context, java.lang.String pattern, java.lang.Object... patternArgs)
      Log SpringApplication
      • Methods inherited from class java.lang.Object

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

      • addDefaultPropertiesResource

        public static void addDefaultPropertiesResource​(java.lang.String resourceLocation)
        Add "defaultProperties" resource path
        Parameters:
        resourceLocation - "defaultProperties" resource path
      • addDefaultPropertiesResources

        public static void addDefaultPropertiesResources​(java.lang.String... resourceLocations)
        Add one or more "defaultProperties" resource paths
        Parameters:
        resourceLocations - one or more "defaultProperties" resource paths
      • getDefaultPropertiesResources

        public static java.util.Set<java.lang.String> getDefaultPropertiesResources()
        Returns:
        read-only defaultPropertiesResources
      • getResourceLoader

        public static org.springframework.core.io.ResourceLoader getResourceLoader​(org.springframework.boot.SpringApplication springApplication)
      • getLoggingLevel

        public static java.lang.String getLoggingLevel​(@Nullable
                                                       org.springframework.context.ConfigurableApplicationContext context)
        Get logging level with upper case from the Spring PropertySources
        Parameters:
        context - ConfigurableApplicationContext context
        Returns:
        logging level with upper case
      • getLoggingLevel

        public static java.lang.String getLoggingLevel​(@Nullable
                                                       org.springframework.core.env.PropertyResolver propertyResolver)
        Get logging level(Upper case) from the Spring PropertySources
        Parameters:
        propertyResolver - PropertyResolver
        Returns:
        logging level with upper case
      • log

        public static void log​(org.springframework.boot.SpringApplication springApplication,
                               java.lang.String[] args,
                               java.lang.String pattern,
                               java.lang.Object... patternArgs)
        Log SpringApplication
        Parameters:
        springApplication - SpringApplication
        args - the command line arguments
        pattern - the logging message pattern
        patternArgs - the logging message arguments
      • log

        public static void log​(org.springframework.boot.SpringApplication springApplication,
                               java.lang.String[] args,
                               @Nullable
                               org.springframework.context.ConfigurableApplicationContext context,
                               java.lang.String pattern,
                               java.lang.Object... patternArgs)
        Log SpringApplication
        Parameters:
        springApplication - SpringApplication
        args - the command line arguments
        context - ConfigurableApplicationContext
        pattern - the logging message pattern
        patternArgs - the logging message arguments