Clover coverage report - Code Coverage for tapestry release 4.0-beta-9
Coverage timestamp: Sat Oct 1 2005 08:36:20 EDT
file stats: LOC: 60   Methods: 2
NCLOC: 23   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ResourceBundlePropertySource.java - 0% 0% 0%
coverage
 1    // Copyright 2004, 2005 The Apache Software Foundation
 2    //
 3    // Licensed under the Apache License, Version 2.0 (the "License");
 4    // you may not use this file except in compliance with the License.
 5    // You may obtain a copy of the License at
 6    //
 7    // http://www.apache.org/licenses/LICENSE-2.0
 8    //
 9    // Unless required by applicable law or agreed to in writing, software
 10    // distributed under the License is distributed on an "AS IS" BASIS,
 11    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12    // See the License for the specific language governing permissions and
 13    // limitations under the License.
 14   
 15    package org.apache.tapestry.util;
 16   
 17    import java.util.MissingResourceException;
 18    import java.util.ResourceBundle;
 19   
 20    import org.apache.tapestry.engine.IPropertySource;
 21   
 22    /**
 23    * A property source that is based on a {@link java.util.ResourceBundle}.
 24    *
 25    * @author Howard Lewis Ship
 26    * @since 3.0
 27    *
 28    **/
 29   
 30    public class ResourceBundlePropertySource implements IPropertySource
 31    {
 32    private ResourceBundle _bundle;
 33   
 34  0 public ResourceBundlePropertySource(ResourceBundle bundle)
 35    {
 36  0 _bundle = bundle;
 37    }
 38   
 39    /**
 40    * Gets the value from the bundle by invoking
 41    * {@link ResourceBundle#getString(java.lang.String)}. If
 42    * the bundle does not contain the key (that is, it it
 43    * throws {@link java.util.MissingResourceException}), then
 44    * null is returned.
 45    *
 46    **/
 47   
 48  0 public String getPropertyValue(String propertyName)
 49    {
 50  0 try
 51    {
 52  0 return _bundle.getString(propertyName);
 53    }
 54    catch (MissingResourceException ex)
 55    {
 56  0 return null;
 57    }
 58    }
 59   
 60    }