protected void generateDefaultParameters(UseDefaultValues defValues){
      int count = defValues.optParamIndex().length;
      NativeType[] nt = defValues.nativeType();
      Variant.Type[] vt = defValues.variantType();
      String[] literal = defValues.literal();
      for (int i = 0; i < count; i++) {
        switch(nt[i]){
          case Bool:
          case VariantBool:
          case VariantBool_ByRef:
            defaultParameters[i] = Boolean.parseBoolean(literal[i]);
            break;
          case BSTR:
          case BSTR_ByRef:
          case CSTR:
          case Unicode:
            defaultParameters[i] = literal[i];
            break;
          case Double:
          case Double_ByRef:
            defaultParameters[i] = Double.parseDouble(literal[i]);
            break;
          case Float:
          case Float_ByRef:
            defaultParameters[i] = Float.parseFloat(literal[i]);
            break;
          case Int8:
          case Int8_ByRef:
            defaultParameters[i] = Byte.parseByte(literal[i]);
            break;
          case Int16:
          case Int16_ByRef:
            defaultParameters[i] = Short.parseShort(literal[i]);
            break;
          case Int32:
          case Int32_ByRef:
            defaultParameters[i] = Integer.parseInt(literal[i]);
            break;
          case Int64:
          case Int64_ByRef:
            defaultParameters[i] = Long.parseLong(literal[i]);
            break;
          case GUID:
            defaultParameters[i] = new GUID(literal[i]);
            break;
          case Currency:
          case Currency_ByRef:
            defaultParameters[i] = new BigDecimal(literal[i]);
            break;
          case VARIANT:
            Variant v = new Variant();
            switch(vt[i]){
              case VT_I1:
              case VT_UI1:
                v.set(Byte.parseByte(literal[i]));
                break;
              case VT_I2:
              case VT_UI2:
                v.set(Short.parseShort(literal[i]));
                break;
              case VT_I4:
              case VT_UI4:
              case VT_INT:
              case VT_UINT:
                v.set(Integer.parseInt(literal[i]));
                break;
              case VT_I8:
                v.set(Long.parseLong(literal[i]));
                break;
              case VT_R4:
                v.set(Float.parseFloat(literal[i]));
                break;
              case VT_R8:
                v.set(Double.parseDouble(literal[i]));
                break;
              case VT_BOOL:
                v.set(Boolean.parseBoolean(literal[i]));
                break;
              case VT_BSTR:
                v.set(literal[i]);
                break;
              case VT_EMPTY:
                v= new Variant();
                break;
              case VT_ERROR:
                v.makeError((int)Long.parseLong(literal[i], 16));
                break;
//              case VT_CY: ...
              default:
                throw new UnsupportedOperationException("Don't know how to parse literal " + literal[i] + " to an Java Object corresponding to Variant.Type." + vt[i].name());
            }
            v.setType(vt[i]);
            defaultParameters[i] = v;
            break;
          default:
            throw new UnsupportedOperationException("Don't know how to parse literal " + literal[i] + " to an Java Object corresponding to NativeType." + nt[i].name());
        }
      }
    }
protected void generateDefaultParameters ( UseDefaultValues defValues ) { int count = defValues . optParamIndex ( ) . length ; NativeType [ ] nt = defValues . nativeType ( ) ; Variant . Type [ ] vt = defValues . variantType ( ) ; String [ ] literal = defValues . literal ( ) ; for ( int i = 0 ; i < count ; i ++ ) { switch ( nt [ i ] ) { case Bool : case VariantBool : case VariantBool_ByRef : defaultParameters [ i ] = Boolean . parseBoolean ( literal [ i ] ) ; break ; case BSTR : case BSTR_ByRef : case CSTR : case Unicode : defaultParameters [ i ] = literal [ i ] ; break ; case Double : case Double_ByRef : defaultParameters [ i ] = Double . parseDouble ( literal [ i ] ) ; break ; case Float : case Float_ByRef : defaultParameters [ i ] = Float . parseFloat ( literal [ i ] ) ; break ; case Int8 : case Int8_ByRef : defaultParameters [ i ] = Byte . parseByte ( literal [ i ] ) ; break ; case Int16 : case Int16_ByRef : defaultParameters [ i ] = Short . parseShort ( literal [ i ] ) ; break ; case Int32 : case Int32_ByRef : defaultParameters [ i ] = Integer . parseInt ( literal [ i ] ) ; break ; case Int64 : case Int64_ByRef : defaultParameters [ i ] = Long . parseLong ( literal [ i ] ) ; break ; case GUID : defaultParameters [ i ] = new GUID ( literal [ i ] ) ; break ; case Currency : case Currency_ByRef : defaultParameters [ i ] = new BigDecimal ( literal [ i ] ) ; break ; case VARIANT : Variant v = new Variant ( ) ; switch ( vt [ i ] ) { case VT_I1 : case VT_UI1 : v . set ( Byte . parseByte ( literal [ i ] ) ) ; break ; case VT_I2 : case VT_UI2 : v . set ( Short . parseShort ( literal [ i ] ) ) ; break ; case VT_I4 : case VT_UI4 : case VT_INT : case VT_UINT : v . set ( Integer . parseInt ( literal [ i ] ) ) ; break ; case VT_I8 : v . set ( Long . parseLong ( literal [ i ] ) ) ; break ; case VT_R4 : v . set ( Float . parseFloat ( literal [ i ] ) ) ; break ; case VT_R8 : v . set ( Double . parseDouble ( literal [ i ] ) ) ; break ; case VT_BOOL : v . set ( Boolean . parseBoolean ( literal [ i ] ) ) ; break ; case VT_BSTR : v . set ( literal [ i ] ) ; break ; case VT_EMPTY : v = new Variant ( ) ; break ; case VT_ERROR : v . makeError ( ( int ) Long . parseLong ( literal [ i ] , 16 ) ) ; break ; default : throw new UnsupportedOperationException ( "Don't know how to parse literal " + literal [ i ] + " to an Java Object corresponding to Variant.Type." + vt [ i ] . name ( ) ) ; } v . setType ( vt [ i ] ) ; defaultParameters [ i ] = v ; break ; default : throw new UnsupportedOperationException ( "Don't know how to parse literal " + literal [ i ] + " to an Java Object corresponding to NativeType." + nt [ i ] . name ( ) ) ; } } }
Generates the default values for this ComMethod using the given {@link UseDefaultValues} annotation
@param defValues the annotation containing the information to generate the default values.