Coverage Report - org.apache.tapestry.engine.EngineMessages
 
Classes in this File Line Coverage Branch Coverage Complexity
EngineMessages
0%
0/15
0%
0/4
1.25
 
 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.engine;
 16  
 
 17  
 import java.util.List;
 18  
 
 19  
 import org.apache.hivemind.impl.MessageFormatter;
 20  
 import org.apache.tapestry.IComponent;
 21  
 import org.apache.tapestry.IPage;
 22  
 
 23  
 /**
 24  
  * @author Howard M. Lewis Ship
 25  
  * @since 4.0
 26  
  */
 27  
 public final class EngineMessages
 28  
 {
 29  0
     private static final MessageFormatter _formatter = new MessageFormatter(EngineMessages.class);
 30  
 
 31  
     /* defeat instantiation */
 32  0
     private EngineMessages() { }
 33  
     
 34  
     public static String serviceNoParameter(IEngineService service)
 35  
     {
 36  0
         return _formatter.format("service-no-parameter", service.getName());
 37  
     }
 38  
 
 39  
     public static String wrongComponentType(IComponent component, Class expectedType)
 40  
     {
 41  0
         return _formatter.format("wrong-component-type", component.getExtendedId(), expectedType
 42  
                 .getName());
 43  
     }
 44  
 
 45  
     public static String requestStateSession(IComponent component)
 46  
     {
 47  0
         return _formatter.format("request-stale-session", component.getExtendedId());
 48  
     }
 49  
 
 50  
     public static String pageNotCompatible(IPage page, Class expectedType)
 51  
     {
 52  0
         return _formatter.format("page-not-compatible", page.getPageName(), expectedType.getName());
 53  
     }
 54  
 
 55  
     public static String noBrowserEvent()
 56  
     {
 57  0
         return _formatter.format("missing-browser-event", new Object[]{});
 58  
     }
 59  
     
 60  
     static String exceptionDuringCleanup(Throwable cause)
 61  
     {
 62  0
         return _formatter.format("exception-during-cleanup", cause);
 63  
     }
 64  
 
 65  
     static String validateCycle(List pageNames)
 66  
     {
 67  0
         StringBuffer buffer = new StringBuffer();
 68  0
         int count = pageNames.size();
 69  
 
 70  0
         for (int i = 0; i < count; i++)
 71  
         {
 72  0
             if (i > 0)
 73  0
                 buffer.append("; ");
 74  
 
 75  0
             buffer.append(pageNames.get(i));
 76  
         }
 77  
 
 78  0
         return _formatter.format("validate-cycle", buffer);
 79  
     }
 80  
 }