KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > impl > XmlImplMessages


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.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 /**
27  * Used to format messages used in errors and log output for classes within the impl package.
28  *
29  * @author Howard Lewis Ship
30  */

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