Class PrefixedConfig

  • All Implemented Interfaces:
    grails.config.Config, grails.config.ConfigMap, java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.Object>>, java.util.Map<java.lang.String,​java.lang.Object>, org.springframework.core.env.PropertyResolver

    public class PrefixedConfig
    extends java.lang.Object
    implements grails.config.Config
    A config that accepts a prefix
    Since:
    3.0
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected grails.config.Config delegate  
      protected java.lang.String prefix  
      protected java.lang.String[] prefixTokens  
    • Constructor Summary

      Constructors 
      Constructor Description
      PrefixedConfig​(java.lang.String prefix, grails.config.Config delegate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void clear()  
      boolean containsKey​(java.lang.Object key)  
      boolean containsProperty​(java.lang.String key)  
      boolean containsValue​(java.lang.Object value)  
      java.util.Set<java.util.Map.Entry<java.lang.String,​java.lang.Object>> entrySet()  
      boolean equals​(java.lang.Object o)  
      java.util.Map<java.lang.String,​java.lang.Object> flatten()
      Deprecated.
      protected java.lang.String formulateKey​(java.lang.String key)  
      java.lang.Object get​(java.lang.Object key)  
      java.lang.Object getAt​(java.lang.Object key)  
      java.lang.String getProperty​(java.lang.String key)  
      <T> T getProperty​(java.lang.String key, java.lang.Class<T> targetType)  
      <T> T getProperty​(java.lang.String key, java.lang.Class<T> targetType, T defaultValue)  
      <T> T getProperty​(java.lang.String key, java.lang.Class<T> targetType, T defaultValue, java.util.List<T> allowedValues)  
      java.lang.String getProperty​(java.lang.String key, java.lang.String defaultValue)  
      java.lang.String getRequiredProperty​(java.lang.String key)  
      <T> T getRequiredProperty​(java.lang.String key, java.lang.Class<T> targetType)  
      int hashCode()  
      boolean isEmpty()  
      java.util.Iterator<java.util.Map.Entry<java.lang.String,​java.lang.Object>> iterator()  
      java.util.Set<java.lang.String> keySet()  
      grails.config.Config merge​(java.util.Map<java.lang.String,​java.lang.Object> toMerge)  
      java.lang.Object navigate​(java.lang.String... path)  
      java.lang.Object put​(java.lang.String key, java.lang.Object value)  
      void putAll​(java.util.Map<? extends java.lang.String,​?> m)  
      java.lang.Object remove​(java.lang.Object key)  
      java.lang.String resolvePlaceholders​(java.lang.String text)  
      java.lang.String resolveRequiredPlaceholders​(java.lang.String text)  
      void setAt​(java.lang.Object key, java.lang.Object value)  
      int size()  
      java.util.Properties toProperties()  
      java.util.Collection<java.lang.Object> values()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Field Detail

      • prefix

        protected java.lang.String prefix
      • prefixTokens

        protected java.lang.String[] prefixTokens
      • delegate

        protected grails.config.Config delegate
    • Constructor Detail

      • PrefixedConfig

        public PrefixedConfig​(java.lang.String prefix,
                              grails.config.Config delegate)
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        hashCode in class java.lang.Object
      • flatten

        @Deprecated
        public java.util.Map<java.lang.String,​java.lang.Object> flatten()
        Deprecated.
        Specified by:
        flatten in interface grails.config.Config
      • toProperties

        public java.util.Properties toProperties()
        Specified by:
        toProperties in interface grails.config.Config
      • getAt

        public java.lang.Object getAt​(java.lang.Object key)
        Specified by:
        getAt in interface grails.config.ConfigMap
      • navigate

        public java.lang.Object navigate​(java.lang.String... path)
        Specified by:
        navigate in interface grails.config.ConfigMap
      • iterator

        public java.util.Iterator<java.util.Map.Entry<java.lang.String,​java.lang.Object>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.Object>>
      • size

        public int size()
        Specified by:
        size in interface java.util.Map<java.lang.String,​java.lang.Object>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<java.lang.String,​java.lang.Object>
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<java.lang.String,​java.lang.Object>
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface java.util.Map<java.lang.String,​java.lang.Object>
      • get

        public java.lang.Object get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<java.lang.String,​java.lang.Object>
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Specified by:
        keySet in interface java.util.Map<java.lang.String,​java.lang.Object>
      • values

        public java.util.Collection<java.lang.Object> values()
        Specified by:
        values in interface java.util.Map<java.lang.String,​java.lang.Object>
      • entrySet

        public java.util.Set<java.util.Map.Entry<java.lang.String,​java.lang.Object>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<java.lang.String,​java.lang.Object>
      • containsProperty

        public boolean containsProperty​(java.lang.String key)
        Specified by:
        containsProperty in interface org.springframework.core.env.PropertyResolver
      • getProperty

        public java.lang.String getProperty​(java.lang.String key)
        Specified by:
        getProperty in interface org.springframework.core.env.PropertyResolver
      • getProperty

        public java.lang.String getProperty​(java.lang.String key,
                                            java.lang.String defaultValue)
        Specified by:
        getProperty in interface org.springframework.core.env.PropertyResolver
      • getProperty

        public <T> T getProperty​(java.lang.String key,
                                 java.lang.Class<T> targetType)
        Specified by:
        getProperty in interface grails.config.ConfigMap
        Specified by:
        getProperty in interface org.springframework.core.env.PropertyResolver
      • getProperty

        public <T> T getProperty​(java.lang.String key,
                                 java.lang.Class<T> targetType,
                                 T defaultValue)
        Specified by:
        getProperty in interface grails.config.ConfigMap
        Specified by:
        getProperty in interface org.springframework.core.env.PropertyResolver
      • getRequiredProperty

        public java.lang.String getRequiredProperty​(java.lang.String key)
                                             throws java.lang.IllegalStateException
        Specified by:
        getRequiredProperty in interface org.springframework.core.env.PropertyResolver
        Throws:
        java.lang.IllegalStateException
      • getRequiredProperty

        public <T> T getRequiredProperty​(java.lang.String key,
                                         java.lang.Class<T> targetType)
                                  throws java.lang.IllegalStateException
        Specified by:
        getRequiredProperty in interface grails.config.ConfigMap
        Specified by:
        getRequiredProperty in interface org.springframework.core.env.PropertyResolver
        Throws:
        java.lang.IllegalStateException
      • formulateKey

        protected java.lang.String formulateKey​(java.lang.String key)
      • resolvePlaceholders

        public java.lang.String resolvePlaceholders​(java.lang.String text)
        Specified by:
        resolvePlaceholders in interface org.springframework.core.env.PropertyResolver
      • resolveRequiredPlaceholders

        public java.lang.String resolveRequiredPlaceholders​(java.lang.String text)
                                                     throws java.lang.IllegalArgumentException
        Specified by:
        resolveRequiredPlaceholders in interface org.springframework.core.env.PropertyResolver
        Throws:
        java.lang.IllegalArgumentException
      • put

        public java.lang.Object put​(java.lang.String key,
                                    java.lang.Object value)
        Specified by:
        put in interface java.util.Map<java.lang.String,​java.lang.Object>
      • remove

        public java.lang.Object remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<java.lang.String,​java.lang.Object>
      • putAll

        public void putAll​(java.util.Map<? extends java.lang.String,​?> m)
        Specified by:
        putAll in interface java.util.Map<java.lang.String,​java.lang.Object>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map<java.lang.String,​java.lang.Object>
      • merge

        public grails.config.Config merge​(java.util.Map<java.lang.String,​java.lang.Object> toMerge)
        Specified by:
        merge in interface grails.config.Config
      • getProperty

        public <T> T getProperty​(java.lang.String key,
                                 java.lang.Class<T> targetType,
                                 T defaultValue,
                                 java.util.List<T> allowedValues)
        Specified by:
        getProperty in interface grails.config.Config
      • setAt

        public void setAt​(java.lang.Object key,
                          java.lang.Object value)
        Specified by:
        setAt in interface grails.config.ConfigMap