public SassValue invoke ( List < ? > arguments ) { try { ArrayList < Object > values = new ArrayList <> ( argumentConverters . size ( ) ) ; for ( ArgumentConverter argumentConverter : argumentConverters ) { Object value = argumentConverter . convert ( arguments , importStack , context ) ; values . add ( value ) ; } Object result = method . invoke ( object , values . toArray ( ) ) ; return TypeUtils . convertToSassValue ( result ) ; } catch ( Throwable throwable ) { StringWriter stringWriter = new StringWriter ( ) ; PrintWriter printWriter = new PrintWriter ( stringWriter ) ; String message = throwable . getMessage ( ) ; if ( StringUtils . isNotEmpty ( message ) ) { printWriter . append ( message ) . append ( System . lineSeparator ( ) ) ; } throwable . printStackTrace ( printWriter ) ; return new SassError ( stringWriter . toString ( ) ) ; } }
Invoke the method with the given list of arguments .