KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > parse > ParseMessages


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.parse;
16
17 import java.util.Collection JavaDoc;
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 /**
26  * Messages for the parse package.
27  *
28  * @author Howard Lewis Ship
29  */

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