1 package org.jacorb.ir; 2 3 22 23 import org.omg.CORBA.INTF_REPOS ; 24 import org.omg.PortableServer.POA ; 25 import org.apache.avalon.framework.logger.Logger; 26 27 public class ArrayDef 28 extends IDLType 29 implements org.omg.CORBA.ArrayDefOperations 30 { 31 int size = -1; 32 org.omg.CORBA.TypeCode element_type; 33 org.omg.CORBA.IDLType element_type_def; 34 private org.omg.CORBA.Repository ir; 35 36 private Logger logger; 37 private POA poa; 38 39 public ArrayDef( org.omg.CORBA.TypeCode tc, 40 org.omg.CORBA.Repository ir, 41 Logger logger, 42 POA poa ) 43 { 44 this.logger = logger; 45 this.poa = poa; 46 47 if (tc.kind() != org.omg.CORBA.TCKind.tk_array) 48 { 49 throw new INTF_REPOS ("Precondition volation: TypeCode must be of kind array"); 50 } 51 52 def_kind = org.omg.CORBA.DefinitionKind.dk_Array; 53 this.ir = ir; 54 type = tc; 55 try 56 { 57 size = tc.length(); 58 element_type = tc.content_type(); 59 element_type_def = IDLType.create( element_type, ir, 60 this.logger, this.poa); 61 } 62 catch( org.omg.CORBA.TypeCodePackage.BadKind bk ) 63 { 64 } 66 67 if (element_type_def == null) 68 { 69 throw new INTF_REPOS ("Precondition volation: TypeCode must be of kind array"); 70 } 71 72 this.logger.debug("New ArrayDef"); 73 } 74 75 public int length() 76 { 77 return size; 78 } 79 80 public void length(int a) 81 { 82 size = a; 83 } 84 85 public org.omg.CORBA.TypeCode element_type() 86 { 87 return element_type; 88 } 89 90 public org.omg.CORBA.IDLType element_type_def() 91 { 92 return element_type_def; 93 } 94 95 public void element_type_def(org.omg.CORBA.IDLType a) 96 { 97 element_type_def = a; 98 } 99 100 public void destroy() 101 { 102 type = null; 103 element_type = null; 104 element_type_def = null; 105 } 106 public void define() 107 { 108 109 } 110 } 111 | Popular Tags |