Class SpringApplicationUtils

java.lang.Object
io.microsphere.spring.boot.util.SpringApplicationUtils
All Implemented Interfaces:
io.microsphere.util.Utils

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

    • addDefaultPropertiesResource

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

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

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

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

      public static 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 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, String[] args, String pattern, 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, String[] args, @Nullable org.springframework.context.ConfigurableApplicationContext context, String pattern, Object... patternArgs)
      Log SpringApplication
      Parameters:
      springApplication - SpringApplication
      args - the command line arguments
      context - ConfigurableApplicationContext
      pattern - the logging message pattern
      patternArgs - the logging message arguments