if (factoryParameters == null || factoryParameters.size() <= 0)
{
return null;
}
final CSVQuoter innerQuoter = new CSVQuoter('=');
final CSVQuoter quoter = new CSVQuoter(':');
final StringBuilder sb = new StringBuilder();
for (Iterator iterator = factoryParameters.keySet().iterator(); iterator.hasNext();)
{
if (sb.length() > 0)
{
sb.append(':');
}
final StringBuilder entrySb = new StringBuilder();
final Object key = iterator.next();
if (key instanceof FactoryParameterKey)
{
final FactoryParameterKey fkey = (FactoryParameterKey) key;
entrySb.append(innerQuoter.doQuoting("f:" + fkey.getName()));
}
else if (key instanceof LoaderParameterKey)
{
final LoaderParameterKey fkey = (LoaderParameterKey) key;
entrySb.append(innerQuoter.doQuoting("l:" + fkey.getName()));
}
else
{
throw new IllegalArgumentException(String.valueOf(key));
}
final Object value = factoryParameters.get(key);
entrySb.append('=');
if (value != null)
{
// todo: This String.valueOf is probably and very likely wrong
entrySb.append(innerQuoter.doQuoting(String.valueOf(value)));
}
sb.append(quoter.doQuoting(entrySb.toString()));
}
logger.debug("Converted ResourceKey's Factory Parameters to String: [" + sb.toString() + "]");
return sb.toString();
}