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