Statistics
| Revision:

root / branches / modelio3.7.x / src / main / java / org / modelio / togaf / profile / applicationarchitecture / model / ServiceData.java @ 237

History | View | Annotate | Download (3.58 KB)

1
/** 
2
 * Licensed to the Apache Software Foundation (ASF) under one 
3
 * or more contributor license agreements.  See the NOTICE file 
4
 * distributed with this work for additional information 
5
 * regarding copyright ownership.  The ASF licenses this file 
6
 * to you under the Apache License, Version 2.0 (the 
7
 * "License"); you may not use this file except in compliance 
8
 * with the License.  You may obtain a copy of the License at 
9
 * 
10
 *        http://www.apache.org/licenses/LICENSE-2.0 
11
 * 
12
 *        Unless required by applicable law or agreed to in writing, 
13
 *        software distributed under the License is distributed on an 
14
 *        "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
15
 *        KIND, either express or implied.  See the License for the 
16
 *        specific language governing permissions and limitations 
17
 *        under the License. 
18
 * 
19
 * 
20
 * @package    org.modelio.togaf. 
21
 * @author     Modelio 
22
 * @license    http://www.apache.org/licenses/LICENSE-2.0 
23
 * @version  1.0.00 
24
 **/
25
package org.modelio.togaf.profile.applicationarchitecture.model;
26

    
27
import java.util.List;
28

    
29
import org.modelio.metamodel.uml.infrastructure.ModelTree;
30
import org.modelio.metamodel.uml.statik.Attribute;
31
import org.modelio.metamodel.uml.statik.Class;
32
import org.modelio.metamodel.uml.statik.Component;
33
import org.modelio.metamodel.uml.statik.Package;
34
import org.modelio.metamodel.uml.statik.TemplateParameter;
35
import org.modelio.togaf.impl.TogafArchitectModule;
36
import org.modelio.togaf.profile.structure.model.ApplicationArchitecture;
37
import org.modelio.togaf.profile.utils.ModelUtils;
38
import org.modelio.togaf.profile.utils.ResourceManager;
39

    
40
public class ServiceData {
41
        protected Class element;
42

    
43
        public ServiceData() {
44
                this.element = TogafArchitectModule.getInstance().getModuleContext().getModelingSession().getModel().createClass();
45
                ModelUtils.setStereotype(this.element,"TogafArchitect", "ServiceData");
46
                this.element.setName(ResourceManager.getName("ServiceData"));
47
        }
48

    
49
        public ServiceData(Class element) {
50
                this.element = element;
51
        }
52

    
53
        public Class getElement() {
54
                return this.element;
55
        }
56

    
57
        public void setParent(ModelTree parent) {
58
                this.element.setOwner(parent);
59
        }
60

    
61
        public void setParent(TemplateParameter parent) {
62
                this.element.setOwnerTemplateParameter(parent);
63
        }
64

    
65
        public ApplicationArchitecture getApplicationArchitecture() {
66
                return new ApplicationArchitecture((Package) this.element.getOwner());
67
        }
68

    
69
        public void addApplicationArchitecture(ApplicationArchitecture model) {
70
                this.element.setOwner(model.getElement());
71
        }
72

    
73
        public TogafApplicationComponent getTogafApplicationComponent() {
74
                return new TogafApplicationComponent((Component) this.element.getOwner());
75
        }
76

    
77
        public void addTogafApplicationComponent(TogafApplicationComponent model) {
78
                this.element.setOwner(model.getElement());
79
        }
80

    
81
        public List<ApplicationArchitectureAttribute> getApplicationArchitectureAttribute() {
82
                List<ApplicationArchitectureAttribute> res = new java.util.ArrayList<>();
83
                for (Attribute model_element : this.element.getOwnedAttribute()) {
84
                        res.add(new ApplicationArchitectureAttribute(model_element));
85
                }
86
                return res;
87
        }
88

    
89
        public void addApplicationArchitectureAttribute(ApplicationArchitectureAttribute model) {
90
                this.element.getOwnedAttribute().add(model.getElement());
91
        }
92

    
93
        public List<ServiceDataFragment> getServiceDataFragment() {
94
                List<ServiceDataFragment> res = new java.util.ArrayList<>();
95
                for (ModelTree model_element : this.element.getOwnedElement()) {
96
                        res.add(new ServiceDataFragment((Class) model_element));
97
                }
98
                return res;
99
        }
100

    
101
        public void addServiceDataFragment(ServiceDataFragment model) {
102
                this.element.getOwnedElement().add(model.getElement());
103
        }
104

    
105
}