Class ConfigRetriever


  • public class ConfigRetriever
    extends Object
    Class to retrieve value from config whether Microprofile, Payara/glassfish, EL, or a raw value. In that order.
    Author:
    Mark Wareham
    • Method Detail

      • resolveConfigAttribute

        public static String resolveConfigAttribute​(String expression,
                                                    String microProfileConfigKey)
        Grabs the config value regardless of where it's stored. Should a microprofile config exist, that will be returned as top priority. Otherwise returns the value translated from one of - payara/glassfish config ${} - EL #{} - raw. Returns the value given if none of the above exist.
        Parameters:
        expression - the expression you are looking for
        microProfileConfigKey - a microprofile key.
        Returns:
        a config value.
      • resolveConfigAttribute

        public static String resolveConfigAttribute​(String attribute,
                                                    String expression,
                                                    String microProfileConfigKey)
        Grabs the config value regardless of where it's stored. Accounts for overriding expression parameters Should a microprofile config exist, that will be returned as top priority. Otherwise returns the value translated from one of - payara/glassfish config ${} - EL #{} - raw. Returns the value given if none of the above exist.
        Parameters:
        attribute - the attribute value to fall back on if there's no value expression param
        microProfileConfigKey - a microprofile key.
        expression - the expression you are looking for
        Returns:
        a config value.