1 6 7 package SOFA.Connector.EEG.EEM.Actions; 8 9 import SOFA.Connector.EEG.CodeWriter.CDL2IDLMapping; 10 import SOFA.Connector.EEG.CodeWriter.IDLWriterDirectorException; 11 import SOFA.SOFAnode.Made.TIR.ExceptionDef; 12 import SOFA.SOFAnode.Made.TIR.OperationDef; 13 import SOFA.SOFAnode.Made.TIR.ParamDescr; 14 15 20 public class IDLIfaceNormal { 21 public static String getOperationDef(OperationDef mt) throws IDLWriterDirectorException { 22 try { 23 StringBuffer ret=new StringBuffer (CDL2IDLMapping.getTypeName(mt.result())+" "+mt.get_identification().name()+"("); 24 25 int j; 26 ParamDescr[] params=mt.params(); 27 for (j=0;j<params.length;j++) { 28 if (j>0) { 29 ret.append(", "); 30 } 31 ret.append(CDL2IDLMapping.getTypeDecl(params[j].type(),params[j].mode().value())+" "+params[j].name()); 32 } 33 34 ExceptionDef[] exceptions=mt.exceptions(); 35 for (j=0;j<exceptions.length;j++) { 36 if (j==0) { 37 ret.append(" raises "); 38 } else { 39 ret.append(", "); 40 } 41 ret.append(exceptions[j].get_identification().absolute_name()); 42 } 43 return ret.toString(); 44 } catch (Exception e) { 45 throw new IDLWriterDirectorException("Cannot create method declaration.",e); 46 } 47 } 48 } 49 | Popular Tags |