public class ModelUtility extends ModelUtility<de.uni_hildesheim.sse.ivml.VariabilityUnit,Project> implements IModelLoader<Project>
IModelLoader.IModelInfoHolder<M extends IModel>, IModelLoader.LoadResult<M extends IModel>| Modifier and Type | Field and Description |
|---|---|
static ModelUtility |
INSTANCE |
| Modifier | Constructor and Description |
|---|---|
private |
ModelUtility()
Prevents external creation.
|
| Modifier and Type | Method and Description |
|---|---|
Constraint |
createConstraint(java.lang.String text,
Project project,
boolean asStatement)
Parses a text into a constraint in the context of
project. |
ConstraintSyntaxTree |
createExpression(java.lang.String text,
IModelElement parent)
Parses a text into an expression in the context of
project. |
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.
|
java.lang.String |
getExtension()
Returns the file extension / identifier to react on.
|
protected java.lang.ClassLoader |
getLanguageClassLoader()
Returns the actual class loader of the language.
|
protected java.lang.String |
getLanguageName()
Returns the language name as specified in the xText configuration.
|
protected void |
initializeAfterResourceInitializer()
Initializes instances which depend on
ModelUtility.resourceInitializer. |
java.util.List<ModelInfo<Project>> |
obtainInfo(org.eclipse.emf.common.util.URI uri)
Obtains project info.
|
TranslationResult<Project> |
parse(org.eclipse.emf.common.util.URI uri,
ImportResolver<Project> resolver)
Parse an IVML model file for standalone application (without editor) with a given import resolver.
|
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).
|
static java.lang.String |
stringValue(de.uni_hildesheim.sse.ivml.DerivedType type,
boolean forSearch)
Returns the string representation of
type. |
static java.lang.String |
stringValue(de.uni_hildesheim.sse.ivml.Type type)
Returns the string representation of
type (no search). |
static java.lang.String |
stringValue(de.uni_hildesheim.sse.ivml.Type type,
boolean forSearch)
Returns the string representation of
type. |
append, appendWithNewLine, getGrammar, getInjector, getResourceInitializer, getResourceSet, handles, load, obtainInfo, parse, parse, parse, parseFragment, scan, setInjector, setResourceInitializer, toNetUriclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitload, scanpublic static final ModelUtility INSTANCE
protected void initializeAfterResourceInitializer()
ModelUtilityModelUtility.resourceInitializer.initializeAfterResourceInitializer in class ModelUtility<de.uni_hildesheim.sse.ivml.VariabilityUnit,Project>protected java.lang.String getLanguageName()
ModelUtilitygetLanguageName in class ModelUtility<de.uni_hildesheim.sse.ivml.VariabilityUnit,Project>protected java.lang.ClassLoader getLanguageClassLoader()
ModelUtilitygetLanguageClassLoader in class ModelUtility<de.uni_hildesheim.sse.ivml.VariabilityUnit,Project>public TranslationResult<Project> createVarModel(de.uni_hildesheim.sse.ivml.VariabilityUnit root, java.net.URI uri, boolean registerSuccessful)
root - the root-level variability unituri - the URI of the project to resolve (in order to find the
closest project, may be null)registerSuccessful - successfully created models shall be registeredpublic void print(TranslationResult<Project> result, java.io.Writer out, boolean emitComments, boolean emitImports)
result - the result instanceout - the output writeremitComments - whether comments shall be emittedemitImports - whether imports shall be emittedpublic TranslationResult<Project> parse(org.eclipse.emf.common.util.URI uri, ImportResolver<Project> resolver) throws java.io.IOException
ModelUtilityde.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!parse in class ModelUtility<de.uni_hildesheim.sse.ivml.VariabilityUnit,Project>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)java.io.IOException - in case of any I/O or URI problempublic java.util.List<ModelInfo<Project>> obtainInfo(org.eclipse.emf.common.util.URI uri) throws java.io.IOException
obtainInfo in class ModelUtility<de.uni_hildesheim.sse.ivml.VariabilityUnit,Project>uri - the URI to read the info fromurijava.io.IOException - in case that an I/O error happens during parsingpublic static final java.lang.String stringValue(de.uni_hildesheim.sse.ivml.Type type)
type (no search).type - the type to be converted into a stringpublic static final java.lang.String stringValue(de.uni_hildesheim.sse.ivml.Type type,
boolean forSearch)
type.type - the type to be converted into a stringforSearch - is the result intended for type searchingpublic static final java.lang.String stringValue(de.uni_hildesheim.sse.ivml.DerivedType type,
boolean forSearch)
type.type - the type to be converted into a stringforSearch - is the result intended for type searchingpublic Constraint createConstraint(java.lang.String text, Project project, boolean asStatement) throws CSTSemanticException, ConstraintSyntaxException
project. Project is not modified!text - the text to be parsed containing the constraintproject - the projectasStatement - true then parse text as a statement, else as an expressionCSTSemanticException - in case of semantic problems in textConstraintSyntaxException - in case of syntax problems in textpublic ConstraintSyntaxTree createExpression(java.lang.String text, IModelElement parent) throws CSTSemanticException, ConstraintSyntaxException
project. Project is not modified!text - the text to be parsed containing the constraintparent - the intended parent model element (turned into Compound or Project
depending on nestingCSTSemanticException - in case of semantic problems in textConstraintSyntaxException - in case of syntax problems in textpublic java.lang.String getExtension()
ModelUtilitygetExtension in class ModelUtility<de.uni_hildesheim.sse.ivml.VariabilityUnit,Project>Copyright © 2009 - 2018 SSE. All Rights Reserved.