01: package org.andromda.metafacades.emf.uml2;
02:
03: import java.util.ArrayList;
04: import java.util.Collection;
05: import java.util.Iterator;
06: import java.util.List;
07:
08: import org.andromda.metafacades.uml.ActorFacade;
09:
10: /**
11: * MetafacadeLogic implementation for org.andromda.metafacades.uml.ActorFacade.
12: *
13: * @see org.andromda.metafacades.uml.ActorFacade
14: */
15: public class ActorFacadeLogicImpl extends ActorFacadeLogic {
16: public ActorFacadeLogicImpl(
17: final org.eclipse.uml2.Actor metaObject,
18: final String context) {
19: super (metaObject, context);
20: }
21:
22: /**
23: * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
24: */
25: public Object getValidationOwner() {
26: return this .getPackage();
27: }
28:
29: /**
30: * @see org.andromda.metafacades.uml.ActorFacade#getGeneralizedActors()
31: */
32: protected java.util.List handleGetGeneralizedActors() {
33: final List generalizedActors = new ArrayList();
34:
35: final Collection parentActors = this .getGeneralizations();
36: for (final Iterator iterator = parentActors.iterator(); iterator
37: .hasNext();) {
38: final Object object = iterator.next();
39: if (object instanceof ActorFacade) {
40: generalizedActors.add(object);
41: }
42: }
43: return generalizedActors;
44: }
45:
46: /**
47: *
48: * @see org.andromda.metafacades.uml.ActorFacade#getGeneralizedByActors()
49: */
50: protected java.util.List handleGetGeneralizedByActors() {
51: final List generalizedByActors = new ArrayList();
52:
53: final Collection specializedActors = this .getSpecializations();
54: for (final Iterator iterator = specializedActors.iterator(); iterator
55: .hasNext();) {
56: final Object object = iterator.next();
57: if (object instanceof ActorFacade) {
58: generalizedByActors.add(object);
59: }
60: }
61: return generalizedByActors;
62: }
63: }
|