public void registerExportView(String name,
String viewClassName) {
Class exportClass;
try
{
exportClass = ReflectHelper.classForName(viewClassName);
}
catch (ClassNotFoundException e)
{
log.error(Messages.getString("ExportViewFactory.classnotfound", //$NON-NLS-1$
new Object[]{name, viewClassName}));
return;
}
catch (NoClassDefFoundError e)
{
log.warn(Messages.getString("ExportViewFactory.noclassdef" //$NON-NLS-1$
, new Object[]{name, viewClassName, e.getMessage()}));
return;
}
try
{
exportClass.newInstance();
}
catch (InstantiationException e)
{
log.error(Messages.getString("ExportViewFactory.instantiationexception", //$NON-NLS-1$
new Object[]{name, viewClassName, e.getMessage()}));
return;
}
catch (IllegalAccessException e)
{
log.error(Messages.getString("ExportViewFactory.illegalaccess", //$NON-NLS-1$
new Object[]{name, viewClassName, e.getMessage()}));
return;
}
catch (NoClassDefFoundError e)
{
log.warn(Messages.getString("ExportViewFactory.noclassdef" //$NON-NLS-1$
, new Object[]{name, viewClassName, e.getMessage()}));
return;
}
MediaTypeEnum media = MediaTypeEnum.registerMediaType(name);
viewClasses.put(media, exportClass);
if (log.isDebugEnabled())
{
log.debug(Messages.getString("ExportViewFactory.added", //$NON-NLS-1$
new Object[]{media, viewClassName}));
}
}
Register a new Export View, associated with a Media Type. If another export view is currently associated with the
given media type it's replaced. |