1 15 package org.apache.hivemind.parse; 16 17 import java.util.Collection ; 18 19 import org.apache.hivemind.Location; 20 import org.apache.hivemind.Resource; 21 import org.apache.hivemind.impl.MessageFormatter; 22 import org.apache.hivemind.schema.ElementModel; 23 import org.apache.hivemind.schema.Schema; 24 25 30 class ParseMessages 31 { 32 protected static MessageFormatter _formatter = new MessageFormatter(ParseMessages.class); 33 34 static String dupeAttributeMapping(AttributeMappingDescriptor newDescriptor, 35 AttributeMappingDescriptor existingDescriptor) 36 { 37 return _formatter.format( 38 "dupe-attribute-mapping", 39 newDescriptor.getAttributeName(), 40 existingDescriptor.getLocation()); 41 } 42 43 static String extraMappings(Collection extraNames, ElementModel model) 44 { 45 return _formatter.format("extra-mappings", extraNames, model.getElementName()); 46 } 47 48 static String multipleContributionsSchemas(String configurationId, Location location) 49 { 50 return _formatter.format("multiple-contributions-schemas", configurationId, location); 51 } 52 53 static String multipleParametersSchemas(String serviceId, Location location) 54 { 55 return _formatter.format("multiple-parameters-schemas", serviceId, location); 56 } 57 58 static String notModule(String elementName, Location location) 59 { 60 return _formatter.format("not-module", elementName, location); 61 } 62 63 static String requiredAttribute(String name, String path, Location location) 64 { 65 return _formatter.format("required-attribute", name, path, location); 66 } 67 68 static String unknownAttribute(String name, String path) 69 { 70 return _formatter.format("unknown-attribute", name, path); 71 } 72 73 static String booleanAttribute(String value, String name, String path) 74 { 75 return _formatter.format("boolean-attribute", new Object [] 76 { value, name, path }); 77 } 78 79 static String invalidAttributeValue(String value, String name, String path) 80 { 81 return _formatter.format("invalid-attribute-value", new Object [] 82 { value, name, path }); 83 84 } 85 86 static String invalidNumericValue(String value, String name, String path) 87 { 88 return _formatter.format("invalid-numeric-value", new Object [] 89 { value, name, path }); 90 } 91 92 static String unableToInitialize(Throwable cause) 93 { 94 return _formatter.format("unable-to-initialize", cause); 95 } 96 97 static String badRuleClass(String className, Location location, Throwable cause) 98 { 99 return _formatter.format("bad-rule-class", className, location, cause); 100 } 101 102 static String errorReadingDescriptor(Resource resource, Throwable cause) 103 { 104 return _formatter.format("error-reading-descriptor", resource, cause); 105 } 106 107 static String missingResource(Resource resource) 108 { 109 return _formatter.format("missing-resource", resource); 110 } 111 112 static String unexpectedElement(String elementName, String elementPath) 113 { 114 return _formatter.format("unexpected-element", elementName, elementPath); 115 } 116 117 static String invalidAttributeFormat(String attributeName, String value, String elementPath, 118 String formatKey) 119 { 120 String inputValueFormat = _formatter.getMessage(formatKey); 121 122 return _formatter.format("invalid-attribute-format", new Object [] 123 { attributeName, value, elementPath, inputValueFormat }); 124 } 125 126 static String duplicateSchema(String schemaId, Schema existingSchema) 127 { 128 return _formatter.format("duplicate-schema", schemaId, existingSchema.getLocation()); 129 } 130 131 static String invalidElementKeyAttribute(String schemaId, Throwable cause) 132 { 133 return _formatter.format("invalid-element-key-attribute", schemaId, cause); 134 } 135 } | Popular Tags |