Class BuildLangModelUtility

java.lang.Object
net.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
de.uni_hildesheim.sse.BuildLangModelUtility
All Implemented Interfaces:
net.ssehub.easy.basics.modelManagement.IModelLoader<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>

public class BuildLangModelUtility extends net.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script> implements net.ssehub.easy.basics.modelManagement.IModelLoader<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
Provides language-wide functionality.
Author:
Holger Eichelberger
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.ssehub.easy.basics.modelManagement.IModelLoader

    net.ssehub.easy.basics.modelManagement.IModelLoader.IModelInfoHolder<M extends net.ssehub.easy.basics.modelManagement.IModel>, net.ssehub.easy.basics.modelManagement.IModelLoader.LoadResult<M extends net.ssehub.easy.basics.modelManagement.IModel>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Prevents external creation.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
    createBuildModel(ImplementationUnit root, URI uri, boolean registerSuccessful)
    Create the build language model from an EMF implementation unit.
    net.ssehub.easy.instantiation.core.model.expressions.Expression
    createExpression(String text, net.ssehub.easy.instantiation.core.model.buildlangModel.Resolver resolver, StringBuilder warnings)
    Parses text into an expression.
    net.ssehub.easy.instantiation.core.model.expressions.Expression
    createExpression(String text, net.ssehub.easy.instantiation.core.model.expressions.IRuntimeEnvironment environment)
     
     
    net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
    getInfo(URI uri)
     
    protected ClassLoader
     
    protected String
     
    protected void
    Initializes instances which depend on ModelUtility.resourceInitializer.
    List<net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>>
    obtainInfo(org.eclipse.emf.common.util.URI uri)
    Obtains model information.
    net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
    parse(org.eclipse.emf.common.util.URI uri, net.ssehub.easy.basics.modelManagement.ImportResolver<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> resolver)
     
    void
    print(net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> result, Writer out, boolean emitComments, boolean emitImports)
    Prints the model stored in the result to the console output stream (for debugging / testing).

    Methods inherited from class net.ssehub.easy.dslCore.ModelUtility

    append, appendWithNewLine, forceUnloadOnParse, getGrammar, getInfo, getInjector, getResourceInitializer, getResourceSet, handles, instances, load, obtainInfo, parse, parse, parse, parseFragment, scan, setInjector, setResourceInitializer, toNetUri, validate

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.ssehub.easy.basics.modelManagement.IModelLoader

    load, scan
  • Field Details

  • Constructor Details

    • BuildLangModelUtility

      private BuildLangModelUtility()
      Prevents external creation.
  • Method Details

    • createBuildModel

      public net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> createBuildModel(ImplementationUnit root, URI uri, boolean registerSuccessful)
      Create the build language model from an EMF implementation unit.
      Parameters:
      root - the root-level build unit
      uri - the URI of the project to resolve (in order to find the closest project, may be null)
      registerSuccessful - successfully created models shall be registered
      Returns:
      the created variability model including messages
    • initializeAfterResourceInitializer

      protected void initializeAfterResourceInitializer()
      Initializes instances which depend on ModelUtility.resourceInitializer.
      Specified by:
      initializeAfterResourceInitializer in class net.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
    • parse

      public net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> parse(org.eclipse.emf.common.util.URI uri, net.ssehub.easy.basics.modelManagement.ImportResolver<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> resolver) throws IOException
      Specified by:
      parse in class net.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
      Throws:
      IOException
    • print

      public void print(net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> result, Writer out, boolean emitComments, boolean emitImports)
      Prints the model stored in the result to the console output stream (for debugging / testing).
      Parameters:
      result - the result instance
      out - the output writer
      emitComments - whether comments shall be emitted
      emitImports - whether imports shall be emitted
    • getLanguageName

      protected String getLanguageName()
      Specified by:
      getLanguageName in class net.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
    • getLanguageClassLoader

      protected ClassLoader getLanguageClassLoader()
      Specified by:
      getLanguageClassLoader in class net.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
    • createExpression

      public net.ssehub.easy.instantiation.core.model.expressions.Expression createExpression(String text, net.ssehub.easy.instantiation.core.model.buildlangModel.Resolver resolver, StringBuilder warnings) throws net.ssehub.easy.instantiation.core.model.common.VilException
      Parses text into an expression.
      Parameters:
      text - the text to be parsed
      environment - the runtime environment for resolving variables
      an - optional buffer to collect warnings
      Returns:
      the resulting expression
      Throws:
      net.ssehub.easy.instantiation.core.model.common.VilException - in case that parsing fails
    • createExpression

      public net.ssehub.easy.instantiation.core.model.expressions.Expression createExpression(String text, net.ssehub.easy.instantiation.core.model.expressions.IRuntimeEnvironment environment) throws net.ssehub.easy.instantiation.core.model.common.VilException
      Throws:
      net.ssehub.easy.instantiation.core.model.common.VilException
    • getExtension

      public String getExtension()
      Specified by:
      getExtension in class net.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
    • obtainInfo

      public List<net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>> obtainInfo(org.eclipse.emf.common.util.URI uri) throws IOException
      Obtains model information.
      Specified by:
      obtainInfo in class net.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
      Parameters:
      uri - the URI to read the info from
      Returns:
      the project info instances related to uri
      Throws:
      IOException - in case that an I/O error happens during parsing
    • getInfo

      public net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> getInfo(URI uri)
      Specified by:
      getInfo in class net.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>