Class AtlParser
- java.lang.Object
-
- org.eclipse.m2m.atl.engine.parser.AtlParser
-
- All Implemented Interfaces:
IExtractor
,IInjector
public final class AtlParser extends java.lang.Object implements IInjector, IExtractor
TCS utilities Wrapper.
-
-
Constructor Summary
Constructors Constructor Description AtlParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
extract(IModel sourceModel, java.io.OutputStream target, java.util.Map options)
Extracts an IModel using the given options.void
extract(IModel sourceModel, java.lang.String target)
Extracts an IModel using default options.void
extract(IModel sourceModel, java.lang.String target, java.util.Map options)
Extracts an IModel using the given options.IReferenceModel
getAtlMetamodel()
IModel
getAtlTcsModel()
static AtlParser
getDefault()
Returns the default ATL parser.ModelFactory
getModelFactory()
IReferenceModel
getProblemMetamodel()
IModel[]
inject(java.io.InputStream source, java.util.Map options)
Create a new Model then injects data using the given options.IModel[]
inject(java.io.Reader source, java.util.Map options)
Create a new Model then injects data using the given options.void
inject(IModel targetModel, java.io.InputStream source, java.util.Map options)
Injects data into an IModel using the given options.void
inject(IModel targetModel, java.io.Reader source, java.util.Map options)
Injects data into an IModel using the given options.void
inject(IModel targetModel, java.lang.String source)
Injects data into an IModel using default options.void
inject(IModel targetModel, java.lang.String source, java.util.Map options)
Injects data into an IModel using the given options.org.eclipse.emf.ecore.EObject
parse(java.io.InputStream in)
Parses the given input stream.org.eclipse.emf.ecore.EObject[]
parseExpression(java.lang.String expression, java.lang.String expressionType)
ATL injector launcher.IModel
parseToModel(java.io.InputStream in)
Parses the given input stream.IModel[]
parseToModelWithProblems(java.io.InputStream in, boolean hideErrors)
Parses the given input stream.org.eclipse.emf.ecore.EObject[]
parseWithProblems(java.io.InputStream in)
Returns An array of EObject, the first one being an ATL!Unit and the following ones Problem!Problem.
-
-
-
Method Detail
-
getDefault
public static AtlParser getDefault()
Returns the default ATL parser.- Returns:
- the default ATL parser
-
getModelFactory
public ModelFactory getModelFactory()
-
getAtlTcsModel
public IModel getAtlTcsModel()
-
getProblemMetamodel
public IReferenceModel getProblemMetamodel()
-
getAtlMetamodel
public IReferenceModel getAtlMetamodel()
-
inject
public IModel[] inject(java.io.InputStream source, java.util.Map options) throws ATLCoreException
Create a new Model then injects data using the given options.- Parameters:
source
- theInputStream
containing the modeloptions
- the injection parameters- Returns:
- the new ATL Model
- Throws:
ATLCoreException
-
inject
public IModel[] inject(java.io.Reader source, java.util.Map options) throws ATLCoreException
Create a new Model then injects data using the given options.- Parameters:
source
- theReader
containing the modeloptions
- the injection parameters- Returns:
- the new ATL Model
- Throws:
ATLCoreException
-
inject
public void inject(IModel targetModel, java.io.InputStream source, java.util.Map options) throws ATLCoreException
Injects data into an IModel using the given options.- Specified by:
inject
in interfaceIInjector
- Parameters:
targetModel
- the IModel where to injectsource
- theInputStream
containing the modeloptions
- the injection parameters- Throws:
ATLCoreException
- See Also:
IInjector.inject(org.eclipse.m2m.atl.core.IModel, java.io.InputStream, java.util.Map)
-
inject
public void inject(IModel targetModel, java.io.Reader source, java.util.Map options) throws ATLCoreException
Injects data into an IModel using the given options.- Specified by:
inject
in interfaceIInjector
- Parameters:
targetModel
- the IModel where to injectsource
- theReader
containing the modeloptions
- the injection parameters- Throws:
ATLCoreException
- See Also:
IInjector.inject(org.eclipse.m2m.atl.core.IModel, java.io.Reader, java.util.Map)
-
inject
public void inject(IModel targetModel, java.lang.String source, java.util.Map options) throws ATLCoreException
Injects data into an IModel using the given options.- Specified by:
inject
in interfaceIInjector
- Parameters:
targetModel
- the IModel where to injectsource
- the source indication to load the sourceModel: an URL, or a specific thingoptions
- the injection parameters- Throws:
ATLCoreException
- See Also:
IInjector.inject(org.eclipse.m2m.atl.core.IModel, java.lang.String, java.util.Map)
-
inject
public void inject(IModel targetModel, java.lang.String source) throws ATLCoreException
Injects data into an IModel using default options.- Specified by:
inject
in interfaceIInjector
- Parameters:
targetModel
- the IModel where to injectsource
- the source indication to load the sourceModel- Throws:
ATLCoreException
- See Also:
IInjector.inject(org.eclipse.m2m.atl.core.IModel, java.lang.String)
-
extract
public void extract(IModel sourceModel, java.io.OutputStream target, java.util.Map options) throws ATLCoreException
Extracts an IModel using the given options.- Specified by:
extract
in interfaceIExtractor
- Parameters:
sourceModel
- the IModel to extracttarget
- theOutputStream
where to extract the targetModeloptions
- the extraction parameters- Throws:
ATLCoreException
- See Also:
IExtractor.extract(org.eclipse.m2m.atl.core.IModel, java.io.OutputStream, java.util.Map)
-
extract
public void extract(IModel sourceModel, java.lang.String target, java.util.Map options) throws ATLCoreException
Extracts an IModel using the given options.- Specified by:
extract
in interfaceIExtractor
- Parameters:
sourceModel
- the IModel to extracttarget
- the target indication to extract the targetModeloptions
- the extraction parameters- Throws:
ATLCoreException
- See Also:
IExtractor.extract(org.eclipse.m2m.atl.core.IModel, java.lang.String, java.util.Map)
-
extract
public void extract(IModel sourceModel, java.lang.String target) throws ATLCoreException
Extracts an IModel using default options.- Specified by:
extract
in interfaceIExtractor
- Parameters:
sourceModel
- the IModel to extracttarget
- the target indication to extract the targetModel- Throws:
ATLCoreException
- See Also:
IExtractor.extract(org.eclipse.m2m.atl.core.IModel, java.lang.String)
-
parse
public org.eclipse.emf.ecore.EObject parse(java.io.InputStream in) throws ATLCoreException
Parses the given input stream.- Parameters:
in
- an input stream- Returns:
- the resulting EObject
- Throws:
ATLCoreException
-
parseWithProblems
public org.eclipse.emf.ecore.EObject[] parseWithProblems(java.io.InputStream in) throws ATLCoreException
Returns An array of EObject, the first one being an ATL!Unit and the following ones Problem!Problem.- Parameters:
in
- InputStream to parse ATL code from.- Returns:
- An array of EObject, the first one being an ATL!Unit and the following ones Problem!Problem.
- Throws:
ATLCoreException
-
parseToModel
public IModel parseToModel(java.io.InputStream in) throws ATLCoreException
Parses the given input stream.- Parameters:
in
- an input stream- Returns:
- the resulting IModel
- Throws:
ATLCoreException
-
parseToModelWithProblems
public IModel[] parseToModelWithProblems(java.io.InputStream in, boolean hideErrors) throws ATLCoreException
Parses the given input stream.- Parameters:
in
- an input streamhideErrors
- disable standard output in order to hide errors- Returns:
- the parser resulting IModel[model,problemModel]
- Throws:
ATLCoreException
-
parseExpression
public org.eclipse.emf.ecore.EObject[] parseExpression(java.lang.String expression, java.lang.String expressionType)
ATL injector launcher.- Parameters:
expression
- an ATL expressionexpressionType
- the ATL expression type the Syntax Element parsed- Returns:
- outputs models
-
-