Class ContextAwarePropertySource

    • Constructor Detail

      • ContextAwarePropertySource

        public ContextAwarePropertySource​(Properties properties,
                                          String contextName,
                                          boolean includeInvalid)
      • ContextAwarePropertySource

        public ContextAwarePropertySource​(Map<String,​String> properties)
        Used only for System Environment properties.
        Parameters:
        properties - The map from the Environment.
    • Method Detail

      • getProperty

        public String getProperty​(String key)
        Description copied from interface: PropertySource
        For PropertySources that cannot iterate over all the potential properties this provides a direct lookup.
        Specified by:
        getProperty in interface PropertySource
        Parameters:
        key - The key to search for.
        Returns:
        The value or null;
      • containsProperty

        public boolean containsProperty​(String key)
        Description copied from interface: PropertySource
        For PropertySources that cannot iterate over all the potential properties this provides a direct lookup.
        Specified by:
        containsProperty in interface PropertySource
        Parameters:
        key - The key to search for.
        Returns:
        The value or null;
      • containsProperty

        public boolean containsProperty​(String contextName,
                                        String key)
      • parseProperties

        protected Map<String,​Properties> parseProperties​(Map<String,​String> properties)
        Used to parse environment variables.
        Parameters:
        properties - The map of properties.
        Returns:
        The Properties Map.
      • parseProperties

        protected Map<String,​Properties> parseProperties​(Properties properties,
                                                               String contextName,
                                                               boolean includeInvalid)
        Used to parse properties in Properties objects.
        Parameters:
        properties - The input properties.
        contextName - The context name.
        includeInvalid - stores properties that do not match the Log4j2 convention.
        Returns:
        The Properties Map.