Class AbstractPropertySourceLoader

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_POSITION
      Default position for the property source loader.
      protected org.slf4j.Logger log  
      • Fields inherited from interface io.micronaut.core.order.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected MapPropertySource createPropertySource​(java.lang.String name, java.util.Map<java.lang.String,​java.lang.Object> map, int order)  
      int getOrder()  
      boolean isLogEnabled()
      Deprecated.
      don't need to have this method
      java.util.Optional<PropertySource> load​(java.lang.String resourceName, io.micronaut.core.io.ResourceLoader resourceLoader)
      Load a PropertySource for the given Environment.
      java.util.Optional<PropertySource> loadEnv​(java.lang.String resourceName, io.micronaut.core.io.ResourceLoader resourceLoader, ActiveEnvironment activeEnvironment)
      Load a PropertySource for the given Environment.
      protected abstract void processInput​(java.lang.String name, java.io.InputStream input, java.util.Map<java.lang.String,​java.lang.Object> finalMap)  
      protected void processMap​(java.util.Map<java.lang.String,​java.lang.Object> finalMap, java.util.Map map, java.lang.String prefix)  
      java.util.Map<java.lang.String,​java.lang.Object> read​(java.lang.String name, java.io.InputStream input)
      Read a property source from an input stream.
      protected java.util.Optional<java.io.InputStream> readInput​(io.micronaut.core.io.ResourceLoader resourceLoader, java.lang.String fileName)  
      void setLogEnabled​(boolean logEnabled)
      Deprecated.
      set logEnabled value by constructor
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.micronaut.core.util.Toggleable

        isEnabled
    • Field Detail

      • DEFAULT_POSITION

        public static final int DEFAULT_POSITION
        Default position for the property source loader.
        See Also:
        Constant Field Values
      • log

        protected org.slf4j.Logger log
    • Constructor Detail

      • AbstractPropertySourceLoader

        protected AbstractPropertySourceLoader()
      • AbstractPropertySourceLoader

        protected AbstractPropertySourceLoader​(boolean logEnabled)
    • Method Detail

      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface io.micronaut.core.order.Ordered
      • createPropertySource

        protected MapPropertySource createPropertySource​(java.lang.String name,
                                                         java.util.Map<java.lang.String,​java.lang.Object> map,
                                                         int order)
        Parameters:
        name - The name of the property source
        map - The map
        order - The order of the property source
        Returns:
        property source
      • read

        public java.util.Map<java.lang.String,​java.lang.Object> read​(java.lang.String name,
                                                                           java.io.InputStream input)
                                                                    throws java.io.IOException
        Description copied from interface: PropertySourceReader
        Read a property source from an input stream.
        Specified by:
        read in interface PropertySourceReader
        Parameters:
        name - The name of the property source
        input - The bytes
        Returns:
        A map of string to values
        Throws:
        java.io.IOException - if there is an error processing the property source
      • readInput

        protected java.util.Optional<java.io.InputStream> readInput​(io.micronaut.core.io.ResourceLoader resourceLoader,
                                                                    java.lang.String fileName)
        Parameters:
        resourceLoader - The resource loader
        fileName - The file name
        Returns:
        An input stream wrapped inside an Optional
      • processInput

        protected abstract void processInput​(java.lang.String name,
                                             java.io.InputStream input,
                                             java.util.Map<java.lang.String,​java.lang.Object> finalMap)
                                      throws java.io.IOException
        Parameters:
        name - The name
        input - The input stream
        finalMap - The map with all the properties processed
        Throws:
        java.io.IOException - If the input stream doesn't exist
      • processMap

        protected void processMap​(java.util.Map<java.lang.String,​java.lang.Object> finalMap,
                                  java.util.Map map,
                                  java.lang.String prefix)
        Parameters:
        finalMap - The map with all the properties processed
        map - The map to process
        prefix - The prefix for the keys
      • isLogEnabled

        @Deprecated
        public boolean isLogEnabled()
        Deprecated.
        don't need to have this method
        Return logEnabled value.
        Returns:
        is log enabled
        Since:
        3.9.0
      • setLogEnabled

        @Deprecated
        public void setLogEnabled​(boolean logEnabled)
        Deprecated.
        set logEnabled value by constructor
        Setter for logEnabled.
        Parameters:
        logEnabled - is log enabled
        Since:
        3.9.0