{
if (instance instanceof Locale)
{
Locale locale = (Locale) instance;
String text = locale.getLanguage() + "_" + locale.getCountry() + "_" + locale.getVariant();
return new SinglePropertySet(path, text, indexed);
}
else if (instance instanceof Class<?>)
{
String name = ((Class<?>) instance).getName();
return new SinglePropertySet(path, name, indexed);
}
else if (instance instanceof Currency)
{
String name = ((Currency) instance).getCurrencyCode();
return new SinglePropertySet(path, name, indexed);
}
else if (instance instanceof URI)
{
String name = ((URI) instance).toString();
return new SinglePropertySet(path, name, indexed);
}
else if (instance instanceof URL)
{
String name = ((URL) instance).toString();
return new SinglePropertySet(path, name, indexed);
}
return null;
}