1 20 21 package org.jacorb.idl; 22 23 27 28 import java.io.PrintWriter ; 29 30 class InitParamDecl 31 extends ParamDecl 32 { 33 34 public InitParamDecl( int num ) 35 { 36 super( num ); 37 } 38 39 public void setPackage( String s ) 40 { 41 s = parser.pack_replace( s ); 42 if( pack_name.length() > 0 ) 43 pack_name = s + "." + pack_name; 44 else 45 pack_name = s; 46 paramTypeSpec.setPackage( s ); 47 } 48 49 50 public void parse() 51 { 52 while( paramTypeSpec.typeSpec() instanceof ScopedName ) 53 { 54 TypeSpec ts = ( (ScopedName)paramTypeSpec.typeSpec() ).resolvedTypeSpec(); 55 56 if( ts != null ) 57 paramTypeSpec = ts; 58 } 59 } 60 61 public void print( PrintWriter ps ) 62 { 63 ps.print( paramTypeSpec.toString() + " " + simple_declarator ); 64 } 65 66 public String printWriteStatement( String ps ) 67 { 68 return printWriteStatement( simple_declarator.toString(), ps ); 69 } 70 71 public String printWriteStatement( String name, String ps ) 72 { 73 return paramTypeSpec.typeSpec().printWriteStatement( name, ps ); 74 } 75 76 public String printReadExpression( String ps ) 77 { 78 return paramTypeSpec.typeSpec().printReadExpression( ps ); 79 } 80 81 } 82 83 84 85 86 87 88 89 | Popular Tags |