1 26 27 package org.objectweb.openccm.ast.lib; 28 29 import org.objectweb.openccm.ast.api.DeclarationKind; 31 import org.objectweb.openccm.ast.api.Declaration; 32 import org.objectweb.openccm.ast.api.CategoryKind; 33 import org.objectweb.openccm.ast.api.HomeExecutorDecl; 34 import org.objectweb.openccm.ast.api.ProxyHomeDecl; 35 36 50 51 public class CompositionDeclImpl 52 extends CidlScopeImpl 53 implements org.objectweb.openccm.ast.api.CompositionDecl 54 { 55 61 62 private CategoryKind category_; 63 64 70 76 public 77 CompositionDeclImpl(Repository rep, 78 ScopeImpl parent) 79 { 80 super(rep, parent); 82 83 category_ = null; 85 content_loaded_ = true; 86 } 87 88 94 100 106 protected org.omg.CORBA.Contained 107 getContained() 108 { 109 return null; 110 } 111 112 118 124 protected org.omg.CORBA.Container 125 getContainer() 126 { 127 return null; 128 } 129 130 136 142 150 public Declaration[] 151 getDependencies() 152 { 153 if (dependencies_ != null) 154 return dependencies_; 155 156 java.util.List comp_depend = new java.util.ArrayList (); 157 Declaration[] depend = null; 158 159 Declaration[] decls = getContents(true, DeclarationKind.dk_all); 161 for (int i=0; i<decls.length; i++) 162 { 163 depend = decls[i].getDependencies(); 164 for (int j=0; j<depend.length; j++) 165 { 166 if ( (!containsDecl(depend[j])) && 167 (depend[j] != this) && 168 (comp_depend.indexOf(depend[j]) == -1) ) 169 { 170 comp_depend.add(depend[j]); 171 } 172 } 173 } 174 175 dependencies_ = (Declaration[])comp_depend.toArray(new Declaration[0]); 176 return dependencies_; 177 } 178 179 185 190 public long 191 getDeclKind() 192 { 193 return DeclarationKind.dk_composition; 194 } 195 196 202 208 213 public void 214 setCategoryKind(CategoryKind ck) 215 { 216 category_ = ck; 217 } 218 219 224 public CategoryKind 225 getCategoryKind() 226 { 227 return category_; 228 } 229 230 231 238 public HomeExecutorDecl 239 startHomeExecutor(String name) 240 { 241 HomeExecutorDecl decl = new HomeExecutorDeclImpl(getRepository(), this); 242 decl.setName(name); 243 return decl; 244 } 245 246 253 public ProxyHomeDecl 254 startProxyHome(String name) 255 { 256 ProxyHomeDecl decl = new ProxyHomeDeclImpl(getRepository(), this); 257 decl.setName(name); 258 return decl; 259 } 260 } 261 | Popular Tags |