|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.utah.further.mdr.impl.service.util.UmlUtil
@Utility public final class UmlUtil
UML/XMI model utilities.
-----------------------------------------------------------------------------------
(c) 2008-2011 FURTHeR Project, AVP Health Sciences IT Office, University of Utah
Contact: Dr. Scott Narus <scott.narus@hsc.utah.edu>
Biomedical Informatics, 26 South 2000 East
Room 5775 HSEB, Salt Lake City, UT 84112
Day Phone: 1-801-213-3288
-----------------------------------------------------------------------------------
<oren.livne@utah.edu>
Field Summary | |
---|---|
static Comparator<UmlElement> |
comparatorByName
Compare UML elements by name. |
Method Summary | |
---|---|
static void |
buildPackageTree(UmlPackage root,
SortedSet<UmlPackage> packages)
Convert a sorted list of packages to a hierarchical element tree. |
static Map<String,UmlClass> |
getClasses(Map<String,UmlClass> classSet,
ClassType classType,
UmlPackage pkg)
Return the sub-set of classes in a collection of classes by class type. |
static Map<String,UmlClass> |
getClasses(UmlModel model,
ClassType classType,
UmlPackage pkg)
Return the list of classes in a model by class type. |
static boolean |
isInPackage(UmlClass clazz,
UmlPackage pkg)
Is class in a package. |
static void |
printMessages(XmiParser parser)
Print an XMI parser messages after parsing a file. |
static void |
printModelTree(UmlPackage root)
|
static void |
updateAncestryMarks(UmlElement element)
If the UML element has errors, mark the entire element ancestry (including this object) as having errors of at least the same severity level as the element's marker. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Comparator<UmlElement> comparatorByName
Method Detail |
---|
public static Map<String,UmlClass> getClasses(UmlModel model, ClassType classType, UmlPackage pkg)
Warning: works only for flat models (all classes are under the root model node).
model
- UML modelclassType
- class type. If null
, returns all classespkg
- only classes in this package or any of its sub-packages will be
returned, if this parameter is non-null
classType
under the modelpublic static Map<String,UmlClass> getClasses(Map<String,UmlClass> classSet, ClassType classType, UmlPackage pkg)
classSet
- class type. If null
, returns all classespkg
- only classes in this package or any of its sub-packages will be
returned, if this parameter is non-null
classType
under the modelpublic static void printMessages(XmiParser parser)
parser
- XMI parserpublic static boolean isInPackage(UmlClass clazz, UmlPackage pkg)
packageNames
sub-list.
clazz
- UML classpkg
- package
public static void buildPackageTree(UmlPackage root, SortedSet<UmlPackage> packages)
root
- root element of the tree to add packages underpackages
- package listpublic static void printModelTree(UmlPackage root)
root
- public static void updateAncestryMarks(UmlElement element)
Then we get an eclipse-like explorer display where an error is easy to find because it propagates up the hierarchy -- up to the very top.
element
- UML element
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |