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: 56   Methods: 3
NCLOC: 24   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ComponentMessages.java - 100% 100% 100%
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.services.impl;
 16   
 17    import java.util.Locale;
 18    import java.util.Properties;
 19   
 20    import org.apache.hivemind.impl.AbstractMessages;
 21    import org.apache.hivemind.util.Defense;
 22   
 23    /**
 24    * Implementation of {@link org.apache.hivemind.Messages}. This is basically a wrapper around an
 25    * instance of {@link Properties}. This ensures that the properties are, in fact, read-only (which
 26    * ensures that they don't have to be synchronized).
 27    *
 28    * @author Howard Lewis Ship
 29    * @since 2.0.4
 30    */
 31   
 32    public class ComponentMessages extends AbstractMessages
 33    {
 34    private final Properties _properties;
 35   
 36    private final Locale _locale;
 37   
 38  31 public ComponentMessages(Locale locale, Properties properties)
 39    {
 40  31 Defense.notNull(locale, "locale");
 41  31 Defense.notNull(properties, "properties");
 42   
 43  31 _locale = locale;
 44  31 _properties = properties;
 45    }
 46   
 47  44 protected String findMessage(String key)
 48    {
 49  44 return _properties.getProperty(key);
 50    }
 51   
 52  2 protected Locale getLocale()
 53    {
 54  2 return _locale;
 55    }
 56    }