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

## Class AtlSourceManager

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

    public final class AtlSourceManager
    extends java.lang.Object

ATL source inspector, used to catch main file informations. Also allows to update them.

### Field Summary

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

### Constructor Summary

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

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`java.lang.String` `getAtlCompiler()`
`int` `getATLFileType()` Returns the ATL file type.
`static java.lang.String` `getCompilerName​(java.util.List compilers)` Returns the compiler name, or the default name if null.
`java.util.Map` `getInputModels()`
`java.util.List` `getLibrariesImports()`
`java.util.Map` `getLibraryLocations()`
`java.util.Map` `getMetamodelLocations()`
`java.util.Map` `getMetamodelPackages​(int filter)` Metamodels access method.
`java.util.List` `getMetamodelPackages​(java.lang.String metamodelId)` Access on a specific metamodel.
`org.eclipse.emf.ecore.EObject` `getModel()`
`java.util.Map` `getOutputModels()`
`static java.util.List` `getTaggedInformations​(byte[] buffer, java.lang.String tag)` Returns the list of tagged informations (header).
`static java.util.List` `getTaggedInformations​(java.io.BufferedReader reader, java.lang.String tag)` Returns the list of tagged informations (header).
`boolean` `initialized()` Status method.
`boolean` `isRefining()`
`void` `updateDataSource​(java.io.InputStream inputStream)` Update method : parsing and metamodel detection.
`void` `updateDataSource​(java.lang.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 Detail

#### COMPILER_TAG

    public static final java.lang.String COMPILER_TAG

ATL compiler tag.

See Also:
  Constant Field Values

#### URI_TAG

    public static final java.lang.String URI_TAG

URI tag value.

See Also:
  Constant Field Values

#### PATH_TAG

    public static final java.lang.String PATH_TAG

PATH tag value.

See Also:
  Constant Field Values

#### LIB_TAG

    public static final java.lang.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 Detail

#### AtlSourceManager

    public AtlSourceManager()

Creates an atl source manager.

### Method Detail

#### getATLFileType

    public int getATLFileType()

Returns the ATL file type.

Returns:
  the ATL file type

#### getInputModels

    public java.util.Map getInputModels()

#### getOutputModels

    public java.util.Map getOutputModels()

#### getLibrariesImports

    public java.util.List getLibrariesImports()

#### updateDataSource

    public void updateDataSource​(java.lang.String content)

Update method : parsing and metamodel detection.

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

#### updateDataSource

    public void updateDataSource​(java.io.InputStream inputStream)
                          throws java.io.IOException

Update method : parsing and metamodel detection.

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

#### isRefining

    public boolean isRefining()

#### getModel

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

#### getMetamodelPackages

    public java.util.Map getMetamodelPackages​(int filter)

Metamodels access method.

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

#### getMetamodelPackages

    public java.util.List getMetamodelPackages​(java.lang.String metamodelId)

Access on a specific metamodel.

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

#### getAtlCompiler

    public java.lang.String getAtlCompiler()

#### getMetamodelLocations

    public java.util.Map getMetamodelLocations()

#### getLibraryLocations

    public java.util.Map getLibraryLocations()

#### initialized

    public boolean initialized()

Status method.

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

#### getTaggedInformations

    public static java.util.List getTaggedInformations​(byte[] buffer,
                                                       java.lang.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 java.util.List getTaggedInformations​(java.io.BufferedReader reader,
                                                       java.lang.String tag)
                                                throws java.io.IOException

Returns the list of tagged informations (header).

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

#### getCompilerName

    public static java.lang.String getCompilerName​(java.util.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