}
private Map<String, String> buildAlternateMessageMap(String baseName, Method method) {
Map<String, String> retMap = new LinkedHashMap<String, String>();
AlternateMessage altMsgAnnotation = method.getAnnotation(AlternateMessage.class);
PluralText pluralTextAnnotation = method.getAnnotation(PluralText.class);
String[] values = new String[0];
if(altMsgAnnotation != null) {
values = altMsgAnnotation.value();
} else if(pluralTextAnnotation != null) {
// Fall back on the PluralText if no AlternateMessage found.
values = pluralTextAnnotation.value();
}
for(int i = 0; i < values.length; i += 2) {
retMap.put(baseName + OPEN_BRACKET + values[i] + CLOSE_BRACKET, values[i + 1]);
}
return retMap;