Class ConfigurationDynaBean

  • All Implemented Interfaces:
    java.util.Map<java.lang.Object,​java.lang.Object>, org.apache.commons.beanutils.DynaBean

    public class ConfigurationDynaBean
    extends ConfigurationMap
    implements org.apache.commons.beanutils.DynaBean
    The ConfigurationDynaBean dynamically reads and writes configurations properties from a wrapped configuration-collection Configuration instance. It also implements a Map interface so that it can be used in JSP 2.0 Expression Language expressions.

    The ConfigurationDynaBean maps nested and mapped properties to the appropriate Configuration subset using the Configuration.subset(java.lang.String) method. Similarly, indexed properties reference lists of configuration properties using the Configuration.getList(String) method. Setting an indexed property is supported, too.

    Note: Some of the methods expect that a dot (".") is used as property delimiter for the wrapped configuration. This is true for most of the default configurations. Hierarchical configurations, for which a specific expression engine is set, may cause problems.

    Since:
    1.0-rc1
    Version:
    $Id: ConfigurationDynaBean.java 1366932 2012-07-29 20:06:31Z oheger $
    Author:
    Ricardo Gladwell
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

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

      Constructors 
      Constructor Description
      ConfigurationDynaBean​(Configuration configuration)
      Creates a new instance of ConfigurationDynaBean and sets the configuration this bean is associated with.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(java.lang.String name, java.lang.String key)  
      java.lang.Object get​(java.lang.String name)  
      java.lang.Object get​(java.lang.String name, int index)  
      java.lang.Object get​(java.lang.String name, java.lang.String key)  
      org.apache.commons.beanutils.DynaClass getDynaClass()  
      void remove​(java.lang.String name, java.lang.String key)  
      void set​(java.lang.String name, int index, java.lang.Object value)  
      void set​(java.lang.String name, java.lang.Object value)  
      void set​(java.lang.String name, java.lang.String key, java.lang.Object value)  
      • Methods inherited from class java.util.AbstractMap

        clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

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

      • ConfigurationDynaBean

        public ConfigurationDynaBean​(Configuration configuration)
        Creates a new instance of ConfigurationDynaBean and sets the configuration this bean is associated with.
        Parameters:
        configuration - the configuration
    • Method Detail

      • set

        public void set​(java.lang.String name,
                        java.lang.Object value)
        Specified by:
        set in interface org.apache.commons.beanutils.DynaBean
      • get

        public java.lang.Object get​(java.lang.String name)
        Specified by:
        get in interface org.apache.commons.beanutils.DynaBean
      • contains

        public boolean contains​(java.lang.String name,
                                java.lang.String key)
        Specified by:
        contains in interface org.apache.commons.beanutils.DynaBean
      • get

        public java.lang.Object get​(java.lang.String name,
                                    int index)
        Specified by:
        get in interface org.apache.commons.beanutils.DynaBean
      • get

        public java.lang.Object get​(java.lang.String name,
                                    java.lang.String key)
        Specified by:
        get in interface org.apache.commons.beanutils.DynaBean
      • getDynaClass

        public org.apache.commons.beanutils.DynaClass getDynaClass()
        Specified by:
        getDynaClass in interface org.apache.commons.beanutils.DynaBean
      • remove

        public void remove​(java.lang.String name,
                           java.lang.String key)
        Specified by:
        remove in interface org.apache.commons.beanutils.DynaBean
      • set

        public void set​(java.lang.String name,
                        int index,
                        java.lang.Object value)
        Specified by:
        set in interface org.apache.commons.beanutils.DynaBean
      • set

        public void set​(java.lang.String name,
                        java.lang.String key,
                        java.lang.Object value)
        Specified by:
        set in interface org.apache.commons.beanutils.DynaBean