1
|
|
|
2
|
|
|
3
|
|
|
4
|
|
|
5
|
|
|
6
|
|
|
7
|
|
|
8
|
|
|
9
|
|
|
10
|
|
|
11
|
|
|
12
|
|
|
13
|
|
|
14
|
|
|
15
|
|
package org.apache.hivemind.schema.rules;
|
16
|
|
|
17
|
|
import org.apache.hivemind.Element;
|
18
|
|
import org.apache.hivemind.HiveMind;
|
19
|
|
import org.apache.hivemind.Location;
|
20
|
|
import org.apache.hivemind.impl.MessageFormatter;
|
21
|
|
import org.apache.hivemind.internal.Module;
|
22
|
|
import org.apache.hivemind.schema.SchemaProcessor;
|
23
|
|
|
24
|
|
|
25
|
|
|
26
|
|
|
27
|
|
|
28
|
|
|
29
|
|
final class RulesMessages
|
30
|
|
{
|
31
|
|
|
32
|
|
private static final MessageFormatter _formatter =
|
33
|
|
new MessageFormatter(RulesMessages.class, "RulesStrings");
|
34
|
|
|
35
|
0
|
public static String unableToSetElementProperty(
|
36
|
|
String propertyName,
|
37
|
|
Object target,
|
38
|
|
SchemaProcessor processor,
|
39
|
|
Element element,
|
40
|
|
Throwable cause)
|
41
|
|
{
|
42
|
0
|
return _formatter.format(
|
43
|
|
"unable-to-set-element-property",
|
44
|
|
new Object[] {
|
45
|
|
propertyName,
|
46
|
|
target,
|
47
|
|
processor.getElementPath(),
|
48
|
|
HiveMind.getLocationString(element),
|
49
|
|
cause });
|
50
|
|
}
|
51
|
|
|
52
|
0
|
public static String unableToSetProperty(String propertyName, Object target, Throwable cause)
|
53
|
|
{
|
54
|
0
|
return _formatter.format("unable-to-set-property", propertyName, target, cause);
|
55
|
|
}
|
56
|
|
|
57
|
1
|
public static String invalidBooleanValue(String inputValue)
|
58
|
|
{
|
59
|
1
|
return _formatter.format("invalid-boolean-value", inputValue);
|
60
|
|
}
|
61
|
|
|
62
|
0
|
public static String errorCreatingObject(String className, Location location, Throwable cause)
|
63
|
|
{
|
64
|
0
|
return _formatter.format("error-creating-object", className, location, cause);
|
65
|
|
}
|
66
|
|
|
67
|
1
|
public static String invalidDoubleValue(String inputValue)
|
68
|
|
{
|
69
|
1
|
return _formatter.format("invalid-double-value", inputValue);
|
70
|
|
}
|
71
|
|
|
72
|
2
|
public static String minDoubleValue(String inputValue, double minValue)
|
73
|
|
{
|
74
|
2
|
return _formatter.format("min-double-value", inputValue, new Double(minValue));
|
75
|
|
}
|
76
|
|
|
77
|
2
|
public static String maxDoubleValue(String inputValue, double maxValue)
|
78
|
|
{
|
79
|
2
|
return _formatter.format("max-double-value", inputValue, new Double(maxValue));
|
80
|
|
}
|
81
|
|
|
82
|
1
|
public static String enumNotRecognized(String inputValue)
|
83
|
|
{
|
84
|
1
|
return _formatter.format("enum-not-recognized", inputValue);
|
85
|
|
}
|
86
|
|
|
87
|
1
|
public static String enumError(Class enumClass, String fieldName, Throwable cause)
|
88
|
|
{
|
89
|
1
|
return _formatter.format("enum-error", enumClass.getName(), fieldName, cause);
|
90
|
|
}
|
91
|
|
|
92
|
2
|
public static String invalidIntValue(String inputValue)
|
93
|
|
{
|
94
|
2
|
return _formatter.format("invalid-int-value", inputValue);
|
95
|
|
}
|
96
|
|
|
97
|
3
|
public static String minIntValue(String inputValue, int minValue)
|
98
|
|
{
|
99
|
3
|
return _formatter.format("min-int-value", inputValue, new Integer(minValue));
|
100
|
|
}
|
101
|
|
|
102
|
3
|
public static String maxIntValue(String inputValue, int maxValue)
|
103
|
|
{
|
104
|
3
|
return _formatter.format("max-int-value", inputValue, new Integer(maxValue));
|
105
|
|
}
|
106
|
|
|
107
|
1
|
public static String errorInvokingMethod(
|
108
|
|
String methodName,
|
109
|
|
Object parent,
|
110
|
|
Location location,
|
111
|
|
Throwable cause)
|
112
|
|
{
|
113
|
1
|
return _formatter.format(
|
114
|
|
"error-invoking-method",
|
115
|
|
new Object[] { methodName, parent, location, cause });
|
116
|
|
}
|
117
|
|
|
118
|
1
|
public static String invalidLongValue(String inputValue)
|
119
|
|
{
|
120
|
1
|
return _formatter.format("invalid-long-value", inputValue);
|
121
|
|
}
|
122
|
|
|
123
|
2
|
public static String minLongValue(String inputValue, long minValue)
|
124
|
|
{
|
125
|
2
|
return _formatter.format("min-long-value", inputValue, new Long(minValue));
|
126
|
|
}
|
127
|
|
|
128
|
2
|
public static String maxLongValue(String inputValue, long maxValue)
|
129
|
|
{
|
130
|
2
|
return _formatter.format("max-long-value", inputValue, new Long(maxValue));
|
131
|
|
}
|
132
|
|
|
133
|
4
|
public static String readAttributeFailure(
|
134
|
|
String attributeName,
|
135
|
|
Element element,
|
136
|
|
SchemaProcessor processor,
|
137
|
|
Throwable cause)
|
138
|
|
{
|
139
|
4
|
return _formatter.format(
|
140
|
|
"read-attribute-failure",
|
141
|
|
new Object[] { attributeName, processor.getElementPath(), cause });
|
142
|
|
}
|
143
|
|
|
144
|
2
|
public static String readContentFailure(
|
145
|
|
SchemaProcessor processor,
|
146
|
|
Element element,
|
147
|
|
Throwable cause)
|
148
|
|
{
|
149
|
2
|
return _formatter.format("read-content-failure", processor.getElementPath(), cause);
|
150
|
|
}
|
151
|
|
|
152
|
1
|
public static String resourceLocalizationError(String inputValue, Module contributingModule)
|
153
|
|
{
|
154
|
1
|
return _formatter.format(
|
155
|
|
"resource-localization-error",
|
156
|
|
inputValue,
|
157
|
|
contributingModule.getModuleId());
|
158
|
|
}
|
159
|
|
|
160
|
1
|
public static String invalidInitializer(String initializer)
|
161
|
|
{
|
162
|
1
|
return _formatter.format("invalid-initializer", initializer);
|
163
|
|
}
|
164
|
|
|
165
|
1
|
public static String noPropertyEditor(Class propertyType)
|
166
|
|
{
|
167
|
1
|
return _formatter.format("no-property-editor", propertyType.getName());
|
168
|
|
}
|
169
|
|
|
170
|
2
|
public static String smartTranslatorError(
|
171
|
|
String inputValue,
|
172
|
|
Class propertyType,
|
173
|
|
Throwable cause)
|
174
|
|
{
|
175
|
2
|
return _formatter.format(
|
176
|
|
"smart-translator-error",
|
177
|
|
inputValue,
|
178
|
|
propertyType.getName(),
|
179
|
|
cause);
|
180
|
|
}
|
181
|
|
|
182
|
1
|
public static String unableToInstantiateInstanceOfClass(Class clazz, Throwable cause)
|
183
|
|
{
|
184
|
1
|
return _formatter.format("unable-to-instantiate-instance-of-class", clazz.getName(), cause);
|
185
|
|
}
|
186
|
|
}
|