1 26 27 package org.objectweb.openccm.ast.lib; 28 29 30 import org.objectweb.openccm.ast.api.DeclarationKind; 31 32 33 import org.objectweb.openccm.ast.api.StringList; 34 35 36 import org.objectweb.openccm.ast.api.ASTError; 37 38 62 63 public class DeclarationWithMemberListImpl 64 extends DeclarationImpl 65 implements org.objectweb.openccm.ast.api.DeclarationWithMemberList 66 { 67 73 74 protected StringListImpl members_; 75 76 82 88 protected 89 DeclarationWithMemberListImpl(Repository rep, 90 ScopeImpl parent) 91 { 92 super(rep, parent); 94 95 members_ = new StringListImpl(); 97 } 98 99 105 111 116 protected org.omg.CORBA.Contained 117 getContained() 118 { 119 return null; 120 } 121 122 128 134 141 public long 142 getDeclKind() 143 { 144 return DeclarationKind.dk_null; 145 } 146 147 150 public void 151 create() 152 { 153 super.create(); 155 156 int index = members_.checkSameItem(); 158 if( index != -1 ) 159 { 160 throw new ASTError( (String )members_.get(index) + " must be specified once and once only."); 161 } 162 } 163 164 167 protected void 168 check(StorageTypeBaseImpl st) 169 { 170 int size = members_.getSize(); 171 for(int i=0; i<size; i++) 172 { 173 String state = (String )members_.get(i); 174 if( st.isValidState(state) == false) 175 { 176 throw new ASTError(getName() + " => " + state + " is not a valid state member." ); 177 } 178 } 179 } 180 181 187 192 public StringList 193 getMemberList() 194 { 195 return members_; 196 } 197 } 198 | Popular Tags |