1 package org.andromda.metafacades.uml14;
2
3 import java.util.Collection;
4 import java.util.Iterator;
5 import org.andromda.utils.StringUtilsHelper;
6 import org.omg.uml.behavioralelements.activitygraphs.ActivityGraph;
7 import org.omg.uml.foundation.core.ModelElement;
8 import org.omg.uml.behavioralelements.usecases.UseCase;
9
10
11
12
13
14 public class UseCaseFacadeLogicImpl
15 extends UseCaseFacadeLogic
16 {
17 private static final long serialVersionUID = 2563683138479430934L;
18
19
20
21
22
23 public UseCaseFacadeLogicImpl(
24 UseCase metaObject,
25 String context)
26 {
27 super(metaObject, context);
28 }
29
30
31
32
33 protected String handleGetName()
34 {
35 return StringUtilsHelper.toSingleLine(super.handleGetName());
36 }
37
38
39
40
41 protected ActivityGraph handleGetFirstActivityGraph()
42 {
43 ActivityGraph activityGraph = null;
44
45 for (final Iterator iterator = metaObject.getOwnedElement().iterator();
46 iterator.hasNext() && activityGraph == null;)
47 {
48 final ModelElement modelElement = (ModelElement)iterator.next();
49 if (modelElement instanceof ActivityGraph)
50 {
51 activityGraph = (ActivityGraph)modelElement;
52 }
53 }
54
55 return activityGraph;
56 }
57
58
59
60
61 public Object getValidationOwner()
62 {
63 return getPackage();
64 }
65
66
67
68
69 @Override
70 protected Collection handleGetExtensionPoints()
71 {
72 return metaObject.getExtensionPoint();
73 }
74
75
76
77
78 @Override
79 protected Collection handleGetExtends()
80 {
81 return metaObject.getExtend();
82 }
83
84
85
86
87 @Override
88 protected Collection handleGetIncludes()
89 {
90 return metaObject.getInclude();
91 }
92 }