001: package org.andromda.metafacades.emf.uml2;
002:
003: import org.eclipse.emf.common.notify.Notification;
004: import org.eclipse.emf.common.util.DiagnosticChain;
005: import org.eclipse.emf.common.util.EList;
006: import org.eclipse.emf.common.util.TreeIterator;
007: import org.eclipse.emf.ecore.EAnnotation;
008: import org.eclipse.emf.ecore.EClass;
009: import org.eclipse.emf.ecore.EObject;
010: import org.eclipse.emf.ecore.EReference;
011: import org.eclipse.emf.ecore.EStructuralFeature;
012: import org.eclipse.emf.ecore.resource.Resource;
013: import org.eclipse.uml2.Comment;
014: import org.eclipse.uml2.Element;
015: import org.eclipse.uml2.InstanceSpecification;
016: import org.eclipse.uml2.Model;
017: import org.eclipse.uml2.Slot;
018: import org.eclipse.uml2.Stereotype;
019: import org.eclipse.uml2.StructuralFeature;
020: import org.eclipse.uml2.ValueSpecification;
021:
022: import java.util.Map;
023: import java.util.Set;
024:
025: /**
026: * Implementation of AttributeLink.
027: *
028: * We extend Slot. We keep a reference to the original slot and we defer
029: * almost all method calls to it.
030: *
031: * @author Wouter Zoons
032: */
033: public class AttributeLinkImpl implements AttributeLink {
034: final Slot slot;
035:
036: AttributeLinkImpl(final Slot slot) {
037: this .slot = slot;
038: }
039:
040: public boolean equals(final Object object) {
041: if (object instanceof AttributeLinkImpl) {
042: return this .slot.equals(((AttributeLinkImpl) object).slot);
043: }
044: if (object instanceof LinkEndImpl) {
045: return this .slot.equals(((LinkEndImpl) object).slot);
046: }
047: return this .slot.equals(object);
048: }
049:
050: public int hashCode() {
051: return this .slot.hashCode();
052: }
053:
054: public String toString() {
055: return this .getClass().getName() + '[' + this .slot.toString()
056: + ']';
057: }
058:
059: public InstanceSpecification getOwningInstance() {
060: return this .slot.getOwningInstance();
061: }
062:
063: public void setOwningInstance(
064: InstanceSpecification instanceSpecification) {
065: this .slot.setOwningInstance(instanceSpecification);
066: }
067:
068: public EList getValues() {
069: return this .slot.getValues();
070: }
071:
072: public ValueSpecification getValue(String string) {
073: return this .slot.getValue(string);
074: }
075:
076: public ValueSpecification createValue(EClass eClass) {
077: return this .slot.createValue(eClass);
078: }
079:
080: public StructuralFeature getDefiningFeature() {
081: return this .slot.getDefiningFeature();
082: }
083:
084: public void setDefiningFeature(StructuralFeature structuralFeature) {
085: this .slot.setDefiningFeature(structuralFeature);
086: }
087:
088: public Object eGet(EStructuralFeature eStructuralFeature, boolean b) {
089: return this .slot.eGet(eStructuralFeature, b);
090: }
091:
092: public void eSet(EStructuralFeature eStructuralFeature,
093: Object object) {
094: this .slot.eSet(eStructuralFeature, object);
095: }
096:
097: public void eUnset(EStructuralFeature eStructuralFeature) {
098: this .slot.eUnset(eStructuralFeature);
099: }
100:
101: public boolean eIsSet(EStructuralFeature eStructuralFeature) {
102: return this .slot.eIsSet(eStructuralFeature);
103: }
104:
105: public EList getOwnedElements() {
106: return this .slot.getOwnedElements();
107: }
108:
109: public Element getOwner() {
110: return this .slot.getOwner();
111: }
112:
113: public EList getOwnedComments() {
114: return this .slot.getOwnedComments();
115: }
116:
117: public Comment createOwnedComment(EClass eClass) {
118: return this .slot.createOwnedComment(eClass);
119: }
120:
121: public Comment createOwnedComment() {
122: return this .slot.createOwnedComment();
123: }
124:
125: public boolean validateNotOwnSelf(DiagnosticChain diagnosticChain,
126: Map map) {
127: return this .slot.validateNotOwnSelf(diagnosticChain, map);
128: }
129:
130: public boolean validateHasOwner(DiagnosticChain diagnosticChain,
131: Map map) {
132: return this .slot.validateHasOwner(diagnosticChain, map);
133: }
134:
135: public Set allOwnedElements() {
136: return this .slot.allOwnedElements();
137: }
138:
139: public boolean mustBeOwned() {
140: return this .slot.mustBeOwned();
141: }
142:
143: public EAnnotation createEAnnotation(String string) {
144: return this .slot.createEAnnotation(string);
145: }
146:
147: public void apply(Stereotype stereotype) {
148: this .slot.apply(stereotype);
149: }
150:
151: public Stereotype getApplicableStereotype(String string) {
152: return this .slot.getApplicableStereotype(string);
153: }
154:
155: public Set getApplicableStereotypes() {
156: return this .slot.getApplicableStereotypes();
157: }
158:
159: public Stereotype getAppliedStereotype(String string) {
160: return this .slot.getAppliedStereotype(string);
161: }
162:
163: public Set getAppliedStereotypes() {
164: return this .slot.getAppliedStereotypes();
165: }
166:
167: public Model getModel() {
168: return this .slot.getModel();
169: }
170:
171: public org.eclipse.uml2.Package getNearestPackage() {
172: return this .slot.getNearestPackage();
173: }
174:
175: public Object getValue(Stereotype stereotype, String string) {
176: return this .slot.getValue(stereotype, string);
177: }
178:
179: public boolean isApplied(Stereotype stereotype) {
180: return this .slot.isApplied(stereotype);
181: }
182:
183: public boolean isRequired(Stereotype stereotype) {
184: return this .slot.isRequired(stereotype);
185: }
186:
187: public void setValue(Stereotype stereotype, String string,
188: Object object) {
189: this .slot.setValue(stereotype, string, object);
190: }
191:
192: public boolean hasValue(Stereotype stereotype, String string) {
193: return this .slot.hasValue(stereotype, string);
194: }
195:
196: public void unapply(Stereotype stereotype) {
197: this .slot.unapply(stereotype);
198: }
199:
200: public void destroy() {
201: this .slot.destroy();
202: }
203:
204: public String getAppliedVersion(Stereotype stereotype) {
205: return this .slot.getAppliedVersion(stereotype);
206: }
207:
208: public void addKeyword(String string) {
209: this .slot.addKeyword(string);
210: }
211:
212: public Set getKeywords() {
213: return this .slot.getKeywords();
214: }
215:
216: public boolean hasKeyword(String string) {
217: return this .slot.hasKeyword(string);
218: }
219:
220: public void removeKeyword(String string) {
221: this .slot.removeKeyword(string);
222: }
223:
224: public EList getEAnnotations() {
225: return this .slot.getEAnnotations();
226: }
227:
228: public EAnnotation getEAnnotation(String string) {
229: return this .slot.getEAnnotation(string);
230: }
231:
232: public EList eAdapters() {
233: return this .slot.eAdapters();
234: }
235:
236: public boolean eDeliver() {
237: return this .slot.eDeliver();
238: }
239:
240: public void eSetDeliver(boolean b) {
241: this .slot.eSetDeliver(b);
242: }
243:
244: public boolean eIsProxy() {
245: return this .slot.eIsProxy();
246: }
247:
248: public EClass eClass() {
249: return this .slot.eClass();
250: }
251:
252: public EObject eContainer() {
253: return this .slot.eContainer();
254: }
255:
256: public EList eContents() {
257: return this .slot.eContents();
258: }
259:
260: public EList eCrossReferences() {
261: return this .slot.eCrossReferences();
262: }
263:
264: public TreeIterator eAllContents() {
265: return this .slot.eAllContents();
266: }
267:
268: public EReference eContainmentFeature() {
269: return this .slot.eContainmentFeature();
270: }
271:
272: public EStructuralFeature eContainingFeature() {
273: return this .slot.eContainingFeature();
274: }
275:
276: public Resource eResource() {
277: return this .slot.eResource();
278: }
279:
280: public Object eGet(EStructuralFeature eStructuralFeature) {
281: return this .slot.eGet(eStructuralFeature);
282: }
283:
284: public void eNotify(Notification notification) {
285: this.slot.eNotify(notification);
286: }
287: }
|