Package org.contextmapper.dsl.standalone
Class StandaloneContextMapper
- java.lang.Object
-
- org.contextmapper.dsl.standalone.StandaloneContextMapper
-
- All Implemented Interfaces:
StandaloneContextMapperAPI
public class StandaloneContextMapper extends java.lang.Object implements StandaloneContextMapperAPI
-
-
Constructor Summary
Constructors Constructor Description StandaloneContextMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyRefactoring(CMLResource cml, SemanticCMLRefactoring refactoring)
Applies a refactoring (must be of type SemanticCMLRefactoring) on a CML model.void
callGenerator(CMLResource cml, org.eclipse.xtext.generator.IGenerator2 generator)
Calls a generator that produces output (Graphical Context Map, PlantUML, etc.) given a CML resource as input.void
callGenerator(CMLResource cml, org.eclipse.xtext.generator.IGenerator2 generator, java.lang.String outputDir)
Calls a generator that produces output (Graphical Context Map, PlantUML, etc.) given a CML resource as input.CMLResource
createCML(java.io.File cmlFile)
Creates a new CML model.CMLResource
createCML(java.lang.String filepath)
Creates a new CML model.CMLResource
loadCML(java.io.File cmlFile)
Loads a CML model, given a *.cml file.CMLResource
loadCML(java.lang.String filepath)
Loads a CML model, given a *.cml file.
-
-
-
Method Detail
-
loadCML
public CMLResource loadCML(java.lang.String filepath)
Description copied from interface:StandaloneContextMapperAPI
Loads a CML model, given a *.cml file.- Specified by:
loadCML
in interfaceStandaloneContextMapperAPI
- Parameters:
filepath
- the path to the *.cml file that shall be loaded- Returns:
- the CMLResource loaded from the *.cml file
-
loadCML
public CMLResource loadCML(java.io.File cmlFile)
Description copied from interface:StandaloneContextMapperAPI
Loads a CML model, given a *.cml file.- Specified by:
loadCML
in interfaceStandaloneContextMapperAPI
- Parameters:
cmlFile
- the *.cml file- Returns:
- the CMLResource loaded from the *.cml file
-
callGenerator
public void callGenerator(CMLResource cml, org.eclipse.xtext.generator.IGenerator2 generator)
Description copied from interface:StandaloneContextMapperAPI
Calls a generator that produces output (Graphical Context Map, PlantUML, etc.) given a CML resource as input. This method generates all output files into the default directory "./src-gen".- Specified by:
callGenerator
in interfaceStandaloneContextMapperAPI
- Parameters:
cml
- the CML resource for which the generator shall be calledgenerator
- the generator that shall be called
-
callGenerator
public void callGenerator(CMLResource cml, org.eclipse.xtext.generator.IGenerator2 generator, java.lang.String outputDir)
Description copied from interface:StandaloneContextMapperAPI
Calls a generator that produces output (Graphical Context Map, PlantUML, etc.) given a CML resource as input. This method allows to define the directory into which the output shall be generated (start with "./" and provide a directory relative to your execution home).- Specified by:
callGenerator
in interfaceStandaloneContextMapperAPI
- Parameters:
cml
- the CML resource for which the generator shall be calledgenerator
- the generator that shall be calledoutputDir
- the directory in which you want to generate the output (start with "./", relative to your execution directory)
-
createCML
public CMLResource createCML(java.lang.String filepath)
Description copied from interface:StandaloneContextMapperAPI
Creates a new CML model.- Specified by:
createCML
in interfaceStandaloneContextMapperAPI
- Parameters:
filepath
- the filepath where the *.cml file will be stored, in case the resource is saved/persisted- Returns:
- the new CMLResource (not yet persisted; you have to call save() on the resource)
-
createCML
public CMLResource createCML(java.io.File cmlFile)
Description copied from interface:StandaloneContextMapperAPI
Creates a new CML model.- Specified by:
createCML
in interfaceStandaloneContextMapperAPI
- Parameters:
cmlFile
- the file where the *.cml file will be stored, in case the resource is saved/persisted- Returns:
- the new CMLResource (not yet persisted; you have to call save() on the resource)
-
applyRefactoring
public void applyRefactoring(CMLResource cml, SemanticCMLRefactoring refactoring)
Description copied from interface:StandaloneContextMapperAPI
Applies a refactoring (must be of type SemanticCMLRefactoring) on a CML model.- Specified by:
applyRefactoring
in interfaceStandaloneContextMapperAPI
- Parameters:
cml
- the model on which the refactoring shall be appliedrefactoring
- the refactoring that shall be applied
-
-