1 26 27 package org.objectweb.openccm.ast.lib; 28 29 30 import org.objectweb.openccm.ast.api.InterfaceDecl; 31 32 33 import org.objectweb.openccm.ast.api.OperationDecl; 34 35 48 49 public abstract class InterfacePortDeclImpl 50 extends DeclarationImpl 51 implements org.objectweb.openccm.ast.api.InterfacePortDecl 52 { 53 59 60 protected InterfaceDeclImpl interface_; 61 62 63 protected OperationDecl[] client_mapping_; 64 65 66 private InterfaceDeclImpl local_mapping_; 67 68 74 80 protected 81 InterfacePortDeclImpl(Repository rep, 82 ScopeImpl parent) 83 { 84 super(rep, parent); 86 87 interface_ = null; 89 client_mapping_ = null; 90 } 91 92 98 104 110 116 122 127 public void 128 setInterface(InterfaceDecl itf) 129 { 130 if(itf != null) 131 { 132 interface_ = (InterfaceDeclImpl)itf; 133 } 134 } 135 136 141 public InterfaceDecl 142 getInterface() 143 { 144 return interface_; 145 } 146 147 152 public InterfaceDecl 153 getLocalMapping() 154 { 155 if (local_mapping_==null) 156 { 157 String parent_base_id = getInterface().getParent().getId(); 159 int idx = parent_base_id.lastIndexOf(':'); 160 parent_base_id = parent_base_id.substring(0, idx); 161 String id = parent_base_id + "/CCM_" + getInterface().getName() + ":" + getVersion(); 162 local_mapping_ = (InterfaceDeclImpl)getRepository().loadMapping(getInterface().getParent(), id); 163 } 164 return local_mapping_; 165 } 166 } 167 | Popular Tags |