org.eclipse.m2m.atl.adt.ui.text.atl.types
Class AtlTypesProcessor

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

public class AtlTypesProcessor
extends java.lang.Object

The ATL Type processor.


Constructor Summary
AtlTypesProcessor()
           
 
Method Summary
static java.lang.String cutString(java.lang.String s)
           
static java.lang.Object eGet(org.eclipse.emf.ecore.EObject self, java.lang.String featureName)
          Returns the value of a feature on an EObject.
 java.lang.Object getDeclaration(org.eclipse.emf.ecore.EObject element)
          Returns the type of the given element.
static Feature getFeature(OclAnyType context, UnitType module, java.lang.String featureName)
          Returns the feature associated to the given context, with the given name.
 java.lang.String getInformation(org.eclipse.emf.ecore.EObject locatedElement)
          Returns a description of the given element.
static Operation getOperation(OclAnyType context, UnitType module, java.lang.String operationName, OclAnyType... parameters)
          Returns the operation associated to the given context, with the given name.
 java.lang.String getTemplateInformation(java.lang.String elementName, org.eclipse.emf.ecore.EObject element)
           
 OclAnyType getType(org.eclipse.emf.ecore.EObject element)
          Returns the type of the given element.
 UnitType getUnit()
           
 java.util.Map<java.lang.String,OclAnyType> getVariables(org.eclipse.emf.ecore.EObject element)
          Returns the variables available at the given element level.
static boolean oclIsKindOf(org.eclipse.emf.ecore.EObject element, java.lang.String testedElementName)
          Equivalent of ASMOclAny oclIsKindOf method for EObjects.
 void update(org.eclipse.core.resources.IFile file, AtlModelAnalyser analyser, AtlSourceManager manager)
          Updates the type processor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtlTypesProcessor

public AtlTypesProcessor()
Method Detail

update

public void update(org.eclipse.core.resources.IFile file,
                   AtlModelAnalyser analyser,
                   AtlSourceManager manager)
Updates the type processor.

Parameters:
file - the file containing the current unit
analyser - the current model analyser (local code analysis)
manager - the current source manager (entire code file repository)

getType

public OclAnyType getType(org.eclipse.emf.ecore.EObject element)
                   throws org.eclipse.jface.text.BadLocationException
Returns the type of the given element.

Parameters:
element - the element to analyze
Returns:
Returns the type of the given element.
Throws:
org.eclipse.jface.text.BadLocationException

getInformation

public java.lang.String getInformation(org.eclipse.emf.ecore.EObject locatedElement)
                                throws org.eclipse.jface.text.BadLocationException
Returns a description of the given element.

Parameters:
locatedElement - the element
Returns:
the description
Throws:
org.eclipse.jface.text.BadLocationException

getTemplateInformation

public java.lang.String getTemplateInformation(java.lang.String elementName,
                                               org.eclipse.emf.ecore.EObject element)
                                        throws org.eclipse.jface.text.BadLocationException
Throws:
org.eclipse.jface.text.BadLocationException

cutString

public static java.lang.String cutString(java.lang.String s)

getDeclaration

public java.lang.Object getDeclaration(org.eclipse.emf.ecore.EObject element)
                                throws org.eclipse.jface.text.BadLocationException
Returns the type of the given element.

Parameters:
element - the element to analyze
Returns:
Returns the type of the given element.
Throws:
org.eclipse.jface.text.BadLocationException

getVariables

public java.util.Map<java.lang.String,OclAnyType> getVariables(org.eclipse.emf.ecore.EObject element)
                                                        throws org.eclipse.jface.text.BadLocationException
Returns the variables available at the given element level.

Parameters:
element - the located element
Returns:
the variables map
Throws:
org.eclipse.jface.text.BadLocationException

getUnit

public UnitType getUnit()

oclIsKindOf

public static boolean oclIsKindOf(org.eclipse.emf.ecore.EObject element,
                                  java.lang.String testedElementName)
Equivalent of ASMOclAny oclIsKindOf method for EObjects.

Parameters:
element - the tested element
testedElementName - the type name
Returns:
True element has testedElementName in its superTypes, False else.

eGet

public static java.lang.Object eGet(org.eclipse.emf.ecore.EObject self,
                                    java.lang.String featureName)
Returns the value of a feature on an EObject.

Parameters:
self - the EObject
featureName - the feature name
Returns:
the feature value

getFeature

public static Feature getFeature(OclAnyType context,
                                 UnitType module,
                                 java.lang.String featureName)
Returns the feature associated to the given context, with the given name.

Parameters:
context - the context type
module - the current module
featureName - the feature name
Returns:
the feature

getOperation

public static Operation getOperation(OclAnyType context,
                                     UnitType module,
                                     java.lang.String operationName,
                                     OclAnyType... parameters)
Returns the operation associated to the given context, with the given name.

Parameters:
context - the context type
module - the current module
operationName - the operation name
parameters - the operation parameters
Returns:
the feature

Copyright 2007 IBM Corporation and others.
All Rights Reserved.