private MBeanParameterInfo [ ] buildOperationParameterInfo ( Method method , JmxOperationInfo operationInfo ) { Class < ? > [ ] types = method . getParameterTypes ( ) ; MBeanParameterInfo [ ] parameterInfos = new MBeanParameterInfo [ types . length ] ; String [ ] parameterNames = operationInfo . getParameterNames ( ) ; String [ ] parameterDescriptions = operationInfo . getParameterDescriptions ( ) ; for ( int i = 0 ; i < types . length ; i ++ ) { String parameterName ; if ( parameterNames == null || i >= parameterNames . length ) { parameterName = "p" + ( i + 1 ) ; } else { parameterName = parameterNames [ i ] ; } String typeName = types [ i ] . getName ( ) ; String description ; if ( parameterDescriptions == null || i >= parameterDescriptions . length ) { description = "parameter #" + ( i + 1 ) + " of type: " + typeName ; } else { description = parameterDescriptions [ i ] ; } parameterInfos [ i ] = new MBeanParameterInfo ( parameterName , typeName , description ) ; } return parameterInfos ; }
Build our parameter information for an operation .