Package org.eclipse.m2m.atl.engine.parser

# Class AtlSourceManager

java.lang.Object
org.eclipse.m2m.atl.engine.parser.AtlSourceManager

public final class AtlSourceManager extends Object
ATL source inspector, used to catch main file informations. Also allows to update them.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ATL_FILE_TYPE_LIBRARY`
Library.
`static final int`
`ATL_FILE_TYPE_MODULE`
Module.
`static final int`
`ATL_FILE_TYPE_QUERY`
Query.
`static final int`
`ATL_FILE_TYPE_UNDEFINED`
Undefined.
`static final String`
`COMPILER_TAG`
ATL compiler tag.
`static final int`
`FILTER_ALL_METAMODELS`
0 : input + output metamodels.
`static final int`
`FILTER_INPUT_METAMODELS`
1 : input metamodels.
`static final int`
`FILTER_OUTPUT_METAMODELS`
2 : OUTPUT metamodels.
`static final String`
`LIB_TAG`
LIB tag value.
`static final String`
`PATH_TAG`
PATH tag value.
`static final String`
`URI_TAG`
URI tag value.

## Constructor Summary

Constructors
Constructor
Description
`AtlSourceManager()`
Creates an atl source manager.

## Method Summary

Modifier and Type
Method
Description
`String`
`getAtlCompiler()`
`int`
`getATLFileType()`
Returns the ATL file type.
`static String`
`getCompilerName(List compilers)`
Returns the compiler name, or the default name if null.
`Map`
`getInputModels()`
`List`
`getLibrariesImports()`
`Map`
`getLibraryLocations()`
`Map`
`getMetamodelLocations()`
`Map`
`getMetamodelPackages(int filter)`
Metamodels access method.
`List`
`getMetamodelPackages(String metamodelId)`
Access on a specific metamodel.
`org.eclipse.emf.ecore.EObject`
`getModel()`
`Map`
`getOutputModels()`
`static List`
`getTaggedInformations(byte[] buffer, String tag)`
Returns the list of tagged informations (header).
`static List`
`getTaggedInformations(BufferedReader reader, String tag)`
Returns the list of tagged informations (header).
`boolean`
`initialized()`
Status method.
`boolean`
`isRefining()`
`void`
`updateDataSource(InputStream inputStream)`
Update method : parsing and metamodel detection.
`void`
`updateDataSource(String content)`
Update method : parsing and metamodel detection.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### COMPILER_TAG

public static final String COMPILER_TAG
ATL compiler tag.

See Also:
  - Constant Field Values

### URI_TAG

public static final String URI_TAG
URI tag value.

See Also:
  - Constant Field Values

### PATH_TAG

public static final String PATH_TAG
PATH tag value.

See Also:
  - Constant Field Values

### LIB_TAG

public static final String LIB_TAG
LIB tag value.

See Also:
  - Constant Field Values

### ATL_FILE_TYPE_UNDEFINED

public static final int ATL_FILE_TYPE_UNDEFINED
Undefined.

See Also:
  - Constant Field Values

### ATL_FILE_TYPE_MODULE

public static final int ATL_FILE_TYPE_MODULE
Module.

See Also:
  - Constant Field Values

### ATL_FILE_TYPE_QUERY

public static final int ATL_FILE_TYPE_QUERY
Query.

See Also:
  - Constant Field Values

### ATL_FILE_TYPE_LIBRARY

public static final int ATL_FILE_TYPE_LIBRARY
Library.

See Also:
  - Constant Field Values

### FILTER_ALL_METAMODELS

public static final int FILTER_ALL_METAMODELS
0 : input + output metamodels.

See Also:
  - Constant Field Values

### FILTER_INPUT_METAMODELS

public static final int FILTER_INPUT_METAMODELS
1 : input metamodels.

See Also:
  - Constant Field Values

### FILTER_OUTPUT_METAMODELS

public static final int FILTER_OUTPUT_METAMODELS
2 : OUTPUT metamodels.

See Also:
  - Constant Field Values

## Constructor Details

### AtlSourceManager

public AtlSourceManager()
Creates an atl source manager.

## Method Details

### getATLFileType

public int getATLFileType()
Returns the ATL file type.

Returns:
  the ATL file type

### getInputModels

public Map getInputModels()

### getOutputModels

public Map getOutputModels()

### getLibrariesImports

public List getLibrariesImports()

### updateDataSource

public void updateDataSource(String content)
Update method : parsing and metamodel detection.

Parameters:
  `content` - the content of the atl file

### updateDataSource

public void updateDataSource(InputStream inputStream) throws IOException
Update method : parsing and metamodel detection.

Parameters:
  `inputStream` - the atl file input stream
Throws:
  `IOException`

### isRefining

public boolean isRefining()

### getModel

public org.eclipse.emf.ecore.EObject getModel()

### getMetamodelPackages

public Map getMetamodelPackages(int filter)
Metamodels access method.

Parameters:
  `filter` - the metamodel filter
Returns:
  the map of searched metamodels

### getMetamodelPackages

public List getMetamodelPackages(String metamodelId)
Access on a specific metamodel.

Parameters:
  `metamodelId` - the metamodel id
Returns:
  the metamodels list

### getAtlCompiler

public String getAtlCompiler()

### getMetamodelLocations

public Map getMetamodelLocations()

### getLibraryLocations

public Map getLibraryLocations()

### initialized

public boolean initialized()
Status method.

Returns:
  `True` if the some metamodels have ever been detected , `False` if not.

### getTaggedInformations

public static List getTaggedInformations(byte[] buffer, String tag)
Returns the list of tagged informations (header).

Parameters:
  `buffer` - the input
  `tag` - the tag to search
Returns:
  the tagged information

### getTaggedInformations

public static List getTaggedInformations(BufferedReader reader, String tag) throws IOException
Returns the list of tagged informations (header).

Parameters:
  `reader` - the input
  `tag` - the tag to search
Returns:
  the tagged information
Throws:
  `IOException`

### getCompilerName

public static String getCompilerName(List compilers)
Returns the compiler name, or the default name if null.

Parameters:
  `compilers` - the list of compilers
Returns:
  the compiler name, or the default name if null