org.eclipse.jet.runtime.model
Interface ILoaderManager
-
public interface ILoaderManager
Interface to the manager for model loaders.
This interface is not intended to be implemented by clients.
Method Summary
|
void
|
addLoader
(java.lang.String id,
java.lang.String name,
ILoaderFactory factory,
boolean dynamic)
Add the named loader to the manager |
void
|
addLoaderForType
(java.lang.String id,
java.lang.String fileType)
Declare the the model loader represented by id can load files of type fileType . |
void
|
clearDefaultLoader
(java.lang.String fileType)
Clear the default loader (if any) associated with the file type. |
IModelLoaderDescription[]
|
findCompatibleModelLoaders
(java.lang.String fileType)
Return an array of model loaders that are capable of loading files of
the specified type. |
IModelLoader
|
getDefaultModelLoader
(java.lang.String fileType)
Return the default model loader for the given file type. |
java.lang.String
|
getDefaultModelLoaderId
(java.lang.String fileType)
Return the id of the default model loader for the give file type. |
IModelLoader
|
getLoader
(java.lang.String url,
java.lang.String loaderId,
java.lang.String type)
Find an appropriate loader. |
IModelLoader
|
getModelLoader
(java.lang.String id)
Return a model loader |
void
|
removeLoader
(java.lang.String id)
Remove a loader from the manager. |
void
|
removeLoaderForType
(java.lang.String id,
java.lang.String fileType)
Forget that the model loader id can load files of type fileType . |
void
|
setDefaultLoader
(java.lang.String fileType,
java.lang.String id)
Define a specific loader as the default model loader for a file type. |
addLoader
void addLoader(java.lang.String id,
java.lang.String name,
ILoaderFactory factory,
boolean dynamic)
- Add the named loader to the manager
-
-
Parameters:
-
id
- the loader's unique identifier string -
name
- a descriptive name of the loader -
factory
- a factory for creating an instance of the loader. -
dynamic
- whether the loader supports dynamic matching of file types by implementing
IModelLoader.canLoad(String)
.
removeLoader
void removeLoader(java.lang.String id)
- Remove a loader from the manager. If the loader is managed by this manager
then this method has no effect.
-
-
Parameters:
-
id
- the unique identifier of the loader to remove.
setDefaultLoader
void setDefaultLoader(java.lang.String fileType,
java.lang.String id)
throws java.lang.IllegalStateException
- Define a specific loader as the default model loader for a file type.
-
-
Parameters:
-
fileType
- the file type (extension) for which the loader is the default -
id
- the id of the default loader
-
Throws:
-
java.lang.IllegalStateException
- if the file type already has a default loader assigned to it.
clearDefaultLoader
void clearDefaultLoader(java.lang.String fileType)
- Clear the default loader (if any) associated with the file type.
-
-
Parameters:
-
fileType
- the file type(extension) for which the loader is the default.
getModelLoader
IModelLoader getModelLoader(java.lang.String id)
- Return a model loader
-
-
Parameters:
-
id
- the unique identifier of the model loader
-
Returns:
- the model loader, or
null
if not found.
getDefaultModelLoader
IModelLoader getDefaultModelLoader(java.lang.String fileType)
- Return the default model loader for the given file type.
-
-
Parameters:
-
fileType
- the file type (extension)
-
Returns:
- the default model loader, or
null
if there is no default model loader.
findCompatibleModelLoaders
IModelLoaderDescription[] findCompatibleModelLoaders(java.lang.String fileType)
- Return an array of model loaders that are capable of loading files of
the specified type.
-
-
Parameters:
-
fileType
- the file type (extension)
-
Returns:
- an array of model loader descriptions. This array may be empty, but will not be
null
.
getDefaultModelLoaderId
java.lang.String getDefaultModelLoaderId(java.lang.String fileType)
- Return the id of the default model loader for the give file type.
-
-
Parameters:
-
fileType
- the file type (extension)
-
Returns:
- an model loader id, or
null
if no loader exists.
addLoaderForType
void addLoaderForType(java.lang.String id,
java.lang.String fileType)
- Declare the the model loader represented by
id
can load files of type fileType
.
-
-
Parameters:
-
id
- the model loader unique identifier. -
fileType
- the file type (extension).
removeLoaderForType
void removeLoaderForType(java.lang.String id,
java.lang.String fileType)
- Forget that the model loader
id
can load files of type fileType
.
-
-
Parameters:
-
id
- the model loader unique identifier. -
fileType
- the file type (extension).
getLoader
IModelLoader getLoader(java.lang.String url,
java.lang.String loaderId,
java.lang.String type)
throws
CoreJETException
- Find an appropriate loader.
-
-
Parameters:
-
url
- -
loaderId
- -
type
-
-
Returns:
- a model loader instance.
-
Throws:
-
CoreJETException
- if a loader cannot be found