EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.cip.completions]

COVERAGE SUMMARY FOR SOURCE FILE [RegisteredCompletion.java]

nameclass, %method, %block, %line, %
RegisteredCompletion.java0%   (0/1)0%   (0/11)0%   (0/244)0%   (0/47)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class RegisteredCompletion0%   (0/1)0%   (0/11)0%   (0/244)0%   (0/47)
RegisteredCompletion (String, String, String, String, String, String, String,... 0%   (0/1)0%   (0/27)0%   (0/10)
containsCategory (String): boolean 0%   (0/1)0%   (0/20)0%   (0/4)
getCategories (): ArrayList 0%   (0/1)0%   (0/3)0%   (0/1)
getDescription (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getFeaturemodel (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getId (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getImage (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getMetamodel (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getQvtscript (): String 0%   (0/1)0%   (0/3)0%   (0/1)
parseCompletion (IConfigurationElement, String): RegisteredCompletion 0%   (0/1)0%   (0/173)0%   (0/25)

1package de.uka.ipd.sdq.cip.completions;
2 
3import java.util.ArrayList;
4 
5import org.eclipse.core.runtime.IConfigurationElement;
6import org.eclipse.emf.common.util.URI;
7 
8import de.uka.ipd.sdq.cip.ConstantsContainer;
9 
10 
11public class RegisteredCompletion {
12 
13        protected final String id;
14        protected final String name;
15        protected final String image;
16        protected final String description;
17        protected final String featuremodel;
18        protected String metamodel;
19        protected final String qvtscript;
20        protected final ArrayList<String> categories;
21        
22        public RegisteredCompletion(String id, String name, String image,
23                        String description, String featuremodel, String metamodel, String qvtscript,
24                        ArrayList<String> categories) {
25                this.id = id;
26                this.name = name;
27                this.image = image;
28                this.description = description;
29                this.featuremodel = featuremodel;
30                this.metamodel = metamodel;
31                this.qvtscript = qvtscript;
32                this.categories = categories;
33        }
34 
35        public static RegisteredCompletion parseCompletion(
36                        IConfigurationElement element, String contributor) {
37                String featuremodel = null;
38                String metamodel = null;
39                String qvtscript = null;
40                String image = null;
41                
42                String id = element.getAttribute(ConstantsContainer.ATT_COMPLETION_ID);
43                String name = element.getAttribute(ConstantsContainer.ATT_COMPLETION_NAME);
44                
45                if((image = element.getAttribute(ConstantsContainer.ATT_COMPLETION_IMAGE)) != null)
46                        image = URI.createPlatformPluginURI("/" + contributor + "/" + image,false).toString();
47                
48                if((featuremodel = element.getAttribute(ConstantsContainer.ATT_COMPLETION_FEATUREMODEL)) != null)                
49                        featuremodel = URI.createPlatformPluginURI("/" + contributor + "/" + featuremodel,false).toString();
50                
51                if((metamodel = element.getAttribute(ConstantsContainer.ATT_COMPLETION_METAMODEL)) != null)
52                        metamodel = URI.createPlatformPluginURI("/" + contributor + "/" + metamodel,false).toString();
53                
54                if((qvtscript = element.getAttribute(ConstantsContainer.ATT_COMPLETION_QVTSCRIPT)) != null)
55                        qvtscript = URI.createPlatformPluginURI("/" + contributor + "/" + qvtscript,false).toString();
56                
57                IConfigurationElement[] description_node = element.getChildren(ConstantsContainer.NODE_DESCRIPTION);
58                String description = description_node[0].getValue();
59                
60                IConfigurationElement[] categorie_node = element.getChildren(ConstantsContainer.NODE_CATEGORY);
61                ArrayList<String> categories = new ArrayList<String>(); 
62                for(int i = 0; i < categorie_node.length; ++i) {
63                        IConfigurationElement category = categorie_node[i];
64                        categories.add(category.getAttribute(ConstantsContainer.ATT_COMPLETION_NAME));
65                }
66                
67 
68                if(id == null || name == null || description == null || !(featuremodel == null ^ qvtscript == null) || categories.size() < 1)
69                        return null;
70                RegisteredCompletion rc = new RegisteredCompletion(id, name, image, description, featuremodel, metamodel, qvtscript,  categories);
71                return rc;
72        }
73        
74        public String getImage() {
75                return image;
76        }
77 
78        public String getId() {
79                return id;
80        }
81 
82        public String getName() {
83                return name;
84        }
85 
86        public String getDescription() {
87                return description;
88        }
89 
90        public String getFeaturemodel() {
91                return featuremodel;
92        }
93 
94        public String getMetamodel() {
95                return metamodel;
96        }
97 
98        public String getQvtscript() {
99                return qvtscript;
100        }
101 
102        public ArrayList<String> getCategories() {
103                return categories;
104        }
105 
106        public boolean containsCategory(String category) {
107                for(String search_category : categories) {
108                        if(search_category.equals(category))
109                                return true;
110                }
111                return false;
112        }
113 
114}

[all classes][de.uka.ipd.sdq.cip.completions]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov