{
StringBuffer result = new StringBuffer();
Serializable argument;
Serializable[] arguments = message.getArguments();
Formatter formatter;
if(arguments == null || arguments.length == 0)
{
return "";
}
for(int i = 0; i < arguments.length; i++)
{
if(i == 0)
{
result.append(" (");
}
else
{
result.append(",");
}
argument = arguments[i];
formatter = this.messageContext.config().getFormatterFactory().findFormatter(argument.getClass());
if (formatter != null && !isDefaultFormatter(formatter.getClass()))
{
//noinspection unchecked
result.append(formatter.format(this.messageContext, argument));
}
else if(argument instanceof Localizable)
{
result.append(((Localizable)argument).toString(this.messageContext));
}
else
{
//use default formatter (if available)
if(formatter != null)
{
//noinspection unchecked
result.append(formatter.format(this.messageContext, argument));
}
else
{
result.append(argument.toString());
}