public class BuildLangModelUtility extends ModelUtility<de.uni_hildesheim.sse.vilBuildLanguage.ImplementationUnit,Script> implements IModelLoader<Script>
IModelLoader.IModelInfoHolder<M extends IModel>, IModelLoader.LoadResult<M extends IModel>| Modifier and Type | Field and Description |
|---|---|
static BuildLangModelUtility |
INSTANCE |
| Modifier | Constructor and Description |
|---|---|
private |
BuildLangModelUtility()
Prevents external creation.
|
| Modifier and Type | Method and Description |
|---|---|
TranslationResult<Script> |
createBuildModel(de.uni_hildesheim.sse.vilBuildLanguage.ImplementationUnit root,
java.net.URI uri,
boolean registerSuccessful)
Create the build language model from an EMF implementation unit.
|
Expression |
createExpression(java.lang.String text,
IRuntimeEnvironment environment) |
Expression |
createExpression(java.lang.String text,
Resolver resolver,
java.lang.StringBuilder warnings)
Parses
text into an expression. |
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<Script>> |
obtainInfo(org.eclipse.emf.common.util.URI uri)
Obtains model information.
|
TranslationResult<Script> |
parse(org.eclipse.emf.common.util.URI uri,
ImportResolver<Script> resolver)
Parse an IVML model file for standalone application (without editor) with a given import resolver.
|
void |
print(TranslationResult<Script> result,
java.io.Writer out,
boolean emitComments,
boolean emitImports)
Prints the model stored in the result to the console output stream
(for debugging / testing).
|
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 BuildLangModelUtility INSTANCE
private BuildLangModelUtility()
public TranslationResult<Script> createBuildModel(de.uni_hildesheim.sse.vilBuildLanguage.ImplementationUnit root, java.net.URI uri, boolean registerSuccessful)
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 registeredprotected void initializeAfterResourceInitializer()
ModelUtility.resourceInitializer.initializeAfterResourceInitializer in class ModelUtility<de.uni_hildesheim.sse.vilBuildLanguage.ImplementationUnit,Script>public TranslationResult<Script> parse(org.eclipse.emf.common.util.URI uri, ImportResolver<Script> 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.vilBuildLanguage.ImplementationUnit,Script>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 void print(TranslationResult<Script> 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 emittedprotected java.lang.String getLanguageName()
ModelUtilitygetLanguageName in class ModelUtility<de.uni_hildesheim.sse.vilBuildLanguage.ImplementationUnit,Script>protected java.lang.ClassLoader getLanguageClassLoader()
ModelUtilitygetLanguageClassLoader in class ModelUtility<de.uni_hildesheim.sse.vilBuildLanguage.ImplementationUnit,Script>public Expression createExpression(java.lang.String text, Resolver resolver, java.lang.StringBuilder warnings) throws VilException
text into an expression.text - the text to be parsedenvironment - the runtime environment for resolving variablesan - optional buffer to collect warningsVilException - in case that parsing failspublic Expression createExpression(java.lang.String text, IRuntimeEnvironment environment) throws VilException
VilExceptionpublic java.lang.String getExtension()
ModelUtilitygetExtension in class ModelUtility<de.uni_hildesheim.sse.vilBuildLanguage.ImplementationUnit,Script>public java.util.List<ModelInfo<Script>> obtainInfo(org.eclipse.emf.common.util.URI uri) throws java.io.IOException
obtainInfo in class ModelUtility<de.uni_hildesheim.sse.vilBuildLanguage.ImplementationUnit,Script>uri - the URI to read the info fromurijava.io.IOException - in case that an I/O error happens during parsingCopyright © 2009 - 2018 SSE. All Rights Reserved.