org.eclipse.m2m.atl.engine.parser
Class AtlParser

java.lang.Object
  extended by 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
AtlParser()
           
 
Method Summary
 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()
           
 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.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.
 IModel[] inject(java.io.InputStream source, java.util.Map options)
          Create a new Model then injects data 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!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtlParser

public AtlParser()
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 - the InputStream containing the model
options - 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 interface IInjector
Parameters:
targetModel - the IModel where to inject
source - the InputStream containing the model
options - 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.lang.String source,
                   java.util.Map options)
            throws ATLCoreException
Injects data into an IModel using the given options.

Specified by:
inject in interface IInjector
Parameters:
targetModel - the IModel where to inject
source - the source indication to load the sourceModel: an URL, or a specific thing
options - 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 interface IInjector
Parameters:
targetModel - the IModel where to inject
source - 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 interface IExtractor
Parameters:
sourceModel - the IModel to extract
target - the OutputStream where to extract the targetModel
options - 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 interface IExtractor
Parameters:
sourceModel - the IModel to extract
target - the target indication to extract the targetModel
options - 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 interface IExtractor
Parameters:
sourceModel - the IModel to extract
target - 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 stream
hideErrors - 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 expression
expressionType - the ATL expression type the Syntax Element parsed
Returns:
outputs models

Copyright 2007 IBM Corporation and others.
All Rights Reserved.