org.eclipse.m2m.atl.adt.ui.text.atl
Class AtlModelAnalyser

java.lang.Object
  extended by org.eclipse.m2m.atl.adt.ui.text.atl.AtlModelAnalyser

public class AtlModelAnalyser
extends java.lang.Object

Atl model analyser, used to get information from an incomplete ATL model.


Field Summary
static int DO_CONTEXT
          Do section.
static int FROM_CONTEXT
          From section.
static int HELPER_CONTEXT
          Helper.
static int MODULE_CONTEXT
          ATL module.
static int NULL_CONTEXT
          context types.
static int RULE_CONTEXT
          Rule.
static int TO_CONTEXT
          To section.
static int USING_CONTEXT
          Using section.
 
Constructor Summary
AtlModelAnalyser(AtlCompletionHelper fHelper, org.eclipse.emf.ecore.EObject emfRoot, int modelOffset, java.lang.String lastKeyword, int userOffset)
          Creates an analyser for ATL models.
 
Method Summary
 int getContext()
           
static java.lang.String getContextName(int id)
          Returns the context name by id.
 org.eclipse.emf.ecore.EObject getLocatedElement(int offset)
          Search the nearest element of the given offset.
 org.eclipse.emf.ecore.EObject getLostType(java.lang.String type)
          Looks for a specific type in the anormal root types.
 org.eclipse.emf.ecore.EObject getRootElement()
          Search the root element of the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_CONTEXT

public static final int NULL_CONTEXT
context types.

See Also:
Constant Field Values

MODULE_CONTEXT

public static final int MODULE_CONTEXT
ATL module.

See Also:
Constant Field Values

HELPER_CONTEXT

public static final int HELPER_CONTEXT
Helper.

See Also:
Constant Field Values

RULE_CONTEXT

public static final int RULE_CONTEXT
Rule.

See Also:
Constant Field Values

FROM_CONTEXT

public static final int FROM_CONTEXT
From section.

See Also:
Constant Field Values

TO_CONTEXT

public static final int TO_CONTEXT
To section.

See Also:
Constant Field Values

DO_CONTEXT

public static final int DO_CONTEXT
Do section.

See Also:
Constant Field Values

USING_CONTEXT

public static final int USING_CONTEXT
Using section.

See Also:
Constant Field Values
Constructor Detail

AtlModelAnalyser

public AtlModelAnalyser(AtlCompletionHelper fHelper,
                        org.eclipse.emf.ecore.EObject emfRoot,
                        int modelOffset,
                        java.lang.String lastKeyword,
                        int userOffset)
Creates an analyser for ATL models.

Parameters:
fHelper - the completion helper
emfRoot - the model root
modelOffset - the model offset
lastKeyword - the last detected keyword
userOffset - the user current offset
Method Detail

getRootElement

public org.eclipse.emf.ecore.EObject getRootElement()
Search the root element of the model.

Returns:
the element

getLocatedElement

public org.eclipse.emf.ecore.EObject getLocatedElement(int offset)
                                                throws org.eclipse.jface.text.BadLocationException
Search the nearest element of the given offset.

Parameters:
offset - the given offset
Returns:
the element
Throws:
org.eclipse.jface.text.BadLocationException

getLostType

public org.eclipse.emf.ecore.EObject getLostType(java.lang.String type)
Looks for a specific type in the anormal root types.

Parameters:
type - the name of the searched type
Returns:
the corresponding EMF object if present

getContext

public int getContext()

getContextName

public static java.lang.String getContextName(int id)
Returns the context name by id.

Parameters:
id - the given id
Returns:
the context name

Copyright 2007 IBM Corporation and others.
All Rights Reserved.