Coverage Report - org.apache.tapestry5.internal.translator.StringTranslator
 
Classes in this File Line Coverage Branch Coverage Complexity
StringTranslator
100%
6/6
N/A
0
 
 1  
 // Copyright 2007, 2008 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.tapestry5.internal.translator;
 16  
 
 17  
 import org.apache.tapestry5.Field;
 18  
 import org.apache.tapestry5.MarkupWriter;
 19  
 import org.apache.tapestry5.ValidationException;
 20  
 import org.apache.tapestry5.services.FormSupport;
 21  
 
 22  396
 public class StringTranslator extends AbstractTranslator<String>
 23  
 {
 24  
     public StringTranslator()
 25  
     {
 26  18
         super("string", String.class, "a-string-is-a-string");
 27  18
     }
 28  
 
 29  
     /**
 30  
      * Does nothing.
 31  
      */
 32  
     public void render(Field field, String message, MarkupWriter writer, FormSupport formSupport)
 33  
     {
 34  482
     }
 35  
 
 36  
     /**
 37  
      * Passes the clientValue through unchanged.
 38  
      */
 39  
     public String parseClient(Field field, String clientValue, String message)
 40  
             throws ValidationException
 41  
     {
 42  154
         return clientValue;
 43  
     }
 44  
 
 45  
     /**
 46  
      * Passes the value through unchanged.
 47  
      */
 48  
     public String toClient(String value)
 49  
     {
 50  242
         return value;
 51  
     }
 52  
 }