1 7 8 package com.sun.corba.se.impl.presentation.rmi ; 9 10 13 public class IDLType { 14 15 private Class cl_; 16 17 private String [] modules_; 19 20 private String memberName_; 22 23 24 public IDLType(Class cl, String [] modules, String memberName) { 25 cl_ = cl; 26 modules_ = modules; 27 memberName_ = memberName; 28 } 29 30 public IDLType(Class cl, String memberName) { 31 this( cl, new String [0], memberName ) ; 32 } 33 34 public Class getJavaClass() { 35 return cl_; 36 } 37 38 public String [] getModules() 39 { 40 return modules_ ; 41 } 42 43 public String makeConcatenatedName( char separator, boolean fixIDLKeywords ) { 44 StringBuffer sbuff = new StringBuffer () ; 45 for (int ctr=0; ctr<modules_.length; ctr++) { 46 String mod = modules_[ctr] ; 47 if (ctr>0) 48 sbuff.append( separator ) ; 49 50 if (fixIDLKeywords && IDLNameTranslatorImpl.isIDLKeyword(mod)) 51 mod = IDLNameTranslatorImpl.mangleIDLKeywordClash( mod ) ; 52 53 sbuff.append( mod ) ; 54 } 55 56 return sbuff.toString() ; 57 } 58 59 public String getModuleName() { 60 return makeConcatenatedName( '_', false ) ; 68 } 69 70 public String getExceptionName() { 71 String modName = makeConcatenatedName( '/', true ) ; 77 78 String suffix = "Exception" ; 79 String excName = memberName_ ; 80 if (excName.endsWith( suffix )) { 81 int last = excName.length() - suffix.length() ; 82 excName = excName.substring( 0, last ) ; 83 } 84 85 excName += "Ex" ; 87 88 if (modName.length() == 0) 89 return "IDL:" + excName + ":1.0" ; 90 else 91 return "IDL:" + modName + '/' + excName + ":1.0" ; 92 } 93 94 public String getMemberName() { 95 return memberName_; 96 } 97 98 103 public boolean hasModule() { 104 return (modules_.length > 0) ; 105 } 106 } 107 | Popular Tags |