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
|
|
|
24
|
|
|
25
|
|
|
26
|
|
|
27
|
|
|
28
|
|
|
29
|
|
final class ParseMessages
|
30
|
|
{
|
31
|
|
private static final MessageFormatter _formatter =
|
32
|
|
new MessageFormatter(ParseMessages.class, "ParseStrings");
|
33
|
|
|
34
|
1
|
public static String dupeAttributeMapping(
|
35
|
|
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
|
1
|
public static String unableToResolveSchema(String schemaId)
|
50
|
|
{
|
51
|
1
|
return _formatter.format("unable-to-resolve-schema", schemaId);
|
52
|
|
}
|
53
|
|
|
54
|
0
|
public static String notModule(String elementName, Location location)
|
55
|
|
{
|
56
|
0
|
return _formatter.format("not-module", elementName, location);
|
57
|
|
}
|
58
|
|
|
59
|
1
|
public static String requiredAttribute(String name, String path, Location location)
|
60
|
|
{
|
61
|
1
|
return _formatter.format("required-attribute", name, path, location);
|
62
|
|
}
|
63
|
|
|
64
|
1
|
public static String unknownAttribute(String name, String path)
|
65
|
|
{
|
66
|
1
|
return _formatter.format("unknown-attribute", name, path);
|
67
|
|
}
|
68
|
|
|
69
|
0
|
public static String booleanAttribute(String value, String name, String path)
|
70
|
|
{
|
71
|
0
|
return _formatter.format("boolean-attribute", new Object[] { value, name, path });
|
72
|
|
}
|
73
|
|
|
74
|
0
|
public static String invalidAttributeValue(String value, String name, String path)
|
75
|
|
{
|
76
|
0
|
return _formatter.format("invalid-attribute-value", new Object[] { value, name, path });
|
77
|
|
|
78
|
|
}
|
79
|
|
|
80
|
0
|
public static String invalidNumericValue(String value, String name, String path)
|
81
|
|
{
|
82
|
0
|
return _formatter.format("invalid-numeric-value", new Object[] { value, name, path });
|
83
|
|
}
|
84
|
|
|
85
|
0
|
public static String unableToInitialize(Throwable cause)
|
86
|
|
{
|
87
|
0
|
return _formatter.format("unable-to-initialize", cause);
|
88
|
|
}
|
89
|
|
|
90
|
1
|
public static String badRuleClass(String className, Location location, Throwable cause)
|
91
|
|
{
|
92
|
1
|
return _formatter.format("bad-rule-class", className, location, cause);
|
93
|
|
}
|
94
|
|
|
95
|
3
|
public static String errorReadingDescriptor(Resource resource, Throwable cause)
|
96
|
|
{
|
97
|
3
|
return _formatter.format("error-reading-descriptor", resource, cause);
|
98
|
|
}
|
99
|
|
|
100
|
0
|
public static String missingResource(Resource resource)
|
101
|
|
{
|
102
|
0
|
return _formatter.format("missing-resource", resource);
|
103
|
|
}
|
104
|
|
|
105
|
1
|
public static String unexpectedElement(String elementName, String elementPath)
|
106
|
|
{
|
107
|
1
|
return _formatter.format("unexpected-element", elementName, elementPath);
|
108
|
|
}
|
109
|
|
|
110
|
3
|
public static String invalidAttributeFormat(
|
111
|
|
String attributeName,
|
112
|
|
String value,
|
113
|
|
String elementPath,
|
114
|
|
String formatKey)
|
115
|
|
{
|
116
|
3
|
String inputValueFormat = _formatter.getMessage(formatKey);
|
117
|
|
|
118
|
3
|
return _formatter.format(
|
119
|
|
"invalid-attribute-format",
|
120
|
|
new Object[] { attributeName, value, elementPath, inputValueFormat });
|
121
|
|
}
|
122
|
|
}
|
123
|
|
|