Class ModelUtils
- java.lang.Object
-
- net.ssehub.easy.dslCore.ui.hyperlinking.ModelUtils
-
public class ModelUtils extends java.lang.ObjectSome utilities on model side.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceModelUtils.IModelFinder<M extends IModel,E>A model finder for a certain model.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Comparator<VersionedModelInfos<?>>DESC_VERSION_COMPARATOR
-
Constructor Summary
Constructors Constructor Description ModelUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static <M extends IModel,E>
EfindElement(M model, java.lang.String selectedElement, ModelUtils.IModelFinder<M,E> finder, java.util.Set<M> done)Recursively finds an element also in the imports if not found inmodel.static <M extends IModel,E>
EgetModelElement(java.lang.String selectedElement, java.lang.String selectedElementsProjectName, ModelManagement<M> mgt, ModelUtils.IModelFinder<M,E> finder)Tries to find a model element declaration for a given element name and a given project/model name.
-
-
-
Field Detail
-
DESC_VERSION_COMPARATOR
private static final java.util.Comparator<VersionedModelInfos<?>> DESC_VERSION_COMPARATOR
-
-
Method Detail
-
getModelElement
public static <M extends IModel,E> E getModelElement(java.lang.String selectedElement, java.lang.String selectedElementsProjectName, ModelManagement<M> mgt, ModelUtils.IModelFinder<M,E> finder)
Tries to find a model element declaration for a given element name and a given project/model name. Handles imports.- Type Parameters:
E- the model element typeM- the model type- Parameters:
selectedElement- the element nameselectedElementsProjectName- the project/model namemgt- the model management instancefinder- the element finder- Returns:
- the declaration or null
-
findElement
private static <M extends IModel,E> E findElement(M model, java.lang.String selectedElement, ModelUtils.IModelFinder<M,E> finder, java.util.Set<M> done)
Recursively finds an element also in the imports if not found inmodel.- Type Parameters:
E- the model element typeM- the model type- Parameters:
model- the model to search withinselectedElement- the element namefinder- the element finderdone- already visited models for avoiding loops- Returns:
- the found element or null
-
-