blob: 672c65ad2636393c775cc4ee0523c48c0658d847 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004-2008 Andras Schmidt, Andras Balogh, Istvan Rath and Daniel Varro
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andras Schmidt, Andras Balogh, Istvan Rath - initial API and implementation
*******************************************************************************/
package org.eclipse.viatra2.loaders;
import java.io.InputStream;
import org.eclipse.viatra2.errors.VPMRuntimeException;
import org.eclipse.viatra2.framework.IFramework;
/**
* Interface to modules which load program models into a framework's machine
* model storage
*
* @author Istvan Rath
*/
public interface Loader {
/**
* Processes the given file. It is the Loader's responsibility to add the
* resulting program model instance to the Framework's program model
* registry using the appropriate FQN.
*
* @param fileName
* File name
* @param fw
* The current framework
* @return
* The added program model instance
* @throws VPMRuntimeException
*/
public Object processFile(String fileName, IFramework fw)
throws VPMRuntimeException;
/**
* Processes the given stream It is the Loader's responsibility to add the
* resulting program model instance to the Framework's program model
* registry using the appropriate FQN.
*
* @param f
* stream to process
* @param fw
* The current framework
* @return
* The added program model instance
* @throws VPMRuntimeException
*/
public Object process(InputStream f, IFramework fw)
throws VPMRuntimeException;
}