Class ModelUtility

    • Constructor Detail

      • ModelUtility

        private ModelUtility()
        Prevents external creation.
    • Method Detail

      • getLanguageName

        protected java.lang.String getLanguageName()
        Description copied from class: ModelUtility
        Returns the language name as specified in the xText configuration. This name can be found as URL in the grammar file or corresponds to the Java path of the grammar-XMI file in src-gen.
        Specified by:
        getLanguageName in class ModelUtility<de.uni_hildesheim.sse.ivml.VariabilityUnit,​Project>
        Returns:
        the language name in Java package notation
      • getLanguageClassLoader

        protected java.lang.ClassLoader getLanguageClassLoader()
        Description copied from class: ModelUtility
        Returns the actual class loader of the language. This loader may be different due to different bundles.
        Specified by:
        getLanguageClassLoader in class ModelUtility<de.uni_hildesheim.sse.ivml.VariabilityUnit,​Project>
        Returns:
        the class loader
      • createVarModel

        public TranslationResult<Project> createVarModel​(de.uni_hildesheim.sse.ivml.VariabilityUnit root,
                                                         java.net.URI uri,
                                                         boolean registerSuccessful)
        Create the variability model from an EMF variability unit.
        Parameters:
        root - the root-level variability 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
      • print

        public void print​(TranslationResult<Project> result,
                          java.io.Writer out,
                          boolean emitComments,
                          boolean emitImports)
        Prints the var model stored in the result to the console output stream (for debugging).
        Parameters:
        result - the result instance
        out - the output writer
        emitComments - whether comments shall be emitted
        emitImports - whether imports shall be emitted
      • parse

        public TranslationResult<Project> parse​(org.eclipse.emf.common.util.URI uri,
                                                ImportResolver<Project> resolver)
                                         throws java.io.IOException
        Description copied from class: ModelUtility
        Parse an IVML model file for standalone application (without editor) with a given import resolver.
        Note: This method is called by de.uni_hildesheim.sse.model.management.VarModel so if you intend to use the management facilities in de.uni_hildesheim.sse.model.management.VarModel let the de.uni_hildesheim.sse.model.management.VarModel do this job for you and do not call this method directly!
        Specified by:
        parse in class ModelUtility<de.uni_hildesheim.sse.ivml.VariabilityUnit,​Project>
        Parameters:
        uri - the location of the model, e.g. via URI.createURI("dummy:/example.ex1")
        resolver - the import resolver (may be null for a new default import resolver)
        Returns:
        the created variability model including messages
        Throws:
        java.io.IOException - in case of any I/O or URI problem
      • obtainInfo

        public java.util.List<ModelInfo<Project>> obtainInfo​(org.eclipse.emf.common.util.URI uri)
                                                      throws java.io.IOException
        Obtains project info.
        Specified by:
        obtainInfo in class ModelUtility<de.uni_hildesheim.sse.ivml.VariabilityUnit,​Project>
        Parameters:
        uri - the URI to read the info from
        Returns:
        the project info instances related to uri
        Throws:
        java.io.IOException - in case that an I/O error happens during parsing
      • stringValue

        public static final java.lang.String stringValue​(de.uni_hildesheim.sse.ivml.Type type)
        Returns the string representation of type (no search).
        Parameters:
        type - the type to be converted into a string
        Returns:
        the type representation
      • stringValue

        public static final java.lang.String stringValue​(de.uni_hildesheim.sse.ivml.Type type,
                                                         boolean forSearch)
        Returns the string representation of type.
        Parameters:
        type - the type to be converted into a string
        forSearch - is the result intended for type searching
        Returns:
        the type representation
      • stringValue

        public static final java.lang.String stringValue​(de.uni_hildesheim.sse.ivml.DerivedType type,
                                                         boolean forSearch)
        Returns the string representation of type.
        Parameters:
        type - the type to be converted into a string
        forSearch - is the result intended for type searching
        Returns:
        the type representation
      • createConstraint

        public Constraint createConstraint​(java.lang.String text,
                                           Project project,
                                           boolean asStatement)
                                    throws CSTSemanticException,
                                           ConstraintSyntaxException
        Parses a text into a constraint in the context of project. Project is not modified!
        Parameters:
        text - the text to be parsed containing the constraint
        project - the project
        asStatement - true then parse text as a statement, else as an expression
        Returns:
        the constraint, null in case of internal instantiation errors
        Throws:
        CSTSemanticException - in case of semantic problems in text
        ConstraintSyntaxException - in case of syntax problems in text
      • getExtension

        public java.lang.String getExtension()
        Description copied from class: ModelUtility
        Returns the file extension / identifier to react on.
        Specified by:
        getExtension in class ModelUtility<de.uni_hildesheim.sse.ivml.VariabilityUnit,​Project>
        Returns:
        the extension