Coverage Report - org.apache.tapestry.parse.ParseMessages
 
Classes in this File Line Coverage Branch Coverage Complexity
ParseMessages
0%
0/34
N/A
1
 
 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.parse;
 16  
 
 17  
 import org.apache.hivemind.HiveMind;
 18  
 import org.apache.hivemind.Location;
 19  
 import org.apache.hivemind.Resource;
 20  
 import org.apache.hivemind.impl.MessageFormatter;
 21  
 
 22  
 /**
 23  
  * Localized messages for the org.apache.tapestry.parse package.
 24  
  * 
 25  
  * @author Howard Lewis Ship
 26  
  * @since 4.0
 27  
  */
 28  
 final class ParseMessages
 29  
 {
 30  0
     private static final MessageFormatter _formatter = new MessageFormatter(ParseMessages.class);
 31  
 
 32  
     /* defeat instantiation */
 33  0
     private ParseMessages() { }
 34  
     
 35  
     static String commentNotEnded(int line)
 36  
     {
 37  0
         return _formatter.format("comment-not-ended", new Integer(line));
 38  
     }
 39  
 
 40  
     static String unclosedUnknownTag(int line)
 41  
     {
 42  0
         return _formatter.format("unclosed-unknown-tag", new Integer(line));
 43  
     }
 44  
 
 45  
     static String unclosedTag(String tagName, int line)
 46  
     {
 47  0
         return _formatter.format("unclosed-tag", tagName, new Integer(line));
 48  
     }
 49  
 
 50  
     static String missingAttributeValue(String tagName, int line, String attributeName)
 51  
     {
 52  0
         return _formatter.format(
 53  
                 "missing-attribute-value",
 54  
                 tagName,
 55  
                 new Integer(line),
 56  
                 attributeName);
 57  
     }
 58  
 
 59  
     static String componentMayNotBeIgnored(String tagName, int line)
 60  
     {
 61  0
         return _formatter.format("component-may-not-be-ignored", tagName, new Integer(line));
 62  
     }
 63  
 
 64  
     static String componentIdInvalid(String tagName, int line, String jwcid)
 65  
     {
 66  0
         return _formatter.format("component-id-invalid", tagName, new Integer(line), jwcid);
 67  
     }
 68  
 
 69  
     static String unknownComponentId(String tagName, int line, String jwcid)
 70  
     {
 71  0
         return _formatter.format("unknown-component-id", tagName, new Integer(line), jwcid);
 72  
     }
 73  
 
 74  
     static String nestedIgnore(String tagName, int line)
 75  
     {
 76  0
         return _formatter.format("nested-ignore", tagName, new Integer(line));
 77  
     }
 78  
 
 79  
     static String contentBlockMayNotBeIgnored(String tagName, int line)
 80  
     {
 81  0
         return _formatter.format("content-block-may-not-be-ignored", tagName, new Integer(line));
 82  
     }
 83  
 
 84  
     static String contentBlockMayNotBeEmpty(String tagName, int line)
 85  
     {
 86  0
         return _formatter.format("content-block-may-not-be-empty", tagName, new Integer(line));
 87  
     }
 88  
 
 89  
     static String incompleteCloseTag(int line)
 90  
     {
 91  0
         return _formatter.format("incomplete-close-tag", new Integer(line));
 92  
     }
 93  
 
 94  
     static String improperlyNestedCloseTag(String tagName, int closeLine, String startTagName,
 95  
             int startLine)
 96  
     {
 97  0
         return _formatter.format("improperly-nested-close-tag", new Object[]
 98  
         { tagName, new Integer(closeLine), startTagName, new Integer(startLine) });
 99  
     }
 100  
 
 101  
     static String unmatchedCloseTag(String tagName, int line)
 102  
     {
 103  0
         return _formatter.format("unmatched-close-tag", tagName, new Integer(line));
 104  
     }
 105  
 
 106  
     static String failConvertBoolean(String value)
 107  
     {
 108  0
         return _formatter.format("fail-convert-boolean", value);
 109  
     }
 110  
 
 111  
     static String failConvertDouble(String value)
 112  
     {
 113  0
         return _formatter.format("fail-convert-double", value);
 114  
     }
 115  
 
 116  
     static String failConvertInt(String value)
 117  
     {
 118  0
         return _formatter.format("fail-convert-int", value);
 119  
     }
 120  
 
 121  
     static String failConvertLong(String value)
 122  
     {
 123  0
         return _formatter.format("fail-convert-long", value);
 124  
     }
 125  
 
 126  
     static String unableToCopy(String id)
 127  
     {
 128  0
         return _formatter.format("unable-to-copy", id);
 129  
     }
 130  
 
 131  
     static String bothTypeAndCopyOf(String id)
 132  
     {
 133  0
         return _formatter.format("both-type-and-copy-of", id);
 134  
     }
 135  
 
 136  
     static String missingTypeOrCopyOf(String id)
 137  
     {
 138  0
         return _formatter.format("missing-type-or-copy-of", id);
 139  
     }
 140  
 
 141  
     static String frameworkLibraryIdIsReserved(String id)
 142  
     {
 143  0
         return _formatter.format("framework-library-id-is-reserved", id);
 144  
     }
 145  
 
 146  
     static String incorrectDocumentType(String expected, String actual)
 147  
     {
 148  0
         return _formatter.format("incorrect-document-type", expected, actual);
 149  
     }
 150  
 
 151  
     static String noAttributeAndBody(String attributeName, String elementName)
 152  
     {
 153  0
         return _formatter.format("no-attribute-and-body", attributeName, elementName);
 154  
     }
 155  
 
 156  
     static String requiredExtendedAttribute(String elementName, String attributeName)
 157  
     {
 158  0
         return _formatter.format("required-extended-attribute", elementName, attributeName);
 159  
     }
 160  
 
 161  
     static String invalidAttribute(String key, String value)
 162  
     {
 163  0
         return _formatter.format(key, value);
 164  
     }
 165  
 
 166  
     static String missingResource(Resource resource)
 167  
     {
 168  0
         return _formatter.format("missing-resource", resource);
 169  
     }
 170  
 
 171  
     static String errorReadingResource(Resource resource, Throwable cause)
 172  
     {
 173  0
         return _formatter.format("error-reading-resource", resource, cause);
 174  
     }
 175  
 
 176  
     static String unknownPublicId(Resource resource, String publicId)
 177  
     {
 178  0
         return _formatter.format("unknown-public-id", resource, publicId);
 179  
     }
 180  
 
 181  
     static String serviceElementNotSupported()
 182  
     {
 183  0
         return _formatter.getMessage("service-element-not-supported");
 184  
     }
 185  
 
 186  
     static String rangeError(TemplateToken token, int length)
 187  
     {
 188  0
         return _formatter.format("range-error", token, new Integer(length));
 189  
     }
 190  
 
 191  
     public static String duplicateTagAttribute(String tagName, int line, String attributeName)
 192  
     {
 193  0
         return _formatter.format(
 194  
                 "duplicate-tag-attribute",
 195  
                 tagName,
 196  
                 new Integer(line),
 197  
                 attributeName);
 198  
     }
 199  
 
 200  
     public static Object listenerBindingUnsupported(Location location)
 201  
     {
 202  0
         return _formatter.format("listener-binding-unsupported", HiveMind
 203  
                 .getLocationString(location));
 204  
     }
 205  
 }