| java.lang.Object org.andromda.metafacades.uml.MetafacadeUtils
MetafacadeUtils | public class MetafacadeUtils (Code) | | A class containing utlities for metafacade manipulation.
author: Chad Brandon author: Wouter Zoons |
filterByNotType | public static void filterByNotType(Collection modelElements, Class type)(Code) | | Filters out the model elements from the modelElements collection that are of (or inherit from) the
specified type type
Parameters: modelElements - the model elements to filter. Parameters: type - the type of Class. |
filterByStereotype | public static void filterByStereotype(Collection modelElements, String stereotype)(Code) | | Filters out the model elements from the modelElements collection that don't have the specified
stereotype
Parameters: modelElements - the model elements to filter. Parameters: stereotype - the stereotype that a model element must have in order to stay remain within themodelElements collection. |
filterByType | public static void filterByType(Collection modelElements, Class type)(Code) | | Filters out the model elements from the modelElements collection that are not of (or do not inherit
from) the specified type type
Parameters: modelElements - the model elements to filter. Parameters: type - the type of Class. |
getElementAsType | public static Object getElementAsType(Object element, Class type)(Code) | | Checks to see if the element is the specified type and if so casts it to the object and returns it, otherwise it
returns null.
Parameters: element - the element to check. Parameters: type - the Class type. the element has the given type or null. |
sortByFullyQualifiedName | public static void sortByFullyQualifiedName(List metafacades)(Code) | | Sorts given metafacades by their fully qualified name.
Parameters: metafacades - the collection of model elements to sort. the sorted collection. |
toRelationName | public static String toRelationName(String roleName, String targetRoleName, String separator)(Code) | | Returns a consistent name for a relation, independent from the end of the relation one is looking at.
In order to guarantee consistency with relation names, they must appear the same whichever angle (ie entity)
that you come from. For example, if you are at Customer end of a relationship to an Address then your relation
may appear with the name Customer-Address. But if you are in the Address entity looking at the Customer then you
will get an error because the relation will be called Address-Customer. A simple way to guarantee that both ends
of the relationship have the same name is merely to use alphabetical ordering.
Parameters: roleName - name of role in relation Parameters: targetRoleName - name of target role in relation Parameters: separator - character used to separate words uniform mapping name (in alphabetical order) |
|
|