1 26 27 package org.objectweb.openccm.ir3; 28 29 37 38 public class Members 39 { 40 46 47 protected Contained_impl contained_; 48 49 50 protected Container_impl container_; 51 52 53 protected String [] names_; 54 55 56 protected IDLType_ref[] types_; 57 58 64 67 public 68 Members(Contained_impl contained, Container_impl container) 69 { 70 contained_ = contained; 72 container_ = container; 73 names_ = new String [0]; 74 types_ = null; 75 } 76 77 83 86 protected void 87 checkNames(String [] names) 88 { 89 for(int i=0; i<names.length; i++) 90 { 91 String name = names[i]; 92 93 for(int j=i+1; j<names.length; j++) 94 if(name.equalsIgnoreCase(names[j])) 95 throw contained_.exceptionDuplicateDeclarator(name, j); 96 97 if (container_ != null) 98 { 99 container_.checkName(name, false, false); 100 101 if (name.equalsIgnoreCase(contained_.name())) 102 throw contained_.exceptionNameAlreadyUsedByImmediateScope(name); 103 } 104 } 105 } 106 107 110 protected void 111 setNamesTypes(String [] names, 112 IDLType_ref[] types) 113 { 114 cutDependencies(); 116 117 names_ = names; 118 types_ = types; 119 } 120 121 127 130 public String [] 131 getNames() 132 { 133 return names_; 134 } 135 136 139 public void 140 checkName(String name) 141 { 142 for(int i=0; i<names_.length; i++) 143 if(name.equalsIgnoreCase(names_[i])) 144 throw contained_.exceptionNameAlreadyUsed(name); 145 } 146 147 150 public void 151 cutDependencies() 152 { 153 if (types_ != null) 154 { 155 for(int i=0; i<types_.length; i++) 156 types_[i].cutDependency(); 157 } 158 } 159 } 160 | Popular Tags |