01: package org.andromda.metafacades.uml14;
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: * Metaclass facade implementation.
12: */
13: public class ActorFacadeLogicImpl extends ActorFacadeLogic {
14: public ActorFacadeLogicImpl(
15: org.omg.uml.behavioralelements.usecases.Actor metaObject,
16: String context) {
17: super (metaObject, context);
18: }
19:
20: /**
21: * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
22: */
23: public Object getValidationOwner() {
24: return this .getPackage();
25: }
26:
27: /**
28: * @see org.andromda.metafacades.uml.ActorFacade#getGeneralizedActors()
29: */
30: protected java.util.List handleGetGeneralizedActors() {
31: final List generalizedActors = new ArrayList();
32:
33: final Collection parentActors = this .getGeneralizations();
34: for (final Iterator iterator = parentActors.iterator(); iterator
35: .hasNext();) {
36: final Object object = iterator.next();
37: if (object instanceof ActorFacade) {
38: generalizedActors.add(object);
39: }
40: }
41: return generalizedActors;
42: }
43:
44: /**
45: *
46: * @see org.andromda.metafacades.uml.ActorFacade#getGeneralizedByActors()
47: */
48: protected java.util.List handleGetGeneralizedByActors() {
49: final List generalizedByActors = new ArrayList();
50:
51: final Collection specializedActors = this .getSpecializations();
52: for (final Iterator iterator = specializedActors.iterator(); iterator
53: .hasNext();) {
54: final Object object = iterator.next();
55: if (object instanceof ActorFacade) {
56: generalizedByActors.add(object);
57: }
58: }
59: return generalizedByActors;
60: }
61: }
|