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