1 15 package org.apache.hivemind.impl; 16 17 import org.apache.hivemind.ClassResolver; 18 import org.apache.hivemind.Element; 19 import org.apache.hivemind.HiveMind; 20 import org.apache.hivemind.Location; 21 import org.apache.hivemind.Resource; 22 import org.apache.hivemind.definition.Occurances; 23 import org.apache.hivemind.schema.SchemaProcessor; 24 25 26 31 class XmlImplMessages 32 { 33 private static final MessageFormatter _formatter = new MessageFormatter(XmlImplMessages.class, 34 "XmlImplStrings"); 35 36 37 static String unableToResolveSchema(String schemaId) 38 { 39 return _formatter.format("unable-to-resolve-schema", schemaId); 40 } 41 42 static String schemaNotVisible(String schemaId, String moduleId) 43 { 44 return _formatter.format("schema-not-visible", schemaId, moduleId); 45 } 46 47 static String wrongNumberOfParameters(String factoryServiceId, int actualCount, 48 Occurances expectation) 49 { 50 return _formatter.format( 51 "wrong-number-of-parameters", 52 factoryServiceId, 53 contributionCount(actualCount), 54 occurances(expectation)); 55 56 } 57 58 static String occurances(Occurances occurances) 59 { 60 return _formatter.getMessage("occurances." + occurances.getName()); 61 } 62 63 static String contributionCount(int count) 64 { 65 return _formatter.format("contribution-count", new Integer (count)); 66 } 67 68 static String uniqueAttributeConstraintBroken(String name, String value, 69 Location priorLocation) 70 { 71 return _formatter.format("unique-attribute-constraint-broken", name, value, priorLocation); 72 } 73 74 static String unknownAttribute(String name) 75 { 76 return _formatter.format("unknown-attribute", name); 77 } 78 79 static String schemaStackViolation(SchemaProcessor processor) 80 { 81 return _formatter.format("schema-stack-violation", processor.getElementPath()); 82 } 83 84 static String missingAttribute(String name) 85 { 86 return _formatter.format("missing-attribute", name); 87 } 88 89 static String elementErrors(SchemaProcessor processor, Element element) 90 { 91 return _formatter.format("element-errors", processor.getElementPath(), element 92 .getLocation()); 93 } 94 95 static String unknownElement(SchemaProcessor processor, Element element) 96 { 97 return _formatter.format("unknown-element", processor.getElementPath()); 98 } 99 100 static String translatorInstantiationFailure(Class translatorClass, Throwable cause) 101 { 102 return _formatter.format( 103 "translator-instantiation-failure", 104 translatorClass.getName(), 105 cause); 106 } 107 108 static String unknownTranslatorName(String name, String configurationId) 109 { 110 return _formatter.format("unknown-translator-name", name, configurationId); 111 } 112 113 static String duplicateTranslatorName(String name, Location oldLocation) 114 { 115 return _formatter.format("duplicate-translator-name", name, HiveMind 116 .getLocationString(oldLocation)); 117 } 118 119 static String incompleteTranslator(TranslatorContribution c) 120 { 121 return _formatter.format("incomplete-translator", c.getName()); 122 } 123 124 static String subModuleDoesNotExist(Resource subModuleDescriptor) 125 { 126 return _formatter.format("sub-module-does-not-exist", subModuleDescriptor); 127 } 128 129 static String unableToFindModulesError(ClassResolver resolver, Throwable cause) 130 { 131 return _formatter.format("unable-to-find-modules", resolver, cause); 132 } 133 134 static String unableToFindModuleResource(Resource resource) 135 { 136 return _formatter.format("unable-to-find-module-resource", resource); 137 } 138 139 static String noSuchSymbol(String name) 140 { 141 return _formatter.format("no-such-symbol", name); 142 } 143 144 static String symbolSourceContribution() 145 { 146 return _formatter.getMessage("symbol-source-contribution"); 147 } 148 149 static String unknownConfigurationPointOfSchemaAssignment(String configurationId, SchemaAssignment schemaAssignment) 150 { 151 return _formatter.format("unknown-configurationpoint-in-schema-assignment", configurationId, schemaAssignment.getLocation()); 152 } 153 154 } | Popular Tags |