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