Coverage Report - javax.faces.internal.MessageResourceBundleChain
 
Classes in this File Line Coverage Branch Coverage Complexity
MessageResourceBundleChain
0%
0/13
0%
0/4
2.25
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package javax.faces.internal;
 17  
 
 18  
 import java.util.ArrayList;
 19  
 import java.util.Iterator;
 20  
 import java.util.List;
 21  
 
 22  
 import org.seasar.framework.message.MessageResourceBundle;
 23  
 import org.seasar.framework.util.AssertionUtil;
 24  
 
 25  
 /**
 26  
  * @author shot
 27  
  */
 28  0
 public class MessageResourceBundleChain implements MessageResourceBundle {
 29  
 
 30  0
     private List bundles = new ArrayList();
 31  
 
 32  
     public String get(String key) {
 33  0
         for (Iterator itr = bundles.iterator(); itr.hasNext();) {
 34  0
             MessageResourceBundle bundle = (MessageResourceBundle) itr.next();
 35  0
             String str = bundle.get(key);
 36  0
             if (str != null) {
 37  0
                 return str;
 38  
             }
 39  
         }
 40  0
         return null;
 41  
     }
 42  
 
 43  
     public MessageResourceBundle getParent() {
 44  0
         throw new UnsupportedOperationException();
 45  
     }
 46  
 
 47  
     public void setParent(MessageResourceBundle parent) {
 48  0
         throw new UnsupportedOperationException();
 49  
     }
 50  
 
 51  
     public void addMessageResourceBundle(
 52  
             MessageResourceBundle messageResourceBundle) {
 53  0
         AssertionUtil.assertNotNull("messageResourceBundle",
 54  
                 messageResourceBundle);
 55  0
         bundles.add(messageResourceBundle);
 56  0
     }
 57  
 }