MetaDone
metadone.client.functions.importer.ModelImporter Class Reference
Inheritance diagram for metadone.client.functions.importer.ModelImporter:
Collaboration diagram for metadone.client.functions.importer.ModelImporter:

List of all members.

Public Member Functions

Importer getImporter (String ext)
void addImporter (Importer importer, String...exts) throws BadPreCondition
void removeImporter (Importer importer)
void removeImporter (String ext)
Map< String, ImportergetImporters ()
String getMetamodelName (String ext) throws BadPreCondition
MetaModel getMetamodel (String ext) throws BadPreCondition
ConcreteModel createConcreteModel (String ext, String source) throws BadPreCondition, IOException
ConcreteModel createConcreteModel (String ext, InputStream input) throws BadPreCondition, IOException
MetaModel promoteToMetamodel (String ext, String name, ConcreteModel model) throws BadPreCondition

Static Public Member Functions

static ModelImporter getSingleton ()

Private Member Functions

 ModelImporter ()

Private Attributes

Map< String, Importerimporters = new HashMap<String, Importer>()

Static Private Attributes

static final ModelImporter singleton = new ModelImporter()

Detailed Description

Imports models from various file types.

This class may be used as a global class registering other importers.

Author:
kma

Constructor & Destructor Documentation

metadone.client.functions.importer.ModelImporter.ModelImporter ( ) [private]

Member Function Documentation

ConcreteModel metadone.client.functions.importer.ModelImporter.createConcreteModel ( String  ext,
String  source 
) throws BadPreCondition, IOException

Creates a concrete model for a given extension and a source file.

Parameters:
extThe extension
sourceThe source file
Returns:
A concrete metamodel
Exceptions:
BadPreConditionwhen the model couldn't be created
IOExceptionwhen there was an exception while reading the file

Implements metadone.client.functions.importer.Importer.

References metadone.client.functions.importer.Importer.createConcreteModel(), and metadone.client.functions.importer.ModelImporter.getImporter().

ConcreteModel metadone.client.functions.importer.ModelImporter.createConcreteModel ( String  ext,
InputStream  input 
) throws BadPreCondition, IOException

Creates a concrete model for a given extension and contents.

The model is generated using getMetamodel(String) for the creation of the concrete model.

Parameters:
extThe extension
inputThe contents of the file
Returns:
A concrete metamodel
Exceptions:
BadPreConditionwhen the model couldn't be created
IOExceptionwhen the input couldn't be parsed

Implements metadone.client.functions.importer.Importer.

References metadone.client.functions.importer.Importer.createConcreteModel(), and metadone.client.functions.importer.ModelImporter.getImporter().

Map<String, Importer> metadone.client.functions.importer.ModelImporter.getImporters ( )
MetaModel metadone.client.functions.importer.ModelImporter.getMetamodel ( String  ext) throws BadPreCondition

Creates a metamodel for the given extension.

Parameters:
extThe extension (may be null)
Returns:
A metamodel or null
Exceptions:
BadPreCondition

Implements metadone.client.functions.importer.Importer.

References metadone.client.functions.importer.ModelImporter.getImporter(), and metadone.client.functions.importer.Importer.getMetamodel().

String metadone.client.functions.importer.ModelImporter.getMetamodelName ( String  ext) throws BadPreCondition

Returns the name of the metamodel for the given extension.

If the extension is supported, a name of the metamodel is returned. null is returned when the extension is not supported.

Parameters:
extThe extension (may be null)
Returns:
The name of a metamodel or null
Exceptions:
BadPreCondition

Implements metadone.client.functions.importer.Importer.

References metadone.client.functions.importer.ModelImporter.getImporter(), and metadone.client.functions.importer.Importer.getMetamodelName().

MetaModel metadone.client.functions.importer.ModelImporter.promoteToMetamodel ( String  ext,
String  name,
ConcreteModel  model 
) throws BadPreCondition

Promotes a concrete model to a meta model.

Parameters:
extThe extension of the model
nameThe name of the metamodel to create
modelThe concrete model
Returns:
A metamodel generated from the model
Exceptions:
NullPointerExceptionwhen name or model is null
BadPreConditionwhen the model failed to be created or the name was already used

Implements metadone.client.functions.importer.PromotingImporter.

References metadone.client.functions.importer.ModelImporter.getImporter(), and metadone.client.functions.importer.PromotingImporter.promoteToMetamodel().

void metadone.client.functions.importer.ModelImporter.removeImporter ( String  ext)
void metadone.client.functions.importer.ModelImporter.removeImporter ( Importer  importer)

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations