1 26 27 package org.objectweb.openccm.ast.lib; 28 29 30 import org.objectweb.openccm.ast.api.Declaration; 31 32 33 import org.objectweb.openccm.ast.api.OperationDecl; 34 35 36 import org.objectweb.openccm.ast.api.EventDecl; 37 38 51 52 abstract public class EventPortDeclImpl 53 extends DeclarationImpl 54 implements org.objectweb.openccm.ast.api.EventPortDecl 55 { 56 62 63 protected EventDeclImpl event_; 64 65 66 protected OperationDecl[] client_mapping_; 67 68 74 80 protected 81 EventPortDeclImpl(Repository rep, 82 ScopeImpl parent) 83 { 84 super(rep, parent); 86 87 event_ = null; 89 client_mapping_ = null; 90 } 91 92 98 104 109 protected void 110 load(org.omg.CORBA.Contained contained) 111 { 112 org.omg.CORBA.ComponentIR.EventPortDef event_port = 113 org.omg.CORBA.ComponentIR.EventPortDefHelper.narrow(contained); 114 setEvent((EventDecl)getRepository().lookupId(event_port.event().id())); 115 super.load(contained); 116 } 117 118 124 130 138 public Declaration[] 139 getDependencies() 140 { 141 if (dependencies_!=null) 142 return dependencies_; 143 144 java.util.List events_depend = new java.util.ArrayList (); 145 146 if (getEvent().isDeclaration()) 150 events_depend.add(getEvent()); 151 152 Declaration[] depend = getEvent().getDependencies(); 153 for (int i=0;i<depend.length;i++) 154 events_depend.add(depend[i]); 155 156 dependencies_ = (Declaration[])events_depend.toArray( 157 new Declaration[0]); 158 return dependencies_; 159 } 160 161 167 173 178 public void 179 setEvent(EventDecl event) 180 { 181 if (event != null) 182 { 183 event_ = (EventDeclImpl)event; 184 } 185 } 186 187 192 public EventDecl 193 getEvent() 194 { 195 return event_; 196 } 197 } 198 | Popular Tags |