Class TemplateLangModelUtility
java.lang.Object
net.ssehub.easy.dslCore.ModelUtility<LanguageUnit,net.ssehub.easy.instantiation.core.model.templateModel.Template>
de.uni_hildesheim.sse.vil.templatelang.TemplateLangModelUtility
- All Implemented Interfaces:
net.ssehub.easy.basics.modelManagement.IModelLoader<net.ssehub.easy.instantiation.core.model.templateModel.Template>
public class TemplateLangModelUtility
extends net.ssehub.easy.dslCore.ModelUtility<LanguageUnit,net.ssehub.easy.instantiation.core.model.templateModel.Template>
implements net.ssehub.easy.basics.modelManagement.IModelLoader<net.ssehub.easy.instantiation.core.model.templateModel.Template>
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.ssehub.easy.instantiation.core.model.expressions.ExpressioncreateExpression(String text, net.ssehub.easy.instantiation.core.model.expressions.IRuntimeEnvironment environment) net.ssehub.easy.instantiation.core.model.expressions.ExpressioncreateExpression(String text, net.ssehub.easy.instantiation.core.model.templateModel.Resolver resolver, StringBuilder warnings) Parsestextinto an expression.net.ssehub.easy.instantiation.core.model.expressions.ExpressioncreateExpression(String text, net.ssehub.easy.instantiation.core.model.templateModel.Resolver resolver, StringBuilder warnings, de.uni_hildesheim.sse.vil.expressions.translation.IvmlMessageAdapter adapter) Parsestextinto an expression.net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.templateModel.Template> createModel(LanguageUnit root, URI uri, boolean registerSuccessful) Create the build language model from an EMF implementation unit.net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.instantiation.core.model.templateModel.Template> protected ClassLoaderprotected Stringprotected voidInitializes instances which depend onModelUtility.resourceInitializer.List<net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.instantiation.core.model.templateModel.Template>> obtainInfo(org.eclipse.emf.common.util.URI uri) Obtains model information.net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.templateModel.Template> parse(org.eclipse.emf.common.util.URI uri, net.ssehub.easy.basics.modelManagement.ImportResolver<net.ssehub.easy.instantiation.core.model.templateModel.Template> resolver) voidprint(net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.templateModel.Template> 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, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.ssehub.easy.basics.modelManagement.IModelLoader
load, scan
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
TemplateLangModelUtility
private TemplateLangModelUtility()Prevents external creation.
-
-
Method Details
-
initializeAfterResourceInitializer
protected void initializeAfterResourceInitializer()Initializes instances which depend onModelUtility.resourceInitializer.- Specified by:
initializeAfterResourceInitializerin classnet.ssehub.easy.dslCore.ModelUtility<LanguageUnit,net.ssehub.easy.instantiation.core.model.templateModel.Template>
-
createModel
public net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.templateModel.Template> createModel(LanguageUnit root, URI uri, boolean registerSuccessful) Create the build language model from an EMF implementation unit.- Parameters:
root- the root-level build unituri- 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
-
parse
public net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.templateModel.Template> parse(org.eclipse.emf.common.util.URI uri, net.ssehub.easy.basics.modelManagement.ImportResolver<net.ssehub.easy.instantiation.core.model.templateModel.Template> resolver) throws IOException - Specified by:
parsein classnet.ssehub.easy.dslCore.ModelUtility<LanguageUnit,net.ssehub.easy.instantiation.core.model.templateModel.Template> - Throws:
IOException
-
print
public void print(net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.templateModel.Template> 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 instanceout- the output writeremitComments- whether comments shall be emittedemitImports- whether imports shall be emitted
-
getLanguageName
- Specified by:
getLanguageNamein classnet.ssehub.easy.dslCore.ModelUtility<LanguageUnit,net.ssehub.easy.instantiation.core.model.templateModel.Template>
-
getLanguageClassLoader
- Specified by:
getLanguageClassLoaderin classnet.ssehub.easy.dslCore.ModelUtility<LanguageUnit,net.ssehub.easy.instantiation.core.model.templateModel.Template>
-
createExpression
public net.ssehub.easy.instantiation.core.model.expressions.Expression createExpression(String text, net.ssehub.easy.instantiation.core.model.templateModel.Resolver resolver, StringBuilder warnings) throws net.ssehub.easy.instantiation.core.model.common.VilException Parsestextinto an expression.- Parameters:
text- the text to be parsedenvironment- the runtime environment for resolving variablesan- 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.templateModel.Resolver resolver, StringBuilder warnings, de.uni_hildesheim.sse.vil.expressions.translation.IvmlMessageAdapter adapter) throws net.ssehub.easy.instantiation.core.model.common.VilException Parsestextinto an expression.- Parameters:
text- the text to be parsedadapter- optional message adapter (may be null for default)environment- the runtime environment for resolving variablesan- 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
- Specified by:
getExtensionin classnet.ssehub.easy.dslCore.ModelUtility<LanguageUnit,net.ssehub.easy.instantiation.core.model.templateModel.Template>
-
obtainInfo
public List<net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.instantiation.core.model.templateModel.Template>> obtainInfo(org.eclipse.emf.common.util.URI uri) throws IOException Obtains model information.- Specified by:
obtainInfoin classnet.ssehub.easy.dslCore.ModelUtility<LanguageUnit,net.ssehub.easy.instantiation.core.model.templateModel.Template> - 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.templateModel.Template> getInfo(URI uri) - Specified by:
getInfoin classnet.ssehub.easy.dslCore.ModelUtility<LanguageUnit,net.ssehub.easy.instantiation.core.model.templateModel.Template>
-