org.jdesktop.wonderland.client.content
Class ContentImportManager

java.lang.Object
  extended by org.jdesktop.wonderland.client.content.ContentImportManager

public class ContentImportManager
extends java.lang.Object

Manages the collection import handlers for different kinds of content. Each content type is given by the file extension, as returned by the class that implements the ContentImportSPI. There can also be a "default" content handler for all file extensions not registered.

Author:
Jordan Slott

Method Summary
 ContentImporterSPI getContentImporter(java.lang.String extension, boolean useDefault)
          Returns the content importer given the extension name, possibly returning the default content importer if the extension is not found and the useDefault argument is set to true.
static ContentImportManager getContentImportManager()
          Returns a single instance of this class
 ContentImporterSPI getDefaultContentImporter()
          Get the current default content importer.
 void registerContentImporter(ContentImporterSPI importer)
          Registers a handler for content import.
 void setDefaultContentImporter(ContentImporterSPI importer)
          Sets the default content importer, overrides any previously set.
 void unregisterContentImporter(ContentImporterSPI importer)
          Unregisters a handler for content import.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getContentImportManager

public static final ContentImportManager getContentImportManager()
Returns a single instance of this class

Returns:
Single instance of this class.

setDefaultContentImporter

public void setDefaultContentImporter(ContentImporterSPI importer)
Sets the default content importer, overrides any previously set.

Parameters:
importer - The content import handler

getDefaultContentImporter

public ContentImporterSPI getDefaultContentImporter()
Get the current default content importer.

Returns:
importer the current default content importer, or null if there is no default content importer.

registerContentImporter

public void registerContentImporter(ContentImporterSPI importer)
Registers a handler for content import. A content import handler handles when an items is to be imported into the world with a specific file extension. Only one import handler is permitted per file extension

Parameters:
importer - The content importer

unregisterContentImporter

public void unregisterContentImporter(ContentImporterSPI importer)
Unregisters a handler for content import.

Parameters:
importer - The content importer

getContentImporter

public ContentImporterSPI getContentImporter(java.lang.String extension,
                                             boolean useDefault)
Returns the content importer given the extension name, possibly returning the default content importer if the extension is not found and the useDefault argument is set to true. If useDefault is false and no importer is found for the given extension, this method returns null.

Parameters:
extension - The file extension to search for a content import
useDefault - If true and no importer is found for the extension, return the default content importer if available
Returns:
A ContentImportSPI object


Open Wonderland - http://openwonderland.org