Class ImportTranslator


  • public class ImportTranslator
    extends java.lang.Object
    A class which specifically does the import translations. The methods are available for reuse.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • ImportTranslator

        public ImportTranslator()
    • Method Detail

      • processRestrictionExpression

        private static IVersionRestriction processRestrictionExpression​(java.lang.String name,
                                                                        de.uni_hildesheim.sse.ivml.Expression expr,
                                                                        ExpressionTranslator translator,
                                                                        TypeContext context,
                                                                        IMessageHandler handler)
                                                                 throws TranslatorException,
                                                                        RestrictionEvaluationException
        Turns an ECore expression into a version restriction.
        Parameters:
        name - the name of the element being processed
        expr - the expression to be turned into a version restriction (may be null but then the result will also be null).
        translator - the expression translator (may be null but then the result will also be null)
        context - the current type context (may be null but then the result will also be null)
        handler - an optional message handler (may be null)
        Returns:
        the related version restriction (may be null)
        Throws:
        TranslatorException - in case of translation problems
        RestrictionEvaluationException - in case of problems while creating the restriction
      • processConflict

        public static ProjectImport processConflict​(de.uni_hildesheim.sse.ivml.ConflictStmt conflictStmt)
                                             throws TranslatorException
        Processes a conflict statement including import restrictions. In case of errors the respective element is not added to the resulting project. Anyway, no restriction expressions are produced!
        Parameters:
        conflictStmt - the conflict statement
        Returns:
        the related IVML model instance
        Throws:
        TranslatorException - in case of semantic errors
      • processConflict

        public static ProjectImport processConflict​(de.uni_hildesheim.sse.ivml.ConflictStmt conflictStmt,
                                                    ExpressionTranslator translator,
                                                    TypeContext context)
                                             throws TranslatorException
        Processes a conflict statement including import restrictions. In case of errors the respective element is not added to the resulting project.
        Parameters:
        conflictStmt - the conflict statement
        translator - the expression translator (may be null but then no restriction expressions are produced)
        context - the current type context (may be null but then no restriction expressions are produced)
        Returns:
        the related IVML model instance
        Throws:
        TranslatorException - in case of semantic errors
      • processImport

        public static ProjectImport processImport​(de.uni_hildesheim.sse.ivml.ImportStmt importStmt)
                                           throws TranslatorException
        Processes an import statement including import restrictions. In case of errors the respective element is not added to the resulting project. Anyway, no restriction expressions are produced!
        Parameters:
        importStmt - the import statement
        Returns:
        the related IVML model instance
        Throws:
        TranslatorException - in case of semantic errors
      • processImport

        public static ProjectImport processImport​(de.uni_hildesheim.sse.ivml.ImportStmt importStmt,
                                                  ExpressionTranslator translator,
                                                  TypeContext context)
                                           throws TranslatorException
        Processes an import statement including import restrictions. In case of errors the respective element is not added to the resulting project.
        Parameters:
        importStmt - the import statement
        translator - the expression translator (may be null but then no restriction expressions are produced)
        context - the current type context (may be null but then no restriction expressions are produced)
        Returns:
        the related IVML model instance
        Throws:
        TranslatorException - in case of semantic errors