public static String getParameterString ( Iterable < ? extends JvmFormalParameter > elements , boolean isVarArgs , boolean includeName , SARLGrammarKeywordAccess keywords , AnnotationLookup annotationFinder , UIStrings utils ) { final StringBuilder result = new StringBuilder ( ) ; boolean needsSeparator = false ; final Iterator < ? extends JvmFormalParameter > iterator = elements . iterator ( ) ; while ( iterator . hasNext ( ) ) { final JvmFormalParameter parameter = iterator . next ( ) ; if ( needsSeparator ) { result . append ( keywords . getCommaKeyword ( ) ) . append ( " " ) ; //$NON-NLS-1$ } needsSeparator = true ; final boolean isDefaultValued = annotationFinder . findAnnotation ( parameter , DefaultValue . class ) != null ; if ( isDefaultValued ) { result . append ( keywords . getLeftSquareBracketKeyword ( ) ) ; } if ( includeName ) { result . append ( parameter . getName ( ) ) . append ( " " ) ; //$NON-NLS-1$ result . append ( keywords . getColonKeyword ( ) ) . append ( " " ) ; //$NON-NLS-1$ } JvmTypeReference typeRef = parameter . getParameterType ( ) ; if ( isVarArgs && ! iterator . hasNext ( ) && typeRef instanceof JvmGenericArrayTypeReference ) { typeRef = ( ( JvmGenericArrayTypeReference ) typeRef ) . getComponentType ( ) ; result . append ( utils . referenceToString ( typeRef , NULL_TYPE ) ) ; result . append ( keywords . getWildcardAsteriskKeyword ( ) ) ; } else { result . append ( utils . referenceToString ( typeRef , NULL_TYPE ) ) ; } if ( isDefaultValued ) { result . append ( keywords . getRightSquareBracketKeyword ( ) ) ; } } return result . toString ( ) ; }
Format the parameters .