1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package com.finalist.mmbase.uml;
16
17 import com.finalist.mmbase.umlprofile.MMBaseUMLProfile;
18
19 import java.util.Collection;
20 import java.util.ArrayList;
21 import java.util.Iterator;
22
23 /***
24 *
25 * Helper classes to get access to MMBasePackages.
26 *
27 * @author Rudie Ekkelenkamp - Finalist IT Group
28 * @version $Revision: 1.2 $, $Date: 2004/12/08 23:27:32 $
29 *
30 */
31 public class MMBasePackageHelper extends MMBaseHelper {
32
33 /*** Default constructor. */
34 public MMBasePackageHelper(Object model) {
35
36 setModel(model);
37 }
38
39 /***
40 * Returns a collection of String's with the package names.
41 * that have the MMBasePackage stereotype name.
42 * These packages are UML2MMBase packages that can be selected for codegeneration.
43 *
44 * @return Collection with package names.
45 */
46 public Collection getMMBasePackages() {
47 ArrayList result = new ArrayList();
48
49
50 Collection modelElements = getModelElements();
51 for (Iterator iterator = modelElements.iterator(); iterator.hasNext();) {
52 Object o = iterator.next();
53 if (super.isPackage(o) && MMBaseUMLProfile.STEREOTYPE_PACKAGE_MMBASE_PACKAGE.equals(super.getStereotype(o))) {
54 result.add("" + super.getName(o));
55 }
56 }
57 return result;
58 }
59 }