01: package org.andromda.metafacades.uml14;
02:
03: import java.util.Collection;
04: import java.util.Iterator;
05:
06: import org.andromda.utils.StringUtilsHelper;
07: import org.omg.uml.behavioralelements.activitygraphs.ActivityGraph;
08: import org.omg.uml.foundation.core.ModelElement;
09:
10: /**
11: * Metaclass facade implementation.
12: */
13: public class UseCaseFacadeLogicImpl extends UseCaseFacadeLogic {
14: public UseCaseFacadeLogicImpl(
15: org.omg.uml.behavioralelements.usecases.UseCase metaObject,
16: String context) {
17: super (metaObject, context);
18: }
19:
20: /**
21: * @see org.andromda.metafacades.uml14.ModelElementFacadeLogic#handleGetName()
22: */
23: protected String handleGetName() {
24: return StringUtilsHelper.toSingleLine(super .handleGetName());
25: }
26:
27: /**
28: * @see org.andromda.metafacades.uml14.UseCaseFacadeLogic#handleGetFirstActivityGraph()
29: */
30: protected Object handleGetFirstActivityGraph() {
31: ActivityGraph activityGraph = null;
32:
33: for (final Iterator iterator = metaObject.getOwnedElement()
34: .iterator(); iterator.hasNext()
35: && activityGraph == null;) {
36: final ModelElement modelElement = (ModelElement) iterator
37: .next();
38: if (modelElement instanceof ActivityGraph) {
39: activityGraph = (ActivityGraph) modelElement;
40: }
41: }
42:
43: return activityGraph;
44: }
45:
46: /**
47: * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
48: */
49: public Object getValidationOwner() {
50: return getPackage();
51: }
52:
53: /**
54: * @see org.andromda.metafacades.uml.UseCaseFacade#getExtensionPoints()
55: */
56: protected Collection handleGetExtensionPoints() {
57: return metaObject.getExtensionPoint();
58: }
59:
60: /**
61: * @see org.andromda.metafacades.uml.UseCaseFacade#getExtends()
62: */
63: protected Collection handleGetExtends() {
64: return metaObject.getExtend();
65: }
66:
67: /**
68: * @see org.andromda.metafacades.uml.UseCaseFacade#getIncludes()
69: */
70: protected Collection handleGetIncludes() {
71: return metaObject.getInclude();
72: }
73: }
|