1 26 27 package org.objectweb.openccm.ir3; 28 29 import org.omg.CORBA.*; 31 32 40 41 public class Parameters 42 extends Members 43 { 44 50 51 protected ParameterMode[] modes_; 52 53 59 62 public 63 Parameters(OperationDef_impl op) 64 { 65 super(op, null); 66 modes_ = new ParameterMode[0]; 67 } 68 69 75 78 public void 79 checkOnlyInModes() 80 { 81 for(int i=0; i<modes_.length; i++) 82 if(modes_[i] != ParameterMode.PARAM_IN) 83 throw contained_.exceptionNeedOnlyInParams(); 84 } 85 86 89 public ParameterDescription[] 90 getParameterDescriptionSeq() 91 { 92 ParameterDescription[] result = 93 new ParameterDescription[names_.length]; 94 95 java.util.List idSeq = new java.util.ArrayList (); 96 for(int i=0; i<result.length; i++) 97 { 98 idSeq.clear(); 99 result[i] = new ParameterDescription(); 100 result[i].name = names_[i]; 101 result[i].type = types_[i].recursiveType(idSeq); 103 result[i].type_def = types_[i].asIDLType(); 104 result[i].mode = modes_[i]; 105 } 106 107 return result; 108 } 109 110 113 public void 114 setParameterDescriptionSeq(ParameterDescription[] val) 115 { 116 String [] names = new String [val.length]; 118 for (int i=0; i<val.length; i++) 119 names[i] = val[i].name; 120 121 checkNames(names); 122 123 ParameterMode[] modes = new ParameterMode[val.length]; 125 for (int i=0; i<val.length; i++) 126 modes[i] = val[i].mode; 127 128 IRObject_impl[] types = new IRObject_impl[val.length]; 129 for (int i=0; i<val.length; i++) 130 types[i] = contained_.castToLocal(val[i].type_def); 131 132 IDLType_ref[] refs = new IDLType_ref[val.length]; 133 for (int i=0; i<val.length; i++) 134 refs[i] = new IDLType_ref( contained_, types[i] ); 135 136 modes_ = modes; 137 super.setNamesTypes(names, refs); 138 } 139 } 140 | Popular Tags |