if (value instanceof ExternalResource) {
addAttribute(name, ((ExternalResource) value).getURL());
} else if (value instanceof ApplicationResource) {
final ApplicationResource r = (ApplicationResource) value;
final Application a = r.getApplication();
if (a == null) {
throw new PaintException(
"Application not specified for resorce "
+ value.getClass().getName());
}
final String uri = a.getRelativeLocation(r);
addAttribute(name, uri);
} else if (value instanceof ThemeResource) {
final String uri = "theme://"
+ ((ThemeResource) value).getResourceId();