Class AbstractConfiguration<T extends org.apache.commons.configuration.Configuration>

  • Type Parameters:
    T - type of wrapped configuration
    All Implemented Interfaces:
    Map<Object,​Object>, org.apache.commons.configuration.Configuration
    Direct Known Subclasses:
    BaseConfiguration

    public abstract class AbstractConfiguration<T extends org.apache.commons.configuration.Configuration>
    extends Object
    implements org.apache.commons.configuration.Configuration, Map<Object,​Object>
    Makes a Configuration look like a Map.
    Author:
    aherscu
    • Field Detail

      • wrappedConfiguration

        protected final T extends org.apache.commons.configuration.Configuration wrappedConfiguration
    • Constructor Detail

      • AbstractConfiguration

        protected AbstractConfiguration​(T wrappedConfiguration)
        Builds a configuration.
        Parameters:
        wrappedConfiguration - the configuration to wrap
    • Method Detail

      • defaultConfiguration

        public static org.apache.commons.configuration.Configuration defaultConfiguration()
                                                                                   throws org.apache.commons.configuration.ConfigurationException
        Returns:
        configuration per CONFIGURATION_SOURCES
        Throws:
        org.apache.commons.configuration.ConfigurationException - if an error occurs
      • resolve

        public String resolve​(Object value)
        Resolves references in a string.
        Parameters:
        value - the value to process after Object.toString() is called
        Returns:
        the supplied value with all its ${...} references resolved
      • stringResourceFrom

        protected String stringResourceFrom​(String path)
        Reads string contents of referenced resource.
        Parameters:
        path - the path from root of classes
        Returns:
        the string contents
        Throws:
        NullPointerException - if the resource could not be found or not enough privileges to access
      • subset

        public org.apache.commons.configuration.Configuration subset​(String arg0)
        Specified by:
        subset in interface org.apache.commons.configuration.Configuration
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface org.apache.commons.configuration.Configuration
        Specified by:
        isEmpty in interface Map<Object,​Object>
      • containsKey

        public boolean containsKey​(String arg0)
        Specified by:
        containsKey in interface org.apache.commons.configuration.Configuration
      • addProperty

        public void addProperty​(String arg0,
                                Object arg1)
        Specified by:
        addProperty in interface org.apache.commons.configuration.Configuration
      • setProperty

        public void setProperty​(String arg0,
                                Object arg1)
        Specified by:
        setProperty in interface org.apache.commons.configuration.Configuration
      • clearProperty

        public void clearProperty​(String arg0)
        Specified by:
        clearProperty in interface org.apache.commons.configuration.Configuration
      • clear

        public void clear()
        Specified by:
        clear in interface org.apache.commons.configuration.Configuration
        Specified by:
        clear in interface Map<Object,​Object>
      • getProperty

        public Object getProperty​(String arg0)
        Specified by:
        getProperty in interface org.apache.commons.configuration.Configuration
      • getKeys

        public Iterator<String> getKeys​(String arg0)
        Specified by:
        getKeys in interface org.apache.commons.configuration.Configuration
      • getKeys

        public Iterator<String> getKeys()
        Specified by:
        getKeys in interface org.apache.commons.configuration.Configuration
      • getProperties

        public Properties getProperties​(String arg0)
        Specified by:
        getProperties in interface org.apache.commons.configuration.Configuration
      • getBoolean

        public boolean getBoolean​(String arg0)
        Specified by:
        getBoolean in interface org.apache.commons.configuration.Configuration
      • getBoolean

        public boolean getBoolean​(String arg0,
                                  boolean arg1)
        Specified by:
        getBoolean in interface org.apache.commons.configuration.Configuration
      • getBoolean

        public Boolean getBoolean​(String arg0,
                                  Boolean arg1)
        Specified by:
        getBoolean in interface org.apache.commons.configuration.Configuration
      • getByte

        public byte getByte​(String arg0)
        Specified by:
        getByte in interface org.apache.commons.configuration.Configuration
      • getByte

        public byte getByte​(String arg0,
                            byte arg1)
        Specified by:
        getByte in interface org.apache.commons.configuration.Configuration
      • getByte

        public Byte getByte​(String arg0,
                            Byte arg1)
        Specified by:
        getByte in interface org.apache.commons.configuration.Configuration
      • getDouble

        public double getDouble​(String arg0)
        Specified by:
        getDouble in interface org.apache.commons.configuration.Configuration
      • getDouble

        public double getDouble​(String arg0,
                                double arg1)
        Specified by:
        getDouble in interface org.apache.commons.configuration.Configuration
      • getDouble

        public Double getDouble​(String arg0,
                                Double arg1)
        Specified by:
        getDouble in interface org.apache.commons.configuration.Configuration
      • getFloat

        public float getFloat​(String arg0)
        Specified by:
        getFloat in interface org.apache.commons.configuration.Configuration
      • getFloat

        public float getFloat​(String arg0,
                              float arg1)
        Specified by:
        getFloat in interface org.apache.commons.configuration.Configuration
      • getFloat

        public Float getFloat​(String arg0,
                              Float arg1)
        Specified by:
        getFloat in interface org.apache.commons.configuration.Configuration
      • getInt

        public int getInt​(String arg0)
        Specified by:
        getInt in interface org.apache.commons.configuration.Configuration
      • getInt

        public int getInt​(String arg0,
                          int arg1)
        Specified by:
        getInt in interface org.apache.commons.configuration.Configuration
      • getInteger

        public Integer getInteger​(String arg0,
                                  Integer arg1)
        Specified by:
        getInteger in interface org.apache.commons.configuration.Configuration
      • getLong

        public long getLong​(String arg0)
        Specified by:
        getLong in interface org.apache.commons.configuration.Configuration
      • getLong

        public long getLong​(String arg0,
                            long arg1)
        Specified by:
        getLong in interface org.apache.commons.configuration.Configuration
      • getLong

        public Long getLong​(String arg0,
                            Long arg1)
        Specified by:
        getLong in interface org.apache.commons.configuration.Configuration
      • getShort

        public short getShort​(String arg0)
        Specified by:
        getShort in interface org.apache.commons.configuration.Configuration
      • getShort

        public short getShort​(String arg0,
                              short arg1)
        Specified by:
        getShort in interface org.apache.commons.configuration.Configuration
      • getShort

        public Short getShort​(String arg0,
                              Short arg1)
        Specified by:
        getShort in interface org.apache.commons.configuration.Configuration
      • getBigDecimal

        public BigDecimal getBigDecimal​(String arg0)
        Specified by:
        getBigDecimal in interface org.apache.commons.configuration.Configuration
      • getBigDecimal

        public BigDecimal getBigDecimal​(String arg0,
                                        BigDecimal arg1)
        Specified by:
        getBigDecimal in interface org.apache.commons.configuration.Configuration
      • getBigInteger

        public BigInteger getBigInteger​(String arg0)
        Specified by:
        getBigInteger in interface org.apache.commons.configuration.Configuration
      • getBigInteger

        public BigInteger getBigInteger​(String arg0,
                                        BigInteger arg1)
        Specified by:
        getBigInteger in interface org.apache.commons.configuration.Configuration
      • getString

        public String getString​(String arg0)
        Specified by:
        getString in interface org.apache.commons.configuration.Configuration
      • getString

        public String getString​(String arg0,
                                String arg1)
        Specified by:
        getString in interface org.apache.commons.configuration.Configuration
      • getStringArray

        public String[] getStringArray​(String arg0)
        Specified by:
        getStringArray in interface org.apache.commons.configuration.Configuration
      • getList

        public List<Object> getList​(String arg0)
        Specified by:
        getList in interface org.apache.commons.configuration.Configuration
      • getList

        public List<Object> getList​(String arg0,
                                    List<?> arg1)
        Specified by:
        getList in interface org.apache.commons.configuration.Configuration