Class AbstractModelInitializer<M extends IModel>
- java.lang.Object
-
- net.ssehub.easy.basics.modelManagement.AbstractModelInitializer<M>
-
- Type Parameters:
M- the model type
- All Implemented Interfaces:
ModelInitializer.IModelInitializer
- Direct Known Subclasses:
IvmlParser,VilExpressionParser,VtlExpressionParser
public abstract class AbstractModelInitializer<M extends IModel> extends java.lang.Object implements ModelInitializer.IModelInitializer
Implements an abstract model initializer for the language parsers.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description AbstractModelInitializer()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddLocation(java.io.File location, ProgressObserver observer)Adds a model location to the end of the list of existing locations.voidaddLocationToFront(java.io.File location, ProgressObserver observer)Adds a model location to the beginning of the list of existing locations.protected abstract IModelLoader<M>getModelLoader()Returns the actual model loader.protected abstract ModelManagement<M>getModelManagement()Returns the actual model management instance.voidregisterLoader(ProgressObserver observer)Registers the default model loader instance.voidremoveLocation(java.io.File location, ProgressObserver observer)Adds a model location.static java.io.FilestripFile(java.io.File file)Strips the file and turns it to the containing folder.voidunregisterLoader(ProgressObserver observer)Unregisters the default model loader.
-
-
-
Method Detail
-
getModelManagement
protected abstract ModelManagement<M> getModelManagement()
Returns the actual model management instance.- Returns:
- the model management instance
-
getModelLoader
protected abstract IModelLoader<M> getModelLoader()
Returns the actual model loader.- Returns:
- the model loader (may be null if registration of the loader is done differently)
-
stripFile
public static java.io.File stripFile(java.io.File file)
Strips the file and turns it to the containing folder.- Parameters:
file- the file to be stripped- Returns:
- the containing folder in case of a file,
fileelse
-
addLocation
public void addLocation(java.io.File location, ProgressObserver observer) throws ModelManagementExceptionDescription copied from interface:ModelInitializer.IModelInitializerAdds a model location to the end of the list of existing locations.- Specified by:
addLocationin interfaceModelInitializer.IModelInitializer- Parameters:
location- the model location. Basically, this is a folder but for serializers, this may be a file.observer- the progress observer- Throws:
ModelManagementException- in case of problems registering the location
-
addLocationToFront
public void addLocationToFront(java.io.File location, ProgressObserver observer) throws ModelManagementExceptionDescription copied from interface:ModelInitializer.IModelInitializerAdds a model location to the beginning of the list of existing locations.- Specified by:
addLocationToFrontin interfaceModelInitializer.IModelInitializer- Parameters:
location- the model location. Basically, this is a folder but for serializers, this may be a file.observer- the progress observer- Throws:
ModelManagementException- in case of problems registering the location
-
removeLocation
public void removeLocation(java.io.File location, ProgressObserver observer) throws ModelManagementExceptionDescription copied from interface:ModelInitializer.IModelInitializerAdds a model location.- Specified by:
removeLocationin interfaceModelInitializer.IModelInitializer- Parameters:
location- the model location. Basically, this is a folder but for serializers, this may be a file.observer- the progress observer- Throws:
ModelManagementException- in case of problems registering the location
-
registerLoader
public void registerLoader(ProgressObserver observer) throws ModelManagementException
Description copied from interface:ModelInitializer.IModelInitializerRegisters the default model loader instance.- Specified by:
registerLoaderin interfaceModelInitializer.IModelInitializer- Parameters:
observer- the progress observer- Throws:
ModelManagementException- in case of problems registering the location
-
unregisterLoader
public void unregisterLoader(ProgressObserver observer) throws ModelManagementException
Description copied from interface:ModelInitializer.IModelInitializerUnregisters the default model loader.- Specified by:
unregisterLoaderin interfaceModelInitializer.IModelInitializer- Parameters:
observer- the progress observer- Throws:
ModelManagementException- in case of problems registering the location
-
-