1
2
3
4
5 package org.andromda.metafacades.uml14;
6
7 import java.util.Collection;
8 import org.andromda.core.metafacade.MetafacadeBase;
9 import org.andromda.core.metafacade.ModelValidationMessage;
10 import org.andromda.metafacades.uml.ClassifierFacade;
11 import org.andromda.metafacades.uml.RedefinableTemplateSignatureFacade;
12 import org.apache.log4j.Logger;
13 import org.omg.uml.foundation.core.ModelElement;
14
15
16
17
18
19
20
21
22
23 public abstract class RedefinableTemplateSignatureFacadeLogic
24 extends ModelElementFacadeLogicImpl
25 implements RedefinableTemplateSignatureFacade
26 {
27
28
29
30
31 protected Object metaObject;
32
33
34
35
36
37 protected RedefinableTemplateSignatureFacadeLogic(Object metaObjectIn, String context)
38 {
39 super((ModelElement)metaObjectIn, getContext(context));
40 this.metaObject = metaObjectIn;
41 }
42
43
44
45
46 private static final Logger logger = Logger.getLogger(RedefinableTemplateSignatureFacadeLogic.class);
47
48
49
50
51
52
53 private static String getContext(String context)
54 {
55 if (context == null)
56 {
57 context = "org.andromda.metafacades.uml.RedefinableTemplateSignatureFacade";
58 }
59 return context;
60 }
61
62
63
64
65 @Override
66 public void resetMetafacadeContext(String context)
67 {
68 if (!this.contextRoot)
69 {
70 context = getContext(context);
71 setMetafacadeContext (context);
72 }
73 }
74
75
76
77
78
79 public boolean isRedefinableTemplateSignatureFacadeMetaType()
80 {
81 return true;
82 }
83
84
85
86
87
88
89
90
91
92
93 public final ClassifierFacade getClassifier()
94 {
95 ClassifierFacade getClassifier1r = null;
96
97 Object result = handleGetClassifier();
98 MetafacadeBase shieldedResult = this.shieldedElement(result);
99 try
100 {
101 getClassifier1r = (ClassifierFacade)shieldedResult;
102 }
103 catch (ClassCastException ex)
104 {
105
106 RedefinableTemplateSignatureFacadeLogic.logger.warn("incorrect metafacade cast for RedefinableTemplateSignatureFacadeLogic.getClassifier ClassifierFacade " + result + ": " + shieldedResult);
107 }
108
109 return getClassifier1r;
110 }
111
112
113
114
115
116 protected abstract Object handleGetClassifier();
117
118
119
120
121
122 @Override
123 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
124 {
125 super.validateInvariants(validationMessages);
126 }
127 }