1 22 package org.jboss.iiop.rmi.ir; 23 24 import org.omg.CORBA.TypeCode ; 25 import org.omg.CORBA.TCKind ; 26 import org.omg.CORBA.IRObject ; 27 import org.omg.CORBA.DefinitionKind ; 28 import org.omg.CORBA.PrimitiveKind ; 29 import org.omg.CORBA.PrimitiveDef ; 30 import org.omg.CORBA.PrimitiveDefOperations ; 31 import org.omg.CORBA.PrimitiveDefPOATie; 32 33 import java.util.Map ; 34 import java.util.HashMap ; 35 36 42 class PrimitiveDefImpl 43 extends IDLTypeImpl 44 implements PrimitiveDefOperations , LocalIDLType 45 { 46 48 50 52 54 PrimitiveDefImpl(TypeCode typeCode, 55 RepositoryImpl repository) 56 { 57 super(typeCode, DefinitionKind.dk_Primitive, repository); 58 } 59 60 62 63 65 public IRObject getReference() 66 { 67 if (ref == null) { 68 ref = org.omg.CORBA.PrimitiveDefHelper.narrow( 69 servantToReference(new PrimitiveDefPOATie(this)) ); 70 } 71 return ref; 72 } 73 74 75 77 public PrimitiveKind kind() 78 { 79 return (PrimitiveKind )primitiveTCKindMap.get(type().kind()); 80 } 81 82 84 static boolean isPrimitiveTCKind(TCKind tcKind) 85 { 86 return primitiveTCKindMap.containsKey(tcKind); 87 } 88 89 91 94 private PrimitiveDef ref = null; 95 96 99 private static Map primitiveTCKindMap; 100 101 static { 102 primitiveTCKindMap = new HashMap (); 104 primitiveTCKindMap.put(TCKind.tk_null, PrimitiveKind.pk_null); 105 primitiveTCKindMap.put(TCKind.tk_void, PrimitiveKind.pk_void); 106 primitiveTCKindMap.put(TCKind.tk_short, PrimitiveKind.pk_short); 107 primitiveTCKindMap.put(TCKind.tk_long, PrimitiveKind.pk_long); 108 primitiveTCKindMap.put(TCKind.tk_ushort, PrimitiveKind.pk_ushort); 109 primitiveTCKindMap.put(TCKind.tk_ulong, PrimitiveKind.pk_ulong); 110 primitiveTCKindMap.put(TCKind.tk_float, PrimitiveKind.pk_float); 111 primitiveTCKindMap.put(TCKind.tk_double, PrimitiveKind.pk_double); 112 primitiveTCKindMap.put(TCKind.tk_boolean, PrimitiveKind.pk_boolean); 113 primitiveTCKindMap.put(TCKind.tk_char, PrimitiveKind.pk_char); 114 primitiveTCKindMap.put(TCKind.tk_octet, PrimitiveKind.pk_octet); 115 primitiveTCKindMap.put(TCKind.tk_any, PrimitiveKind.pk_any); 116 primitiveTCKindMap.put(TCKind.tk_TypeCode, PrimitiveKind.pk_TypeCode); 117 primitiveTCKindMap.put(TCKind.tk_Principal, PrimitiveKind.pk_Principal); 118 primitiveTCKindMap.put(TCKind.tk_objref, PrimitiveKind.pk_objref); 119 primitiveTCKindMap.put(TCKind.tk_string, PrimitiveKind.pk_string); 120 primitiveTCKindMap.put(TCKind.tk_longlong, PrimitiveKind.pk_longlong); 121 primitiveTCKindMap.put(TCKind.tk_ulonglong, PrimitiveKind.pk_ulonglong); 122 primitiveTCKindMap.put(TCKind.tk_longdouble, PrimitiveKind.pk_longdouble); 123 primitiveTCKindMap.put(TCKind.tk_wchar, PrimitiveKind.pk_wchar); 124 primitiveTCKindMap.put(TCKind.tk_wstring, PrimitiveKind.pk_wstring); 125 } 126 127 } 128 129 | Popular Tags |