private void declare ( IndentingWriter o , IParam p ) throws BindingException { TypeBinding vb = TypeBinding . bind ( g , p . getType ( ) , p . getName ( ) ) ; String javaType = vb . javaType ; if ( method . isVarArg ( ) && p == params [ params . length - 1 ] ) { // use varargs if applicable if ( javaType . endsWith ( "[]" ) ) javaType = javaType . substring ( 0 , javaType . length ( ) - 2 ) + "..." ; } if ( p . isOptional ( ) ) { o . print ( "@Optional " ) ; } Variant defValue = p . getDefaultValue ( ) ; if ( defValue != null ) { try { o . print ( "@DefaultValue(\"" + defValue . stringValue ( ) + "\") " ) ; } catch ( ComException e ) { // in rare occasions we get default values that are not printable. // ignore such an error. } } if ( p . isLCID ( ) ) { o . print ( "@LCID " ) ; } if ( ! vb . isDefault && needsMarshalAs ( ) ) { o . printf ( "@MarshalAs(NativeType.%1s) " , vb . nativeType . name ( ) ) ; } o . print ( javaType ) ; o . print ( ' ' ) ; declareParamName ( o , p ) ; }
Declares a parameter .