public class MetafacadeUtils extends Object
Constructor and Description |
---|
MetafacadeUtils() |
Modifier and Type | Method and Description |
---|---|
static long |
calculateDefaultSUID(ClassifierFacade object)
Calculates the serial version UID of this classifier based on the
signature of the classifier (name, visibility, attributes and methods).
|
static void |
filterByNotType(Collection modelElements,
Class type)
Filters out the model elements from the
modelElements collection that are of (or inherit from) the
specified type type |
static void |
filterByStereotype(Collection modelElements,
String stereotype)
Filters out the model elements from the
modelElements collection that don't have the specified
stereotype |
static void |
filterByType(Collection modelElements,
Class type)
Filters out the model elements from the
modelElements collection that are not of (or do not inherit
from) the specified type type |
static Object |
getElementAsType(Object element,
Class type)
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.
|
static String |
getEmfTaggedValue(String name)
Changes andromda standard tag format Strings to EMF standard format Strings
(must be a valid Java identifier).
|
static String |
getSignature(String name,
Collection<ParameterFacade> arguments,
boolean withArgumentNames,
String argumentModifier)
Creates a typed argument list with the given
arguments . |
static String |
getTypedArgumentList(Collection<ParameterFacade> arguments,
boolean withArgumentNames,
String modifier)
Creates a typed argument list with the given
arguments . |
static String |
getUml14TaggedValue(String name)
Changes EMF standard tag format Strings to AndroMDA standard format Strings.
|
static void |
sortByFullyQualifiedName(List metafacades)
Sorts given metafacades by their fully qualified name.
|
static String |
toRelationName(String roleName,
String targetRoleName,
String separator)
Returns a consistent name for a relation, independent from the end of the relation one is looking at.
|
public MetafacadeUtils()
public static Object getElementAsType(Object element, Class type)
element
- the element to check.type
- the Class type.public static void filterByStereotype(Collection modelElements, String stereotype)
modelElements
collection that don't have the specified
stereotype
modelElements
- the model elements to filter.stereotype
- the stereotype that a model element must have in order to stay remain within the
modelElements
collection.public static void filterByType(Collection modelElements, Class type)
modelElements
collection that are not of (or do not inherit
from) the specified type type
modelElements
- the model elements to filter.type
- the type of Class.public static void filterByNotType(Collection modelElements, Class type)
modelElements
collection that are of (or inherit from) the
specified type type
modelElements
- the model elements to filter.type
- the type of Class.public static String toRelationName(String roleName, String targetRoleName, String separator)
roleName
- name of role in relationtargetRoleName
- name of target role in relationseparator
- character used to separate wordspublic static void sortByFullyQualifiedName(List metafacades)
metafacades
- the collection of model elements to sort.public static String getTypedArgumentList(Collection<ParameterFacade> arguments, boolean withArgumentNames, String modifier)
arguments
. If the withArgumentNames
flag is true, the argument names are included in the list.arguments
- the arguments from which to create the list.withArgumentNames
- whether or not to include the argument names.modifier
- public static String getSignature(String name, Collection<ParameterFacade> arguments, boolean withArgumentNames, String argumentModifier)
arguments
. If the withArgumentNames
flag is true, the argument names are included in the list.name
- arguments
- the arguments from which to create the list.withArgumentNames
- whether or not to include the argument names.argumentModifier
- public static String getEmfTaggedValue(String name)
name
- public static String getUml14TaggedValue(String name)
name
- public static long calculateDefaultSUID(ClassifierFacade object)
ObjectStreamClass.getSerialVersionUID()
.
The value should be stable as long as the classifier remains unchanged
and should change as soon as there is any change in the signature of the
classifier.object
- Copyright © 2003–2014 AndroMDA.org. All rights reserved.