public final class ModelUtil extends Object
Constructor and Description |
---|
ModelUtil() |
Modifier and Type | Method and Description |
---|---|
static Collection<ModelElementType> |
calculateAllBaseTypes(ModelElementType type)
Calculate a collection of all base types for the given type
|
static Collection<ModelElementType> |
calculateAllExtendingTypes(Model model,
Collection<ModelElementType> baseTypes)
Calculate a collection of all extending types for the given base types
|
static void |
ensureInstanceOf(Object instance,
Class<?> type) |
static int |
getIndexOfElementType(ModelElementInstance modelElement,
List<ModelElementType> childElementTypes)
Find the index of the type of a model element in a list of element types
|
static ModelElementInstance |
getModelElement(DomElement domElement,
ModelInstanceImpl modelInstance)
Returns the
ModelElement for a DOM element. |
static <T extends ModelElementInstance> |
getModelElementCollection(Collection<DomElement> view,
ModelInstanceImpl model)
Get a collection of all model element instances in a view
|
static QName |
getQName(String namespaceUri,
String localName) |
static String |
getUniqueIdentifier(ModelElementType type) |
static boolean |
valueAsBoolean(String rawValue) |
static double |
valueAsDouble(String rawValue) |
static float |
valueAsFloat(String rawValue) |
static int |
valueAsInteger(String rawValue) |
static short |
valueAsShort(String rawValue) |
static String |
valueAsString(boolean booleanValue) |
static String |
valueAsString(double doubleValue) |
static String |
valueAsString(float floatValue) |
static String |
valueAsString(int integerValue) |
static String |
valueAsString(short shortValue) |
public static ModelElementInstance getModelElement(DomElement domElement, ModelInstanceImpl modelInstance)
ModelElement
for a DOM element.
If the model element does not yet exist, it is created and linked to the DOM.domElement
- the child element to create a new ModelElement
forpublic static boolean valueAsBoolean(String rawValue)
public static int valueAsInteger(String rawValue)
public static float valueAsFloat(String rawValue)
public static double valueAsDouble(String rawValue)
public static short valueAsShort(String rawValue)
public static String valueAsString(boolean booleanValue)
public static String valueAsString(int integerValue)
public static String valueAsString(float floatValue)
public static String valueAsString(double doubleValue)
public static String valueAsString(short shortValue)
public static <T extends ModelElementInstance> Collection<T> getModelElementCollection(Collection<DomElement> view, ModelInstanceImpl model)
view
- the collection of DOM elements to find the model element instances formodel
- the model of the elementspublic static int getIndexOfElementType(ModelElementInstance modelElement, List<ModelElementType> childElementTypes)
modelElement
- the model element which type is searched forchildElementTypes
- the list to search the typepublic static Collection<ModelElementType> calculateAllExtendingTypes(Model model, Collection<ModelElementType> baseTypes)
baseTypes
- the collection of types to calculate the union of all extending typespublic static Collection<ModelElementType> calculateAllBaseTypes(ModelElementType type)
public static String getUniqueIdentifier(ModelElementType type)
Copyright © 2015. All rights reserved.