public class ModelUtility
extends net.ssehub.easy.dslCore.ModelUtility<VariabilityUnit,net.ssehub.easy.varModel.model.Project>
implements net.ssehub.easy.basics.modelManagement.IModelLoader<net.ssehub.easy.varModel.model.Project>
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>| Modifier and Type | Field and Description |
|---|---|
static ModelUtility |
INSTANCE |
| Modifier | Constructor and Description |
|---|---|
private |
ModelUtility()
Prevents external creation.
|
| Modifier and Type | Method and Description |
|---|---|
net.ssehub.easy.varModel.model.Constraint |
createConstraint(java.lang.String text,
net.ssehub.easy.varModel.model.Project project,
boolean asStatement)
Parses a text into a constraint in the context of
project. |
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
createExpression(java.lang.String text,
net.ssehub.easy.varModel.model.IModelElement parent)
Parses a text into an expression in the context of
project. |
net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.varModel.model.Project> |
createVarModel(VariabilityUnit root,
java.net.URI uri,
boolean registerSuccessful)
Create the variability model from an EMF variability unit.
|
java.lang.String |
getExtension() |
protected java.lang.ClassLoader |
getLanguageClassLoader() |
protected java.lang.String |
getLanguageName() |
protected void |
initializeAfterResourceInitializer() |
java.util.List<net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.varModel.model.Project>> |
obtainInfo(org.eclipse.emf.common.util.URI uri)
Obtains project info.
|
net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.varModel.model.Project> |
parse(org.eclipse.emf.common.util.URI uri,
net.ssehub.easy.basics.modelManagement.ImportResolver<net.ssehub.easy.varModel.model.Project> resolver) |
void |
print(net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.varModel.model.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(DerivedType type,
boolean forSearch)
Returns the string representation of
type. |
static java.lang.String |
stringValue(Type type)
Returns the string representation of
type (no search). |
static java.lang.String |
stringValue(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, toNetUripublic static final ModelUtility INSTANCE
protected void initializeAfterResourceInitializer()
initializeAfterResourceInitializer in class net.ssehub.easy.dslCore.ModelUtility<VariabilityUnit,net.ssehub.easy.varModel.model.Project>protected java.lang.String getLanguageName()
getLanguageName in class net.ssehub.easy.dslCore.ModelUtility<VariabilityUnit,net.ssehub.easy.varModel.model.Project>protected java.lang.ClassLoader getLanguageClassLoader()
getLanguageClassLoader in class net.ssehub.easy.dslCore.ModelUtility<VariabilityUnit,net.ssehub.easy.varModel.model.Project>public net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.varModel.model.Project> createVarModel(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(net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.varModel.model.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 net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.varModel.model.Project> parse(org.eclipse.emf.common.util.URI uri,
net.ssehub.easy.basics.modelManagement.ImportResolver<net.ssehub.easy.varModel.model.Project> resolver)
throws java.io.IOException
parse in class net.ssehub.easy.dslCore.ModelUtility<VariabilityUnit,net.ssehub.easy.varModel.model.Project>java.io.IOExceptionpublic java.util.List<net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.varModel.model.Project>> obtainInfo(org.eclipse.emf.common.util.URI uri)
throws java.io.IOException
obtainInfo in class net.ssehub.easy.dslCore.ModelUtility<VariabilityUnit,net.ssehub.easy.varModel.model.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(Type type)
type (no search).type - the type to be converted into a stringpublic static final java.lang.String stringValue(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(DerivedType type,
boolean forSearch)
type.type - the type to be converted into a stringforSearch - is the result intended for type searchingpublic net.ssehub.easy.varModel.model.Constraint createConstraint(java.lang.String text,
net.ssehub.easy.varModel.model.Project project,
boolean asStatement)
throws net.ssehub.easy.varModel.cst.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 expressionnet.ssehub.easy.varModel.cst.CSTSemanticException - in case of semantic problems in textConstraintSyntaxException - in case of syntax problems in textpublic net.ssehub.easy.varModel.cst.ConstraintSyntaxTree createExpression(java.lang.String text,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.varModel.cst.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 nestingnet.ssehub.easy.varModel.cst.CSTSemanticException - in case of semantic problems in textConstraintSyntaxException - in case of syntax problems in textpublic java.lang.String getExtension()
getExtension in class net.ssehub.easy.dslCore.ModelUtility<VariabilityUnit,net.ssehub.easy.varModel.model.Project>Copyright © 2009 - 2018 SSE. All Rights Reserved.