Class ModelTranslator.Result
- java.lang.Object
-
- de.uni_hildesheim.sse.translation.ModelTranslator.Result
-
- All Implemented Interfaces:
IDeferredModelLoader<Project>
- Enclosing class:
- ModelTranslator
public static class ModelTranslator.Result extends java.lang.Object implements IDeferredModelLoader<Project>
Implements a translation result enabling deferred model loading. As long as#completeLoading()is not called, the model instances stored in this instance are not ready for use.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ResultEntry>entriesprivate java.lang.Stringidprivate ModelTranslatortranslator
-
Constructor Summary
Constructors Modifier Constructor Description privateResult(ModelTranslator translator, java.net.URI uri)Creates a result instance representing the parse result for multiple projects and enables deferred loading.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidadd(ResultEntry entry)Adds a partially completed xText project and an IVML project in terms of anentry.voidcompleteLoading(IDeferredModelLoader<Project> msgTarget)Completes loading in a deferred manner.TranslationResult<Project>createTranslationResult()Creates the translation result.java.lang.StringgetModelId()Returns an ID of the model, e.g., its URI or its name.(package private) ModelTranslatorgetTranslator()Returns the translator instance.
-
-
-
Field Detail
-
entries
private java.util.List<ResultEntry> entries
-
translator
private ModelTranslator translator
-
id
private java.lang.String id
-
-
Constructor Detail
-
Result
private Result(ModelTranslator translator, java.net.URI uri)
Creates a result instance representing the parse result for multiple projects and enables deferred loading.- Parameters:
translator- the model translator instanceuri- the model URI to be used as ID
-
-
Method Detail
-
add
private void add(ResultEntry entry)
Adds a partially completed xText project and an IVML project in terms of anentry.- Parameters:
entry- the entry to be added
-
completeLoading
public void completeLoading(IDeferredModelLoader<Project> msgTarget)
Description copied from interface:IDeferredModelLoaderCompletes loading in a deferred manner.- Specified by:
completeLoadingin interfaceIDeferredModelLoader<Project>- Parameters:
msgTarget- cleanup target
-
createTranslationResult
public TranslationResult<Project> createTranslationResult()
Creates the translation result.- Returns:
- the translation result
-
getTranslator
ModelTranslator getTranslator()
Returns the translator instance.- Returns:
- the translator instance
-
getModelId
public java.lang.String getModelId()
Description copied from interface:IDeferredModelLoaderReturns an ID of the model, e.g., its URI or its name. Used to identify this loader among multiple trials of loading the same model.- Specified by:
getModelIdin interfaceIDeferredModelLoader<Project>- Returns:
- the ID
-
-