donaldp     02/04/10 02:05:56

  Modified:    src/java/org/apache/avalon/framework/configuration
                        DefaultConfiguration.java
  Log:
  Reowrk getValue(String) to be more efficient.
  
  Revision  Changes    Path
  1.16      +20 -0     
jakarta-avalon/src/java/org/apache/avalon/framework/configuration/DefaultConfiguration.java
  
  Index: DefaultConfiguration.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/configuration/DefaultConfiguration.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DefaultConfiguration.java 21 Mar 2002 14:51:13 -0000      1.15
  +++ DefaultConfiguration.java 10 Apr 2002 09:05:56 -0000      1.16
  @@ -128,6 +128,26 @@
           return m_location;
       }
   
  +
  +    /**
  +     * Returns the value of the configuration element as a 
<code>String</code>.
  +     *
  +     * @param defaultValue the default value to return if value malformed or 
empty
  +     * @return a <code>String</code> value
  +     * @exception ConfigurationException If the value is not present.
  +     */
  +    public String getValue( final String defaultValue ) 
  +    {
  +        if( null != m_value )
  +        {
  +            return m_value;
  +        }
  +        else
  +        {
  +            return defaultValue;
  +        }
  +    }
  +
       /**
        * Returns the value of the configuration element as a 
<code>String</code>.
        *
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to