org.eclipse.jet.runtime.model
Interface IModelLoader


public interface IModelLoader

Loads an object model given an URL reference to a model, or a string form of that model.


Method Summary
 boolean canLoad(String kind)
          Indicate whether the model loader can handle a particular file kind.
 Object load(URL modelUrl)
          Load a model from the passed URL.
 Object load(URL modelUrl, String kind)
          Load a model from the passed URL.
 Object loadFromString(String serializedModel, String kind)
          Load a model from a String representation of that model
 

Method Detail

load

public Object load(URL modelUrl)
            throws IOException
Load a model from the passed URL.

Parameters:
modelUrl - a URL referencing the model to load
Returns:
the root of the loaded model.
Throws:
IOException - if an error occurs while loading the model.

load

public Object load(URL modelUrl,
                   String kind)
            throws IOException
Load a model from the passed URL.

Parameters:
modelUrl - a URL referencing the model to load
kind - the kind of file (extension) that should be used to contain this content.
Returns:
the root of the loaded model.
Throws:
IOException - if an error occurs while loading the model.

loadFromString

public Object loadFromString(String serializedModel,
                             String kind)
                      throws IOException
Load a model from a String representation of that model

Parameters:
serializedModel - the String form of the model. Will not be null.
kind - the kind of file (extension) that would be used to contain this content.
Returns:
the root of the loaded model.
Throws:
IOException - if an error occurs while loading the model.

canLoad

public boolean canLoad(String kind)
Indicate whether the model loader can handle a particular file kind.

Parameters:
kind - the file kind (extension)
Returns:
true if the loader can load this kind of file, false otherwise.

Copyright 2006 IBM Corporation and others.
All Rights Reserved.